[bd] Alerts [Paid] 1.0.3

Making alert smarter and more useful.

  1. Kerby

    Kerby New Member

    I don't know if it works with 1.0.1, but with newest 1.0.2 the issue with tapatalk is gone :)
     
    xfrocks likes this.
  2. Kerby

    Kerby New Member

    Ah sorry. I have to correct:
    Only this is fixed.

    This is still a issue.
     
  3. xfrocks

    xfrocks XenForo rocks! Staff Member

  4. dknife

    dknife New Member

    I just bought this addon and it doesn't seem to be functioning. Is there anything extra I need to perform? The addon is active and the 2 options are ticked however alerts are still separated. Tested by Liking several of my posts in a single thread from my other account.
     
  5. xfrocks

    xfrocks XenForo rocks! Staff Member

    This add-on group likes for one post into one alert. So you need to have more than 1 user liking only one post of yours to test it.
     
  6. dknife

    dknife New Member

    hmmm whilst that's somewhat useful, I was hoping to solve a different issue with masses of likes from a user across multiple posts as well.
     
  7. xfrocks

    xfrocks XenForo rocks! Staff Member

    That would be kinda useless I think. Even Facebook won't do that 🤔
     
  8. RoldanLT

    RoldanLT Webmaster

    Does this addon works this way also?
     
  9. xfrocks

    xfrocks XenForo rocks! Staff Member

    No. It only marks as read if user click the link in their email.
     
    RoldanLT likes this.
  10. RoldanLT

    RoldanLT Webmaster

    I got this error, every time user likes.
    Code:
    Server Error Log
    
    Error Info
    ErrorException: Undefined variable: extra_data - library/OneSignal/Model/Alert.php:129
    Generated By: ilumina007, A moment ago
    
    Stack Trace
    #0 /home/nginx/domains/domain.com/public/library/OneSignal/Model/Alert.php(129): XenForo_Application::handlePhpError(8, 'Undefined varia...', '/home/nginx/dom...', 129, Array)
    #1 /home/nginx/domains/domain.com/public/library/OneSignal/Model/Alert.php(30): OneSignal_Alert::sendAlert(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array)
    #2 /home/nginx/domains/domain.com/public/library/SV/DeadlockAvoidance/XenForo/Model/Alert.php(14): OneSignal_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array)
    #3 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(36): SV_DeadlockAvoidance_XenForo_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array)
    #4 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(250): bdAlerts_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array)
    #5 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(80): bdAlerts_Model_Alert->_bdAlerts_alertUser(Array, true)
    #6 /home/nginx/domains/domain.com/public/library/bdAlerts/Listener.php(61): bdAlerts_Model_Alert->bdAlerts_sendPendingAlerts()
    #7 /home/nginx/domains/domain.com/public/library/XenForo/CodeEvent.php(90): bdAlerts_Listener::front_controller_post_view(Object(XenForo_FrontController), '{"templateHtml"...')
    #8 /home/nginx/domains/domain.com/public/library/XenForo/FrontController.php(183): XenForo_CodeEvent::fire('front_controlle...', Array)
    #9 /home/nginx/domains/domain.com/public/index.php(13): XenForo_FrontController->run()
    #10 {main}
    
    Request State
    array(3) {
      ["url"] => string(39) "https://www.domain.com/p/3640673/like"
      ["_GET"] => array(1) {
        ["/p/3640673/like"] => string(0) ""
      }
      ["_POST"] => array(4) {
        ["_xfRequestUri"] => string(41) "/t/threadtitle.276573/"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfToken"] => string(8) "********"
        ["_xfResponseType"] => string(4) "json"
      }
    }

    OneSignal Addon: https://theadminzone.com/resources/...h-notifications-now-with-simple-install.1069/
     
  11. xfrocks

    xfrocks XenForo rocks! Staff Member

    I can't access the add-on page but it's worth trying to disable that add-on and see if the error goes away.
     

    Attached Files:

  12. RoldanLT

    RoldanLT Webmaster

    Relevant code from the addon:
    Code:
    if($extraData != null)
        {
            $content_response = "Reason: " . $extra_data;
        }
            $app_id = $options->os_pn_app_id;
            $auth_key = $options->os_pn_auth_key;
           
            $content = array(
            "en" => $content_response
            );
           
            $headings = array(
            "en" => $options->boardTitle //this is the first line of the notice, example being: Site Notification or Site Alert or something.
            );
           
            $fields = array(
            'app_id' => $app_id,
            'tags' => array(array("key"=>"uid","relation"=>"=","value"=>$alertUserId)),
            'contents' => $content,
            'url' => $url,
            'headings' => $headings
            );
           
            $fields = json_encode($fields);
            //print("\nJSON sent:\n");
            //print($fields);
           
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
                                   'Authorization: Basic ' . $auth_key));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
            curl_setopt($ch, CURLOPT_HEADER, FALSE);
            curl_setopt($ch, CURLOPT_POST, TRUE);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
           
            $response = curl_exec($ch);
            curl_close($ch);
           
       
            //print($response);
           
        }
     
  13. xfrocks

    xfrocks XenForo rocks! Staff Member

    This looks bad

    PHP:
        if($extraData != null)
        {
            
    $content_response "Reason: " $extra_data;
        }
    Should be...

    PHP:
        if($extraData != null)
        {
            
    $content_response "Reason: " $extraData;
        }
     
    RoldanLT likes this.
  14. RoldanLT

    RoldanLT Webmaster

    Thanks a lot Sir!
     
  15. RoldanLT

    RoldanLT Webmaster

    With the recent addon.
    New error pop-ups:
    Code:
    Server Error Log
    Error Info
    ErrorException: Array to string conversion - library/OneSignal/Model/Alert.php:125
    Generated By: user, 3 minutes ago
    Stack Trace
    #0 /library/OneSignal/Model/Alert.php(125): XenForo_Application::handlePhpError(8, 'Array to string...', '/home/nginx/dom...', 125, Array)
    #1 /library/OneSignal/Model/Alert.php(30): OneSignal_Alert::sendAlert(795589, 759619, 'user', 'post', 3569642, 'like', Array)
    #2 /library/SV/DeadlockAvoidance/XenForo/Model/Alert.php(14): OneSignal_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array)
    #3 /library/bdAlerts/Model/Alert.php(36): SV_DeadlockAvoidance_XenForo_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array)
    #4 /library/bdAlerts/Model/Alert.php(250): bdAlerts_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array)
    #5 /library/bdAlerts/Model/Alert.php(80): bdAlerts_Model_Alert->_bdAlerts_alertUser(Array, true)
    #6 /library/bdAlerts/Listener.php(61): bdAlerts_Model_Alert->bdAlerts_sendPendingAlerts()
    #7 /library/XenForo/CodeEvent.php(90): bdAlerts_Listener::front_controller_post_view(Object(XenForo_FrontController), '{"templateHtml"...')
    #8 /library/XenForo/FrontController.php(183): XenForo_CodeEvent::fire('front_controlle...', Array)
    #9 /index.php(13): XenForo_FrontController->run()
    #10 {main}
    Request State
    array(3) {
      ["url"] => string(39) "https://www.domain.com/p/3569642/like"
      ["_GET"] => array(1) {
        ["/p/3569642/like"] => string(0) ""
      }
      ["_POST"] => array(4) {
        ["_xfRequestUri"] => string(73) "/t/thread.272725/"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfToken"] => string(8) "********"
        ["_xfResponseType"] => string(4) "json"
      }
    }
     
  16. xfrocks

    xfrocks XenForo rocks! Staff Member

    How does this go btw? Can you update us with your situation @RoldanLT ?
     
  17. RoldanLT

    RoldanLT Webmaster

    I'm not using the other for now, until I move server.
     
  18. xfrocks

    xfrocks XenForo rocks! Staff Member

    Thank you for the update. Please let us know when you get back to it and whether it still doesn't work properly.
     
    RoldanLT likes this.
Loading...