Cupara
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.
alert_xfpoints_sent
xfpoints_alert_preferences
xfPoints_Model_Gift
xfPoints_AlertHandler_Gift
Database: xf_content_type and xf_content_type_field
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.
alert_xfpoints_sent
HTML:
{xen:phrase xfpoints_x_sent_gift_y,
'name={xen:helper username, $user, 'subject'}',
'amount={$content.amount}',
'points={$xenOptions.xfpoints_currency_name}'}
xfpoints_alert_preferences
HTML:
<h3 class="sectionHeader">{xen:phrase xfpoints}</h3>
<dl class="ctrlUnit">
<dt>{xen:phrase xfpoints_receive_alert_when_you_receive}...</dt>
<dd>
<ul>
<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>
</li>
</xen:hook>
</ul>
</dd>
</dl>
xfPoints_Model_Gift
PHP:
public function getGiftByIds(array $giftIds)
{
return $this->fetchAllKeyed('
SELECT *
FROM xfpoints_transactions
WHERE transaction_id IN (' . $this->_getDb()->quote($gifIds) . ')
', 'transaction_id');
}
xfPoints_AlertHandler_Gift
PHP:
<?php
class xfPoints_AlertHandler_Gift extends XenForo_AlertHandler_Abstract
{
public function getContentByIds(array $contentIds, $model, $userId, array $viewingUser)
{
return $model->getModelFromCache('xfPoints_Model_Gift')->getGiftByIds($contentIds);
}
}
Database: xf_content_type and xf_content_type_field
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.