本文整理汇总了PHP中DJClassifiedsSEO::getUserAdsLink方法的典型用法代码示例。如果您正苦于以下问题:PHP DJClassifiedsSEO::getUserAdsLink方法的具体用法?PHP DJClassifiedsSEO::getUserAdsLink怎么用?PHP DJClassifiedsSEO::getUserAdsLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DJClassifiedsSEO
的用法示例。
在下文中一共展示了DJClassifiedsSEO::getUserAdsLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: display
function display($tpl = NULL)
{
global $mainframe;
$par = JComponentHelper::getParams('com_djclassifieds');
$session = JFactory::getSession();
$val = $session->get('captcha_sta', '0');
$user = JFactory::getUser();
$app = JFactory::getApplication();
$token = JRequest::getCMD('token', '');
//echo $val;
if ($par->get('user_type') == 1 && $user->id == '0') {
$uri = JFactory::getURI();
$app->redirect('index.php?option=com_users&view=login&return=' . base64_encode($uri), JText::_('COM_DJCLASSIFIEDS_PLEASE_LOGIN'));
} else {
if ($val == 0 && $par->get('captcha') == 1 && JRequest::getVar('id', 0, '', 'int') == 0) {
parent::display('captcha');
} else {
$model = $this->getModel();
if ($user->id > 0 && $par->get('adverts_limit', '0') > 0 && JRequest::getInt('id', 0) == 0 && !$token) {
$user_items_c = $model->getUserItemsCount();
if ($user_items_c >= $par->get('adverts_limit', '0')) {
$app->redirect(JRoute::_(DJClassifiedsSEO::getUserAdsLink()), JText::_('COM_DJCLASSIFIEDS_REACHED_LIMIT_OF_ADVERTS'), 'error');
}
}
$item = $model->getItem();
$images = $model->getItemImages($item->id);
$cats = $model->getCategories();
$cat_path = '';
if ($item->cat_id != 0) {
$id = array();
$name = array();
$cid = $item->cat_id;
if ($cid != 0) {
while ($cid != 0) {
foreach ($cats as $li) {
if ($li->id == $cid) {
$cid = $li->parent_id;
$id[] = $li->id;
$name[] = $li->name;
$cat_path = 'new_cat(' . $li->parent_id . ',' . $li->id . ');' . $cat_path;
break;
}
}
}
}
}
$regions = $model->getRegions();
$r_name = '';
$reg_path = '';
if ($item->region_id != 0) {
$id = array();
$name = array();
$rid = $item->region_id;
if ($rid != 0) {
while ($rid != 0) {
foreach ($regions as $li) {
if ($li->id == $rid) {
$rid = $li->parent_id;
$id[] = $li->id;
$name[] = $li->name;
if (!$reg_path) {
$r_name = $li->name;
}
$reg_path = 'new_reg(' . $li->parent_id . ',' . $li->id . ');' . $reg_path;
break;
}
}
if ($rid == $item->region_id) {
break;
}
}
}
}
$terms_link = '';
if ($par->get('terms', 1) > 0 && $par->get('terms_article_id', 0) > 0 && JRequest::getVar('id', 0, '', 'int') == 0) {
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
$terms_article = $model->getTermsLink($par->get('terms_article_id', 0));
if ($terms_article) {
$slug = $terms_article->id . ':' . $terms_article->alias;
$cslug = $terms_article->catid . ':' . $terms_article->c_alias;
$article_link = ContentHelperRoute::getArticleRoute($slug, $cslug);
if ($par->get('terms', 0) == 2) {
$article_link .= '&tmpl=component';
}
$terms_link = JRoute::_($article_link);
}
}
$days = '';
if ($par->get('durations_list', 1) > 0) {
$days = $model->getDays();
}
if ($par->get('promotion') == '1') {
$promotions = $model->getPromotions();
$this->assignRef('promotions', $promotions);
}
$custom_contact_fields = $model->getCustomContactFields();
$this->assignRef('item', $item);
$this->assignRef('images', $images);
$this->assignRef('cats', $cats);
$this->assignRef('cat_path', $cat_path);
//.........这里部分代码省略.........