Requesting support for "Yet Another Global Announcements Mod"

Started by marwan, September 21, 2010, 06:24:14 PM

Previous topic - Next topic

marwan

Hi,

I tried installing the mod on my RC3 and got this error:

Execute Modification | ./Sources/LogInOut.php | Test failed

Please help.

Hj Ahmad Rasyid Hj Ismail

Why don't you ask in the support thread for that mod? She's quite fast in replying...

By the way, you can install it manually.

marwan

The support thread is locked so I PMed the developer.

I'm afraid of innstalling it manually. I know I can always take backups but no... Don't wanna risk and waste time.

Have you installed it on RC3?

Adish - (F.L.A.M.E.R)

Go ahead with the installation and do these edits after it:
Find:
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
    if (empty($maintenance) || allowedTo('admin_forum'))
        redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
    else
        redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);


Replace with:
// YAGAM Force the Normal Users - Based on the Blue Dream Code on  Tips and Tricks
    if (!empty($modSettings['yagam_force_id']) && is_numeric($modSettings['yagam_force_id']))
    {     
       // Verify if he saw the Announcement
       $request = $smcFunc['db_query']('', '
          SELECT id_announcement, id_member
          FROM {db_prefix}announcements_log
          WHERE id_announcement = {int:announcement_id}
             AND id_member = {int:user_id}
          LIMIT 1',
          array(
            'announcement_id' => $modSettings['yagam_force_id'],
            'user_id' => $user_info['id'],
            )
        );
       list ($read) = $smcFunc['db_fetch_row']($request);
       $smcFunc['db_free_result']($request);
       
       // Just log you back out if it's in maintenance mode and you AREN'T an admin.
       if((empty($maintenance) || allowedTo('admin_forum')) && (empty($read)))
          redirectexit('action=announcement;aid='.$modSettings['yagam_force_id']);
       elseif ((empty($maintenance) || allowedTo('admin_forum')) && ((!empty($read)) || empty($exists)))
          redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
       else
          redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
   }
   else
   {
    // Just log you back out if it's in maintenance mode and you AREN'T an admin.
    if (empty($maintenance) || allowedTo('admin_forum'))
        redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
    else
        redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
    }


That is it and you should be fine. :)

Hj Ahmad Rasyid Hj Ismail

As the author mentioned in the support thread, you can get help here:
http://www.smfpacks.com/index.php?topic=136.0

But try to do it manually as suggested by FLAMER. It wont hurt (if you know how).

marwan


Adish - (F.L.A.M.E.R)


marwan

Thanks! Will install it using the package manager and will manually modify the file as you suggested.

marwan

Quote from: ahrasis on September 21, 2010, 07:32:12 PM
As the author mentioned in the support thread, you can get help here:
http://www.smfpacks.com/index.php?topic=136.0

But try to do it manually as suggested by FLAMER. It wont hurt (if you know how).

The thread is right, can you post a reply or comment on that thread???!!! :-\

Hj Ahmad Rasyid Hj Ismail


marwan


Hj Ahmad Rasyid Hj Ismail

I just registered, logged in and post in that. You can read my post there.  ;D

marwan

Quote from: (F.L.A.M.E.R) on September 21, 2010, 07:30:25 PM
Go ahead with the installation and do these edits after it:
Find:
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
    if (empty($maintenance) || allowedTo('admin_forum'))
        redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
    else
        redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);


Replace with:
// YAGAM Force the Normal Users - Based on the Blue Dream Code on  Tips and Tricks
    if (!empty($modSettings['yagam_force_id']) && is_numeric($modSettings['yagam_force_id']))
    {     
       // Verify if he saw the Announcement
       $request = $smcFunc['db_query']('', '
          SELECT id_announcement, id_member
          FROM {db_prefix}announcements_log
          WHERE id_announcement = {int:announcement_id}
             AND id_member = {int:user_id}
          LIMIT 1',
          array(
            'announcement_id' => $modSettings['yagam_force_id'],
            'user_id' => $user_info['id'],
            )
        );
       list ($read) = $smcFunc['db_fetch_row']($request);
       $smcFunc['db_free_result']($request);
       
       // Just log you back out if it's in maintenance mode and you AREN'T an admin.
       if((empty($maintenance) || allowedTo('admin_forum')) && (empty($read)))
          redirectexit('action=announcement;aid='.$modSettings['yagam_force_id']);
       elseif ((empty($maintenance) || allowedTo('admin_forum')) && ((!empty($read)) || empty($exists)))
          redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
       else
          redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
   }
   else
   {
    // Just log you back out if it's in maintenance mode and you AREN'T an admin.
    if (empty($maintenance) || allowedTo('admin_forum'))
        redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
    else
        redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
    }


That is it and you should be fine. :)

Couldnt find the code. Attached is the LogInOut.php file. Can you please help me F.L.A.M.E.R?

Hj Ahmad Rasyid Hj Ismail


marwan

Quote from: ahrasis on September 22, 2010, 05:30:59 AM
I've done it for you. Please have a try.
Thanks a lot bro! Did you find the code and could replace it?

Are things different with me or am I getting old not finding stuff?

Hj Ahmad Rasyid Hj Ismail

It was just there. Glad to hear it works. By the way, I always use UltraEdit to edit files. It is safer and easier to use.

marwan


Hj Ahmad Rasyid Hj Ismail

A try is free but it is a paid version I am afraid. Try to use notepad++ instead and see how useful it is.

Advertisement: