1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Alert Handler

Discussion in 'XenForo Development Discussions' started by Mythotical, Aug 13, 2013.

  1. Mythotical

    Mythotical Well-Known Member

    I am missing something here. I have the template, file, and content_type but the alert popup displays 1 but does not grab my template to display that user a has send you xxxx points.

    {xen:phrase xfpoints_x_sent_gift_y,
       'name={xen:helper username, $user, 'subject'}',
      <h3 class="sectionHeader">{xen:phrase xfpoints}</h3>
       <dl class="ctrlUnit">
         <dt>{xen:phrase xfpoints_receive_alert_when_you_receive}...</dt>
             <xen:hook name="account_alerts_xfpoints">
             <li><input type="hidden" name="alertSet[xfpoints_sent]" value="1" />
               <label><input type="checkbox" value="1" name="alert[xfpoints_sent]" {xen:checked "!{$alertOptOuts.xfpoints_sent}"} /> {xen:phrase xfpoints_send_user}</label
                ><p class="hint">{xen:phrase xfpoints_someone_sends_gift}</p>
        public function getGiftByIds(array $giftIds)
           SELECT *
             FROM xfpoints_transactions
           WHERE transaction_id IN (' 
    $this->_getDb()->quote($gifIds) . ')

    class xfPoints_AlertHandler_Gift extends XenForo_AlertHandler_Abstract
       public function 
    getContentByIds(array $contentIds$model$userId, array $viewingUser)
    Database: xf_content_type and xf_content_type_field
    xfcoder.com | localhost.png
    xfcoder.com | localhost 2.png

    I'm not sure what else I need to do to make sure my template of xfpoints_sent is called or where I went wrong for getting it to work.
  2. Nobita.Kun

    Nobita.Kun Well-Known Member

    You must rebuild contentType after you run sql add column :)
    Look at xf_content_type_filed that column filed [BOL-0]
  3. Mythotical

    Mythotical Well-Known Member

    I'm not understanding you there. There is no method I aware of to rebuild content_type.
  4. Nobita.Kun

    Nobita.Kun Well-Known Member

    When you add something to xf_content_type and xf_content_type_filed You must rebuild that
    As I saw your database
    xf_content_type column FIELD [BLOB - 0B] this look like don't save some information for alert handler. You can export some handler to understand that :)

    My Addon also using alert handler :) http://xenforo.com/community/resources/thread-action-alert.2082/
  5. Mythotical

    Mythotical Well-Known Member

    Got it, thanks @Nobita.Kun Now I have an error that I need to fix and it will work.
    Nobita.Kun likes this.

Share This Page