本文整理汇总了PHP中DJClassifiedsSEO::getNewAdLink方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getNewAdLink方法的具体用法?PHP DJClassifiedsSEO::getNewAdLink怎么用?PHP DJClassifiedsSEO::getNewAdLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DJClassifiedsSEO
的用法示例。
在下文中一共展示了DJClassifiedsSEO::getNewAdLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notifyNewAdvertUser
public static function notifyNewAdvertUser($item, $cat)
{
$app = JFactory::getApplication();
$config = JFactory::getConfig();
$par = JComponentHelper::getParams('com_djclassifieds');
$user = JFactory::getUser();
if ($user->id) {
$mailto = $user->email;
} else {
$mailto = $item->email;
}
$mailfrom = $app->getCfg('mailfrom');
$fromname = $config->get('sitename') . ' - ' . str_ireplace('administrator/', '', JURI::base());
$subject = JText::_('COM_DJCLASSIFIEDS_NAU_EMAIL_TITLE') . ' ' . $config->get('sitename');
$m_message = JText::_('COM_DJCLASSIFIEDS_NAU_EMAIL_TITLE') . ' ' . $config->get('sitename') . "<br /><br />";
$m_message .= JText::_('COM_DJCLASSIFIEDS_TITLE') . ': ' . $item->name . "<br /><br />";
$m_message .= JText::_('COM_DJCLASSIFIEDS_STATUS') . ': ';
if ($item->published) {
$m_message .= JText::_('COM_DJCLASSIFIEDS_PUBLISHED') . "<br /><br />";
} else {
$m_message .= JText::_('COM_DJCLASSIFIEDS_WAITING_FOR_PUBLISH') . "<br /><br />";
}
$m_message .= JText::_('COM_DJCLASSIFIEDS_INTRO_DESCRIPTION') . ': ' . $item->intro_desc . "<br /><br />";
$u = JURI::getInstance(JURI::base());
if ($u->getScheme()) {
$link = $u->getScheme() . '://';
} else {
$link = 'http://';
}
$edit_link = $link;
$link .= $u->getHost() . JRoute::_(DJClassifiedsSEO::getItemRoute($item->id . ':' . $item->alias, $item->cat_id . ':' . $cat->alias));
$m_message .= JText::_('COM_DJCLASSIFIEDS_ADVERT_LINK') . ': <a href="' . $link . '">' . $link . '</a><br /><br />';
if (!$user->id && $item->email && $par->get('guest_can_edit', 0)) {
$edit_link .= $u->getHost() . JRoute::_(DJClassifiedsSEO::getNewAdLink() . '&token=' . $item->token);
$m_message .= JText::_('COM_DJCLASSIFIEDS_EDITION_LINK') . ': <a href="' . $edit_link . '">' . $edit_link . '</a><br /><br />';
}
$mailer = JFactory::getMailer();
$mailer->sendMail($mailfrom, $fromname, $mailto, $subject, $m_message, $mode = 1);
return null;
}
示例2: notifyNewAdvertUser
public static function notifyNewAdvertUser($item, $cat)
{
$app = JFactory::getApplication();
$config = JFactory::getConfig();
$db = JFactory::getDBO();
$par = JComponentHelper::getParams('com_djclassifieds');
$user = JFactory::getUser();
$u = JURI::getInstance(JURI::root());
$query = "SELECT i.id, i.cat_id, i.name, i.alias, i.intro_desc, i.description, i.user_id,i.promotions, i.email, i.published, i.token, c.name as c_name, c.alias as c_alias,u.name as u_name,u.email as u_email, u.username as u_username " . "FROM #__djcf_items i " . "LEFT JOIN #__djcf_categories c ON c.id=i.cat_id " . "LEFT JOIN #__users u ON u.id=i.user_id " . "WHERE i.id = " . $item->id . " LIMIT 1";
$db->setQuery($query);
$item = $db->loadObject();
if ($user->id) {
$mailto = $user->email;
} else {
$mailto = $item->email;
}
$mailfrom = $app->getCfg('mailfrom');
$fromname = $config->get('sitename');
$item->c_name = '';
$item->c_alias = '';
if ($cat) {
$item->c_name = $cat->name;
$item->c_alias = $cat->alias;
}
$query = "SELECT e.* FROM #__djcf_emails e WHERE e.id = 11 LIMIT 1";
$db->setQuery($query);
$email = $db->loadObject();
$subject = $email->title;
$m_message = self::parseMessageBody($email->content, $email->id, $item);
if (!$user->id && $item->email && $par->get('guest_can_edit', 0)) {
if ($u->getScheme()) {
$edit_link = $u->getScheme() . '://';
} else {
$edit_link = 'http://';
}
$edit_link .= $u->getHost() . JRoute::_(DJClassifiedsSEO::getNewAdLink() . '&token=' . $item->token);
if (strstr($m_message, '[[advert_edit]]')) {
$m_message = str_ireplace('[[advert_edit]]', '<a href="' . $edit_link . '">' . $edit_link . '</a>', $m_message);
} else {
$m_message .= JText::_('COM_DJCLASSIFIEDS_EDITION_LINK') . ': <a href="' . $edit_link . '">' . $edit_link . '</a><br /><br />';
}
} else {
$m_message = str_ireplace('[[advert_edit]]', '', $m_message);
}
if (!$user->id && $item->email && $par->get('guest_can_delete', 0)) {
if ($u->getScheme()) {
$delete_link = $u->getScheme() . '://';
} else {
$delete_link = 'http://';
}
$delete_link .= $u->getHost() . JRoute::_(DJClassifiedsSEO::getUserAdsLink() . '&t=delete&token=' . $item->token);
if (strstr($m_message, '[[advert_delete]]')) {
$m_message = str_ireplace('[[advert_delete]]', '<a href="' . $delete_link . '">' . $delete_link . '</a>', $m_message);
} else {
$m_message .= JText::_('COM_DJCLASSIFIEDS_REMOVE_LINK') . ': <a href="' . $delete_link . '">' . $delete_link . '</a><br /><br />';
}
} else {
$m_message = str_ireplace('[[advert_delete]]', '', $m_message);
}
//echo $m_message;die();
$mailer = JFactory::getMailer();
$mailer->sendMail($mailfrom, $fromname, $mailto, $subject, $m_message, $mode = 1);
/*
$subject = JText::_('COM_DJCLASSIFIEDS_NAU_EMAIL_TITLE').' '.$config->get('sitename');
$m_message = JText::_('COM_DJCLASSIFIEDS_NAU_EMAIL_TITLE').' '.$config->get('sitename')."<br /><br />";
$m_message .= JText::_('COM_DJCLASSIFIEDS_TITLE').': '.$item->name."<br /><br />";
$m_message .= JText::_('COM_DJCLASSIFIEDS_STATUS').': ';
if($item->published){
$m_message .= JText::_('COM_DJCLASSIFIEDS_PUBLISHED')."<br /><br />";
}else{
$m_message .= JText::_('COM_DJCLASSIFIEDS_WAITING_FOR_PUBLISH')."<br /><br />";
}
$m_message .= JText::_('COM_DJCLASSIFIEDS_INTRO_DESCRIPTION').': '.$item->intro_desc."<br /><br />";
$u = JURI::getInstance( JURI::root() );
if($u->getScheme()){
$link = $u->getScheme().'://';
}else{
$link = 'http://';
}
$edit_link = $link;
$delete_link = $link;
$link .= $u->getHost().JRoute::_(DJClassifiedsSEO::getItemRoute($item->id.':'.$item->alias,$item->cat_id.':'.$cat->alias));
$m_message .=JText::_('COM_DJCLASSIFIEDS_ADVERT_LINK').': <a href="'.$link.'">'.$link.'</a><br /><br />';
*/
return null;
}
示例3:
*
* DJ Flyer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DJ Flyer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DJ Flyer. If not, see <http://www.gnu.org/licenses/>.
*
*/
$new_ad_link = DJClassifiedsSEO::getNewAdLink();
$par = JComponentHelper::getParams('com_djclassifieds');
$max_level = $params->get('max_level', '0');
?>
<div class="djcf_menu">
<?php
if ($params->get('new_ad_link', '0') == 1) {
echo '<div class="newad_link_top"><a class="button" href="' . $new_ad_link . '">' . JText::_('MOD_DJCLASSIFIEDS_MENU_NEW_ADD') . '</a></div>';
}
if ($cats) {
?>
<ul class="menu nav <?php
echo $params->get('moduleclass_sfx', '');
?>
">