本文整理汇总了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);
}
示例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;
}
}
}
}
示例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;
}
示例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;
}