[bd] Alerts [Paid] 1.0.3

Making alert smarter and more useful.

  1. RoldanLT

    RoldanLT Active Member

    Does this addon works this way also?
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @RoldanLT No. It only marks as read if user click the link in their email.
       
      RoldanLT likes this.
      1
  2. RoldanLT

    RoldanLT Active Member

    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/
     
    1. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @RoldanLT 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:

    2. RoldanLT

      RoldanLT Active Member

      RoldanLT @RoldanLT 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);
             
          }
       
    3. RoldanLT

      RoldanLT Active Member

      RoldanLT @RoldanLT 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"
        }
      }
       
    4. xfrocks

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @RoldanLT How does this go btw? Can you update us with your situation @RoldanLT ?
       
  3. 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.
  4. RoldanLT

    RoldanLT Active Member

    Thanks a lot Sir!
     
  5. RoldanLT

    RoldanLT Active Member

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

      xfrocks XenForo rocks!
      Staff Member

      xfrocks @RoldanLT 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.
      1
Loading...