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

how to add more option on (forumurl/account/alert-preferences)

Discussion in 'XenForo Development Discussions' started by arpitjain, Oct 2, 2013.

  1. arpitjain

    arpitjain Member

    i want to add my options on /account/alert-preferences page ..and want to access these value in related controller for alert preference ...
    how can i edit these options or add my options
     
    Last edited: Oct 2, 2013
  2. arpitjain

    arpitjain Member

    i want to add new options at the and of alert preference template ....and want to store its values to the database table where other option of pereferences page are store.
    please reply...
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    You would add some template code like this to the account_alert_preferences template:

    Code:
    <h3 class="sectionHeader">{xen:phrase xengallery_media}</h3>
    <dl class="ctrlUnit">
        <dt>{xen:phrase receive_alert_when_someone}...</dt>
        <dd>
            <ul>
                <li><input type="hidden" name="alertSet[xengallery_media_like]" value="1" />
                    <label><input type="checkbox" value="1" name="alert[xengallery_media_like]" {xen:checked "!{$alertOptOuts.xengallery_media_like}"} /> {xen:phrase xengallery_likes_your_media}</label>
                    <p class="hint">{xen:phrase xengallery_someone_likes_your_media}</p>
                </li>
            </ul>
        </dd>
    </dl>
    In this particular example: "xengallery_media_like" is the content type_action of the alert.

    You then need a bit of code like this to send the alert, and it's wrapped around a conditional that evaluates the settings on the user's alert page:

    PHP:
                    if (!$userModel->isUserIgnored($contentUser$likeUserId)
                        && 
    XenForo_Model_Alert::userReceivesAlert($contentUser$contentType'like')
                    )
                    {
                        
    XenForo_Model_Alert::alert(
                            
    $contentUserId,
                            
    $likeUserId,
                            
    $likeUsername,
                            
    $contentType,
                            
    $contentId,
                            
    'like'
                        
    );
                    }
     
  4. arpitjain

    arpitjain Member

    i want to add options for thread or resource related post alerts...i want to alert user when author of thread reply to user post only.......which controller and model use for this...is there any action for resource or thread related alerts...
     

Share This Page