当前位置: 首页>>代码示例>>PHP>>正文


PHP EasyBlogHelper::getUnsubscribeLink方法代码示例

本文整理汇总了PHP中EasyBlogHelper::getUnsubscribeLink方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getUnsubscribeLink方法的具体用法?PHP EasyBlogHelper::getUnsubscribeLink怎么用?PHP EasyBlogHelper::getUnsubscribeLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EasyBlogHelper的用法示例。


在下文中一共展示了EasyBlogHelper::getUnsubscribeLink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addMailQueue

 /**
  * Retrieves the html codes for the ratings.
  *
  * @param	int	$uid	The unique id for the item that is being rated
  * @param	string	$type	The unique type for the item that is being rated
  * @param	string	$command	A textual representation to request user to vote for this item.
  * @param	string	$element	A dom element id.
  **/
 public function addMailQueue(EasyBlogSubscriptionItem $item)
 {
     $config = EasyBlogHelper::getConfig();
     // building unsubcribe linke object
     $obj = new stdClass();
     $obj->type = $item->utype;
     $obj->id = $item->uid;
     $obj->user_id = $item->user_id;
     $obj->created = $item->ucreated;
     // building email data
     $maildata = array();
     $maildata['fullname'] = $item->ufullname;
     $maildata['target'] = $item->targetname;
     $maildata['targetlink'] = $item->targetlink;
     $maildata['type'] = $item->utype;
     $recipient = new stdClass();
     $recipient->email = $item->uemail;
     $recipient->unsubscribe = EasyBlogHelper::getUnsubscribeLink($obj, true);
     $emailTitle = JText::_('COM_EASYBLOG_SUBSCRIPTION_EMAIL_CONFIRMATION');
     $notification = EasyBlogHelper::getHelper('Notification');
     $notification->send(array($recipient), $emailTitle, 'email.subscriptions.confirmation', $maildata);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:30,代码来源:subscription.php

示例2: getSiteSubscriberEmails

 public function getSiteSubscriberEmails(&$emails = array())
 {
     $model = EasyBlogHelper::getModel('Subscription');
     $subscribers = $model->getSiteSubscribers();
     if (!empty($subscribers)) {
         foreach ($subscribers as $subscriber) {
             if (!array_key_exists($subscriber->email, $emails)) {
                 $obj = new stdClass();
                 $obj->email = $subscriber->email;
                 $obj->unsubscribe = EasyBlogHelper::getUnsubscribeLink($subscriber, true);
                 $emails[$subscriber->email] = $obj;
             }
         }
     }
 }
开发者ID:Tommar,项目名称:vino2,代码行数:15,代码来源:notification.php

示例3: getUnsubscribeLinks

 /**
  * prepare unsubscribe links
  *
  * @since	4.0
  * @access	public
  * @param	string - email address
  *          strig - format - accept html, array
  * @return
  */
 public function getUnsubscribeLinks($email)
 {
     $db = EB::db();
     $query = 'select *,';
     $query .= '	(case';
     $query .= '		when `utype` = ' . $db->Quote(EBLOG_SUBSCRIPTION_SITE) . ' then ' . $db->Quote('sitesubscription');
     $query .= '		when `utype` = ' . $db->Quote(EBLOG_SUBSCRIPTION_BLOGGER) . ' then ' . $db->Quote('bloggersubscription');
     $query .= '		when `utype` = ' . $db->Quote(EBLOG_SUBSCRIPTION_CATEGORY) . ' then ' . $db->Quote('categorysubscription');
     $query .= '		when `utype` = ' . $db->Quote(EBLOG_SUBSCRIPTION_TEAMBLOG) . ' then ' . $db->Quote('teamsubscription');
     $query .= '		when `utype` = ' . $db->Quote(EBLOG_SUBSCRIPTION_ENTRY) . ' then ' . $db->Quote('subscription');
     $query .= '	end) as `type` from ' . $db->qn('#__easyblog_subscriptions');
     $query .= " WHERE `email` = " . $db->Quote($email);
     $db->setQuery($query);
     $results = $db->loadObjectList();
     $links = array();
     $types = array();
     $created = '';
     if ($results) {
         foreach ($results as $item) {
             $link = EasyBlogHelper::getUnsubscribeLink($item, true);
             $links[$item->type] = $link;
             $types[$item->type] = $item->id . '|' . $item->created;
         }
         if (count($links) > 1) {
             // lets generate a 'all' type unsubscribe link.
             $link = EasyBlogHelper::getUnsubscribeLink($types, true, true, $email);
             $links['all'] = $link;
         }
     }
     return $links;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:40,代码来源:notification.php

示例4: display

 function display($tmpl = null)
 {
     $mainframe = JFactory::getApplication();
     $document = JFactory::getDocument();
     $config = EasyBlogHelper::getConfig();
     $my = JFactory::getUser();
     $postTable = EasyBlogHelper::getTable('Blog', 'Table');
     $bloggerTable = EasyBlogHelper::getTable('Profile', 'Table');
     $catTable = EasyBlogHelper::getTable('Category', 'Table');
     $teamTable = EasyBlogHelper::getTable('TeamBlog', 'Table');
     $document->setTitle(JText::_('COM_EASYBLOG_SUBSCRIPTIONS_PAGE_TITLE'));
     if (!EasyBlogRouter::isCurrentActiveMenu('subscription')) {
         $this->setPathway(JText::_('COM_EASYBLOG_SUBSCRIPTIONS_BREADCRUMB'));
     }
     $subscription = array();
     if (!empty($my->id)) {
         $subs = EasyBlogHelper::getSubscriptionbyUser($my->id);
         if (!empty($subs)) {
             foreach ($subs as $sub) {
                 $temp = new stdClass();
                 $temp->id = $sub->id;
                 $temp->type = $sub->type;
                 $temp->unsublink = EasyBlogHelper::getUnsubscribeLink($sub, false);
                 switch ($sub->type) {
                     case 'sitesubscription':
                         $temp->name = '';
                         $temp->link = '';
                         break;
                     case 'subscription':
                         $postTable = EasyBlogHelper::getTable('Blog');
                         $postTable->load($sub->cid);
                         $temp->name = $postTable->title;
                         $temp->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $postTable->id, false);
                         break;
                     case 'bloggersubscription':
                         $bloggerTable = EasyBlogHelper::getTable('Profile');
                         $bloggerTable->load($sub->cid);
                         $temp->name = $bloggerTable->getName();
                         $temp->link = $bloggerTable->getProfileLink();
                         break;
                     case 'categorysubscription':
                         $catTable = EasyBlogHelper::getTable('Category');
                         $catTable->load($sub->cid);
                         $temp->name = $catTable->title;
                         $temp->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $catTable->id, false);
                         break;
                     case 'teamsubscription':
                         $teamTable = EasyBlogHelper::getTable('TeamBlog');
                         $teamTable->load($sub->cid);
                         $temp->name = $teamTable->title;
                         $temp->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $teamTable->id, false);
                         break;
                     default:
                         //dont do anything if it is an unrecognize type.
                 }
                 $subscription[$sub->type][] = $temp;
             }
         }
     }
     $theme = new CodeThemes();
     $theme->set('my', $my);
     $theme->set('subscription', $subscription);
     $html = $theme->fetch('subscription.php');
     echo $html;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:65,代码来源:view.html.php


注:本文中的EasyBlogHelper::getUnsubscribeLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。