Bladeren bron

Ticket #2103 - Fixes and improvements.

AntonLV 7 jaren geleden
bovenliggende
commit
a5da1546b0

+ 6 - 0
modules/boonex/ads/classes/BxAdsConfig.php

@@ -32,6 +32,7 @@ class BxAdsConfig extends BxBaseModTextConfig
             'TABLE_ENTRIES_FULLTEXT' => 'title_text',
             'TABLE_ENTRIES_FULLTEXT' => 'title_text',
             'TABLE_CATEGORIES' => $aModule['db_prefix'] . 'categories',
             'TABLE_CATEGORIES' => $aModule['db_prefix'] . 'categories',
             'TABLE_CATEGORIES_TYPES' => $aModule['db_prefix'] . 'categories_types',
             'TABLE_CATEGORIES_TYPES' => $aModule['db_prefix'] . 'categories_types',
+            'TABLE_INTERESTED_TRACK' => $aModule['db_prefix'] . 'interested_track',
 
 
             // database fields
             // database fields
             'FIELD_ID' => 'id',
             'FIELD_ID' => 'id',
@@ -44,6 +45,7 @@ class BxAdsConfig extends BxBaseModTextConfig
             'FIELD_CATEGORY' => 'category',
             'FIELD_CATEGORY' => 'category',
             'FIELD_CATEGORY_VIEW' => 'category_view',
             'FIELD_CATEGORY_VIEW' => 'category_view',
             'FIELD_CATEGORY_SELECT' => 'category_select',
             'FIELD_CATEGORY_SELECT' => 'category_select',
+            'FIELD_PRICE' => 'price',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
             'FIELD_COVER' => 'covers',
             'FIELD_COVER' => 'covers',
             'FIELD_PHOTO' => 'pictures',
             'FIELD_PHOTO' => 'pictures',
@@ -85,6 +87,7 @@ class BxAdsConfig extends BxBaseModTextConfig
             'PARAM_NUM_RSS' => 'bx_ads_rss_num',
             'PARAM_NUM_RSS' => 'bx_ads_rss_num',
             'PARAM_SEARCHABLE_FIELDS' => 'bx_ads_searchable_fields',
             'PARAM_SEARCHABLE_FIELDS' => 'bx_ads_searchable_fields',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_ads_per_page_browse_showcase',
             'PARAM_PER_PAGE_BROWSE_SHOWCASE' => 'bx_ads_per_page_browse_showcase',
+            'PARAM_LIFETIME' => 'bx_ads_lifetime',
             'PARAM_CATEGORY_LEVEL_MAX' => 1,
             'PARAM_CATEGORY_LEVEL_MAX' => 1,
 
 
             // objects
             // objects
@@ -162,6 +165,9 @@ class BxAdsConfig extends BxBaseModTextConfig
                 )
                 )
             ),
             ),
 
 
+            // email templates
+            'ETEMPLATE_INTERESTED' => 'bx_ads_interested',
+
             // some language keys
             // some language keys
             'T' => array (
             'T' => array (
                 'txt_sample_single' => '_bx_ads_txt_sample_single',
                 'txt_sample_single' => '_bx_ads_txt_sample_single',

+ 44 - 0
modules/boonex/ads/classes/BxAdsCronPruning.php

@@ -0,0 +1,44 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Ads Ads
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+class BxAdsCronPruning extends BxDolCron
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct()
+    {
+        $this->_sModule = 'bx_ads';
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct();
+    }
+
+    function processing()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $sStatus = 'hidden';
+        $aEntries = $this->_oModule->_oDb->getEntriesBy(array('type' => 'expired', 'days' => (int)getParam($CNF['PARAM_LIFETIME'])));
+        foreach($aEntries as $aEntry) {
+            if(!$this->_oModule->_oDb->updateEntriesBy(array($CNF['FIELD_STATUS'] => $sStatus), array($CNF['FIELD_ID'] => $aEntry[$CNF['FIELD_ID']])))
+                continue;
+
+            $aEntry[$CNF['FIELD_STATUS']] = $sStatus;
+
+            $this->_oModule->alertAfterEdit($aEntry);
+        }
+    }
+}
+
+/** @} */

+ 57 - 0
modules/boonex/ads/classes/BxAdsDb.php

@@ -19,6 +19,36 @@ class BxAdsDb extends BxBaseModTextDb
         parent::__construct($oConfig);
         parent::__construct($oConfig);
     }
     }
 
 
+    function getEntriesBy($aParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+    	$aMethod = array('name' => 'getAll', 'params' => array(0 => 'query', 1 => array()));
+        $sSelectClause = $sJoinClause = $sWhereClause = $sOrderClause = $sLimitClause = "";
+
+        $sSelectClause = "`" . $CNF['TABLE_ENTRIES'] . "`.*";
+
+        switch($aParams['type']) {
+            case 'expired':
+                $aMethod['params'][1]['days'] = 86400 * (int)$aParams['days'];
+
+                $sWhereClause .= " AND UNIX_TIMESTAMP() - `" . $CNF['TABLE_ENTRIES'] . "`.`" . $CNF['FIELD_CHANGED'] . "` > :days";
+                break;
+
+            default:
+                return parent::getEntriesBy($aParams);
+        }
+
+        if(!empty($sOrderClause))
+            $sOrderClause = 'ORDER BY ' . $sOrderClause;
+
+        if(!empty($sLimitClause))
+            $sLimitClause = 'LIMIT ' . $sLimitClause;
+
+        $aMethod['params'][0] = "SELECT " . $sSelectClause . " FROM `" . $CNF['TABLE_ENTRIES'] . "` " . $sJoinClause . " WHERE 1 " . $sWhereClause . " " . $sOrderClause . " " . $sLimitClause;
+            return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
+    }
+
     public function insertCategoryType($aParamsSet)
     public function insertCategoryType($aParamsSet)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
@@ -215,6 +245,33 @@ class BxAdsDb extends BxBaseModTextDb
 
 
         return true;
         return true;
     }
     }
+
+    public function isInterested($iEntryId, $iProfileId)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        return (int)$this->getOne("SELECT `id` FROM `" . $CNF['TABLE_INTERESTED_TRACK'] . "` WHERE `entry_id`=:entry_id AND `profile_id`=:profile_id LIMIT 1", array(
+            'entry_id' => $iEntryId,
+            'profile_id' => $iProfileId
+        )) > 0;
+    }
+
+    public function insertInterested($aParamsSet)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(empty($aParamsSet))
+            return 0;
+
+        $sSetClause = $this->arrayToSQL($aParamsSet);
+        if(!isset($aParamsSet['date']))
+            $sSetClause .= ", `date`=UNIX_TIMESTAMP()";
+
+        if((int)$this->query("INSERT INTO `" . $CNF['TABLE_INTERESTED_TRACK'] . "` SET " . $sSetClause) <= 0)
+            return 0;
+
+        return (int)$this->lastId();
+    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 15 - 17
modules/boonex/ads/classes/BxAdsFormEntry.php

@@ -14,6 +14,7 @@
  */
  */
 class BxAdsFormEntry extends BxBaseModTextFormEntry
 class BxAdsFormEntry extends BxBaseModTextFormEntry
 {
 {
+    protected $_iCategory;
     protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
     protected $_sGhostTemplateCover = 'form_ghost_template_cover.html';
 	
 	
     public function __construct($aInfo, $oTemplate = false)
     public function __construct($aInfo, $oTemplate = false)
@@ -22,12 +23,8 @@ class BxAdsFormEntry extends BxBaseModTextFormEntry
         parent::__construct($aInfo, $oTemplate);
         parent::__construct($aInfo, $oTemplate);
 
 
         $CNF = &$this->_oModule->_oConfig->CNF;
         $CNF = &$this->_oModule->_oConfig->CNF;
-        
-        $iCategory = 0;
-        if(bx_get('category') !== false)
-            $iCategory = (int)bx_get('category');
 
 
-        $this->_initCategoryFields($iCategory);
+        $this->_initCategoryFields();
 
 
     	if(isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
     	if(isset($CNF['FIELD_COVER']) && isset($this->aInputs[$CNF['FIELD_COVER']])) {
             if($this->_oModule->checkAllowedSetThumb() === CHECK_ACTION_RESULT_ALLOWED) {
             if($this->_oModule->checkAllowedSetThumb() === CHECK_ACTION_RESULT_ALLOWED) {
@@ -136,8 +133,8 @@ class BxAdsFormEntry extends BxBaseModTextFormEntry
     {
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
         $CNF = &$this->_oModule->_oConfig->CNF;
 
 
-        if(!empty($aInput['value'])) {
-            $aCategory = $this->_oModule->_oDb->getCategories(array('type' => 'id', 'id' => (int)$aInput['value']));
+        if(!empty($this->_iCategory)) {
+            $aCategory = $this->_oModule->_oDb->getCategories(array('type' => 'id', 'id' => $this->_iCategory));
             if(!empty($aCategory) && is_array($aCategory))
             if(!empty($aCategory) && is_array($aCategory))
                 $aInput['value'] = bx_process_output(_t($aCategory['title']));
                 $aInput['value'] = bx_process_output(_t($aCategory['title']));
         }
         }
@@ -184,21 +181,22 @@ class BxAdsFormEntry extends BxBaseModTextFormEntry
     	);
     	);
     }
     }
 
 
-    protected function _initCategoryFields($iCategory)
+    protected function _initCategoryFields($iCategory = 0)
     {
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
         $CNF = &$this->_oModule->_oConfig->CNF;
 
 
-        if(isset($CNF['FIELD_CATEGORY']) && isset($this->aInputs[$CNF['FIELD_CATEGORY']]) && $iCategory != 0) {
-            $this->aInputs[$CNF['FIELD_CATEGORY']]['value'] = $iCategory;
-        }
-        
-        if(isset($CNF['FIELD_CATEGORY_VIEW']) && isset($this->aInputs[$CNF['FIELD_CATEGORY_VIEW']]) && $iCategory != 0) {
-            $this->aInputs[$CNF['FIELD_CATEGORY_VIEW']]['value'] = $iCategory;
-        }
+        $this->_iCategory = (int)$iCategory;
+        if(empty($this->_iCategory) && bx_get('category') !== false)
+            $this->_iCategory = (int)bx_get('category');
+
+        if(isset($CNF['FIELD_CATEGORY']) && isset($this->aInputs[$CNF['FIELD_CATEGORY']]) && $this->_iCategory != 0)
+            $this->aInputs[$CNF['FIELD_CATEGORY']]['value'] = $this->_iCategory;
 
 
-        if(isset($CNF['FIELD_CATEGORY_SELECT']) && isset($this->aInputs[$CNF['FIELD_CATEGORY_SELECT']])) {
+        if(isset($CNF['FIELD_CATEGORY_VIEW']) && isset($this->aInputs[$CNF['FIELD_CATEGORY_VIEW']]) && $this->_iCategory != 0)
+            $this->aInputs[$CNF['FIELD_CATEGORY_VIEW']]['value'] = $this->_iCategory;
+
+        if(isset($CNF['FIELD_CATEGORY_SELECT']) && isset($this->aInputs[$CNF['FIELD_CATEGORY_SELECT']]))
             $this->aInputs[$CNF['FIELD_CATEGORY_SELECT']]['values'] = $this->_oModule->serviceGetCategoryOptions(0, true);
             $this->aInputs[$CNF['FIELD_CATEGORY_SELECT']]['values'] = $this->_oModule->serviceGetCategoryOptions(0, true);
-        }
     }
     }
 }
 }
 
 

+ 17 - 0
modules/boonex/ads/classes/BxAdsMenuSnippetMeta.php

@@ -40,6 +40,23 @@ class BxAdsMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
             'href' => $this->_sCategoryUrl . $iCategory
             'href' => $this->_sCategoryUrl . $iCategory
         ));
         ));
     }
     }
+
+    protected function _getMenuItemPrice($aItem)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(empty($CNF['FIELD_PRICE']))
+            return false;
+
+        if(!empty($this->_aContentInfo[$CNF['FIELD_PRICE']]))
+            $sPrice = _t_format_currency((float)$this->_aContentInfo[$CNF['FIELD_PRICE']]);
+        else
+            $sPrice = _t('_bx_ads_txt_free');
+
+        return $this->getUnitMetaItemText($sPrice, array(
+            'class' => 'price'
+        ));
+    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 7 - 0
modules/boonex/ads/classes/BxAdsMenuView.php

@@ -20,6 +20,13 @@ class BxAdsMenuView extends BxBaseModTextMenuView
 
 
         parent::__construct($aObject, $oTemplate);
         parent::__construct($aObject, $oTemplate);
     }
     }
+
+    public function setContentId($iContentId)
+    {
+        parent::setContentId($iContentId);
+
+        $this->addMarkers(array('js_object' => $this->_oModule->_oConfig->getJsObject('entry')));
+    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 5 - 0
modules/boonex/ads/classes/BxAdsMenuViewActions.php

@@ -21,6 +21,11 @@ class BxAdsMenuViewActions extends BxBaseModTextMenuViewActions
         parent::__construct($aObject, $oTemplate);
         parent::__construct($aObject, $oTemplate);
     }
     }
 
 
+    protected function _getMenuItemInterested($aItem)
+    {
+        return $this->_getMenuItemByNameActions($aItem);
+    }
+    
     protected function _getMenuItemEditAd($aItem)
     protected function _getMenuItemEditAd($aItem)
     {
     {
         return $this->_getMenuItemByNameActions($aItem);
         return $this->_getMenuItemByNameActions($aItem);

+ 86 - 7
modules/boonex/ads/classes/BxAdsModule.php

@@ -26,6 +26,44 @@ class BxAdsModule extends BxBaseModTextModule
         ));
         ));
     }
     }
 
 
+    public function actionInterested()
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if(empty($aContentInfo) || !is_array($aContentInfo))
+            return echoJson(array());
+
+        $iViewer = bx_get_logged_profile_id();        
+        $oViewer = BxDolProfile::getInstance($iViewer);
+        if(!$oViewer)
+            return echoJson(array());
+
+        $iContentAuthor = (int)$aContentInfo[$CNF['FIELD_AUTHOR']];
+        if($iContentAuthor == $iViewer)
+            return echoJson(array('msg' => _t('_bx_ads_txt_err_your_own')));
+
+        if($this->_oDb->isInterested($iContentId, $iViewer))
+            return echoJson(array('msg' => _t('_bx_ads_txt_err_duplicate')));
+
+        if(!$this->_oDb->insertInterested(array('entry_id' => $iContentId, 'profile_id' => $iViewer)))
+            return echoJson(array('msg' => _t('_bx_ads_txt_err_cannot_perform_action')));
+
+        sendMailTemplate($CNF['ETEMPLATE_INTERESTED'], 0, $iContentAuthor, array(
+            'viewer_name' => $oViewer->getDisplayName(),
+            'viewer_url' => $oViewer->getUrl(),
+            'ad_name' => $aContentInfo[$CNF['FIELD_TITLE']],
+            'ad_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'i' => $CNF['URI_VIEW_ENTRY'], 
+                $CNF['FIELD_ID'] => $iContentId
+            ))
+        ));
+
+        return echoJson(array('msg' => _t('_bx_ads_txt_msg_author_notified')));
+    }
+
     public function serviceUpdateCategoriesStats()
     public function serviceUpdateCategoriesStats()
     {
     {
         $aStats = $this->_oDb->getCategories(array('type' => 'collect_stats'));
         $aStats = $this->_oDb->getCategories(array('type' => 'collect_stats'));
@@ -122,16 +160,24 @@ class BxAdsModule extends BxBaseModTextModule
 
 
     public function serviceBrowseCategory($iCategoryId = 0, $aParams = array())
     public function serviceBrowseCategory($iCategoryId = 0, $aParams = array())
     {
     {
-        $sParamGet = 'category';
-
-        $bEmptyMessage = isset($aParams['empty_message']) ? (bool)$aParams['empty_message'] : true;
+        $sParamName = $sParamGet = 'category';
 
 
-        if(!$iCategoryId)
+        if(!$iCategoryId && bx_get($sParamGet) !== false)
             $iCategoryId = bx_process_input(bx_get($sParamGet), BX_DATA_INT);
             $iCategoryId = bx_process_input(bx_get($sParamGet), BX_DATA_INT);
-        if(!$iCategoryId)
-            return $bEmptyMessage ? MsgBox(_t('_Empty')) : '';
 
 
-        $aBlock = $this->_serviceBrowseWithParam('category', $sParamGet, $iCategoryId, $aParams);
+        $bEmptyMessage = true;
+        if(isset($aParams['empty_message'])) {
+            $bEmptyMessage = (bool)$aParams['empty_message'];
+            unset($aParams['empty_message']);
+        }
+
+        $bAjaxPaginate = true;
+        if(isset($aParams['ajax_paginate'])) {
+            $bAjaxPaginate = (bool)$aParams['ajax_paginate'];
+            unset($aParams['ajax_paginate']);
+        }
+
+        $aBlock = $this->_serviceBrowse ($sParamName, array_merge(array($sParamName => $iCategoryId), $aParams), BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
         if(!empty($aBlock['content'])) {
         if(!empty($aBlock['content'])) {
             $aCategory = $this->_oDb->getCategories(array('type' => 'id', 'id' => $iCategoryId));
             $aCategory = $this->_oDb->getCategories(array('type' => 'id', 'id' => $iCategoryId));
             if(!empty($aCategory['title']))
             if(!empty($aCategory['title']))
@@ -223,6 +269,39 @@ class BxAdsModule extends BxBaseModTextModule
             $aResult = array_merge($aResult, $oForm->aInputs);
             $aResult = array_merge($aResult, $oForm->aInputs);
         }
         }
 
 
+        return $aResult;
+    }
+    
+    protected function _getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams = array())
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $bDynamic = isset($aBrowseParams['dynamic_mode']) && (bool)$aBrowseParams['dynamic_mode'] === true;
+
+        $sCategory = '';
+        if(!empty($CNF['FIELD_CATEGORY']) && !empty($aContentInfo[$CNF['FIELD_CATEGORY']])) {
+            $iCategory = (int)$aContentInfo[$CNF['FIELD_CATEGORY']];
+            $aCategory = $this->_oDb->getCategories(array('type' => 'id', 'id' => $iCategory));
+            $sCategory = _t($aCategory['title']);
+            $sCategoryLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $iCategory));
+        }
+
+        $sPrice = _t('_bx_ads_txt_free');
+        if(!empty($CNF['FIELD_PRICE']) && !empty($aContentInfo[$CNF['FIELD_PRICE']]))
+            $sPrice = _t_format_currency((float)$aContentInfo[$CNF['FIELD_PRICE']]);
+
+        $sInclude = $this->_oTemplate->addCss(array('timeline.css'), $bDynamic);
+
+        $aResult = parent::_getContentForTimelinePost($aEvent, $aContentInfo, $aBrowseParams);
+        $aResult['text'] = $this->_oTemplate->parseHtmlByName('timeline_post_text.html', array(
+            'category_link' => $sCategoryLink,
+            'category_title' => $sCategory,
+            'category_title_attr' => bx_html_attribute($sCategory),
+            'price' => $sPrice,
+            'text' => $aResult['text']
+        )) . ($bDynamic ? $sInclude : '');
+
+        
         return $aResult;
         return $aResult;
     }
     }
 }
 }

+ 2 - 1
modules/boonex/ads/classes/BxAdsSearchResult.php

@@ -109,7 +109,8 @@ class BxAdsSearchResult extends BxBaseModTextSearchResult
 
 
             case 'category':
             case 'category':
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES']);
                 $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES']);
-                $this->aCurrent['restriction']['category']['value'] = $aParams['category'];
+                if(!empty($aParams['category']))
+                    $this->aCurrent['restriction']['category']['value'] = $aParams['category'];
                 $this->aCurrent['title'] = _t('_bx_ads_page_title_browse_category');
                 $this->aCurrent['title'] = _t('_bx_ads_page_title_browse_category');
                 $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
                 $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
                 $this->aCurrent['sorting'] = 'last';
                 $this->aCurrent['sorting'] = 'last';

+ 15 - 0
modules/boonex/ads/install/langs/en.xml

@@ -10,6 +10,7 @@
     <string name="_bx_ads_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
     <string name="_bx_ads_option_per_page_profile"><![CDATA[Number of items on profile/group page]]></string>
     <string name="_bx_ads_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
     <string name="_bx_ads_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
     <string name="_bx_ads_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
     <string name="_bx_ads_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string>
+    <string name="_bx_ads_option_lifetime"><![CDATA[Deactivate automatically after (in days)]]></string>
 
 
     <string name="_bx_ads_form_category"><![CDATA[Category]]></string>
     <string name="_bx_ads_form_category"><![CDATA[Category]]></string>
     <string name="_bx_ads_form_category_display_add"><![CDATA[Add Category]]></string>
     <string name="_bx_ads_form_category_display_add"><![CDATA[Add Category]]></string>
@@ -228,6 +229,8 @@
     <string name="_bx_ads_menu_set_title_submenu"><![CDATA[Ads Submenu]]></string>
     <string name="_bx_ads_menu_set_title_submenu"><![CDATA[Ads Submenu]]></string>
     <string name="_bx_ads_menu_item_title_system_create_entry"><![CDATA[Ad]]></string>
     <string name="_bx_ads_menu_item_title_system_create_entry"><![CDATA[Ad]]></string>
     <string name="_bx_ads_menu_item_title_create_entry"><![CDATA[Ad]]></string>
     <string name="_bx_ads_menu_item_title_create_entry"><![CDATA[Ad]]></string>
+    <string name="_bx_ads_menu_item_title_system_interested_entry"><![CDATA[Interested]]></string>
+    <string name="_bx_ads_menu_item_title_interested_entry"><![CDATA[I'm interested]]></string>
     <string name="_bx_ads_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
@@ -267,6 +270,8 @@
     <string name="_bx_ads_menu_item_title_categories"><![CDATA[Categories]]></string>
     <string name="_bx_ads_menu_item_title_categories"><![CDATA[Categories]]></string>
     <string name="_bx_ads_menu_item_title_system_entries_categories"><![CDATA[Categories]]></string>
     <string name="_bx_ads_menu_item_title_system_entries_categories"><![CDATA[Categories]]></string>
     <string name="_bx_ads_menu_item_title_entries_categories"><![CDATA[Categories]]></string>
     <string name="_bx_ads_menu_item_title_entries_categories"><![CDATA[Categories]]></string>
+    <string name="_bx_ads_menu_item_title_system_sm_price"><![CDATA[Price]]></string>
+    <string name="_bx_ads_menu_item_title_sm_price"><![CDATA[Price]]></string>
 
 
     <string name="_bx_ads_grid_column_title_icon"><![CDATA[Icon]]></string>
     <string name="_bx_ads_grid_column_title_icon"><![CDATA[Icon]]></string>
     <string name="_bx_ads_grid_column_title_title"><![CDATA[Title]]></string>
     <string name="_bx_ads_grid_column_title_title"><![CDATA[Title]]></string>
@@ -350,6 +355,12 @@
     <string name="_bx_ads_cat_title_auto_truck"><![CDATA[Sale autos / trucks]]></string>
     <string name="_bx_ads_cat_title_auto_truck"><![CDATA[Sale autos / trucks]]></string>
     <string name="_bx_ads_cat_title_motorcycle"><![CDATA[Sale motorcycles]]></string>
     <string name="_bx_ads_cat_title_motorcycle"><![CDATA[Sale motorcycles]]></string>
 
 
+    <string name="_bx_ads_et_txt_name_interested"><![CDATA[I'm interested.]]></string>
+    <string name="_bx_ads_et_txt_subject_interested"><![CDATA[{viewer_name} is interested in your ad.]]></string>
+    <string name="_bx_ads_et_txt_body_interested"><![CDATA[{email_header}
+<p>Hello, {profile_name}.</p>
+<p><b><a href="{viewer_url}">{viewer_name}</a></b> is interested in your ad <b><a href="{ad_url}">{ad_name}</a></b>.</p>
+{email_footer}]]></string>
 
 
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">All Ads in {1} ({2})</a>]]></string>
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">All Ads in {1} ({2})</a>]]></string>
     <string name="_bx_ads_txt_all_entries_by"><![CDATA[{0} ads]]></string>
     <string name="_bx_ads_txt_all_entries_by"><![CDATA[{0} ads]]></string>
@@ -365,7 +376,11 @@
     <string name="_bx_ads_txt_display_title_view"><![CDATA[{0}: View]]></string>
     <string name="_bx_ads_txt_display_title_view"><![CDATA[{0}: View]]></string>
     <string name="_bx_ads_txt_processing_awaiting"><![CDATA[Ad will be published as soon as video is converted]]></string>
     <string name="_bx_ads_txt_processing_awaiting"><![CDATA[Ad will be published as soon as video is converted]]></string>
     <string name="_bx_ads_txt_processing_failed"><![CDATA[Ad isn't published because video conversion failed, edit video to fix the issue.]]></string>
     <string name="_bx_ads_txt_processing_failed"><![CDATA[Ad isn't published because video conversion failed, edit video to fix the issue.]]></string>
+    <string name="_bx_ads_txt_free"><![CDATA[Free]]></string>
 
 
+    <string name="_bx_ads_txt_msg_author_notified"><![CDATA[Advertiser was notified, that you're interested in his ad. Please wait.]]></string>
+    <string name="_bx_ads_txt_err_your_own"><![CDATA[You cannot do the action because it's your own ad.]]></string>
+    <string name="_bx_ads_txt_err_duplicate"><![CDATA[You already performed the action.]]></string>
     <string name="_bx_ads_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
     <string name="_bx_ads_txt_err_cannot_perform_action"><![CDATA[Cannot perform action. Please report.]]></string>
 
 
     <string name="_bx_ads_txt_poll_view_answers"><![CDATA[poll]]></string>
     <string name="_bx_ads_txt_poll_view_answers"><![CDATA[poll]]></string>

+ 9 - 6
modules/boonex/ads/install/sql/disable.sql

@@ -29,15 +29,15 @@ DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_ads', 'bx_ads_cmts')
 DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_ads';
 DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_ads';
 
 
 -- STATS
 -- STATS
-DELETE FROM `sys_statistics` WHERE `name` LIKE 'bx_ads%';
+DELETE FROM `sys_statistics` WHERE `module` = 'bx_ads';
 
 
 -- CHARTS
 -- CHARTS
-DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_ads%';
+DELETE FROM `sys_objects_chart` WHERE `object` LIKE 'bx_ads_%';
 
 
 -- GRIDS
 -- GRIDS
-DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_ads%';
-DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_ads%';
-DELETE FROM `sys_grid_actions` WHERE `object` LIKE 'bx_ads%';
+DELETE FROM `sys_objects_grid` WHERE `object` LIKE 'bx_ads_%';
+DELETE FROM `sys_grid_fields` WHERE `object` LIKE 'bx_ads_%';
+DELETE FROM `sys_grid_actions` WHERE `object` LIKE 'bx_ads_%';
 
 
 -- UPLOADERS
 -- UPLOADERS
 DELETE FROM `sys_objects_uploader` WHERE `object` LIKE 'bx_ads_%';
 DELETE FROM `sys_objects_uploader` WHERE `object` LIKE 'bx_ads_%';
@@ -48,4 +48,7 @@ DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;
 
 
 -- CRON
 -- CRON
-DELETE FROM `sys_cron_jobs` WHERE `name` LIKE 'bx_ads%';
+DELETE FROM `sys_cron_jobs` WHERE `name` LIKE 'bx_ads_%';
+
+-- EMAIL TEMPLATES
+DELETE FROM `sys_email_templates` WHERE `Module` = 'bx_ads';

+ 18 - 8
modules/boonex/ads/install/sql/enable.sql

@@ -16,7 +16,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_ads_per_page_profile', '6', @iCategId, '_bx_ads_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_ads_per_page_profile', '6', @iCategId, '_bx_ads_option_per_page_profile', 'digit', '', '', '', 12),
 ('bx_ads_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
 ('bx_ads_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 15),
 ('bx_ads_rss_num', '10', @iCategId, '_bx_ads_option_rss_num', 'digit', '', '', '', 20),
 ('bx_ads_rss_num', '10', @iCategId, '_bx_ads_option_rss_num', 'digit', '', '', '', 20),
-('bx_ads_searchable_fields', 'title,text', @iCategId, '_bx_ads_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:6:"bx_ads";s:6:"method";s:21:"get_searchable_fields";}', 30);
+('bx_ads_searchable_fields', 'title,text', @iCategId, '_bx_ads_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:6:"bx_ads";s:6:"method";s:21:"get_searchable_fields";}', 30),
+('bx_ads_lifetime', '30', @iCategId, '_bx_ads_option_lifetime', 'digit', '', '', '', 40);
 
 
 
 
 -- PAGE: create entry
 -- PAGE: create entry
@@ -204,8 +205,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_ads_view', 'bx_ads', '_bx_ads_menu_set_title_view_entry', 0);
 ('bx_ads_view', 'bx_ads', '_bx_ads_menu_set_title_view_entry', 0);
 
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_ads_view', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '_bx_ads_menu_item_title_edit_entry', 'page.php?i=edit-ad&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 1),
-('bx_ads_view', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '_bx_ads_menu_item_title_delete_entry', 'page.php?i=delete-ad&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+('bx_ads_view', 'bx_ads', 'interested', '_bx_ads_menu_item_title_system_interested_entry', '_bx_ads_menu_item_title_interested_entry', 'javascript:void(0)', 'javascript:{js_object}.interested(this, {content_id})', '', 'map-marker', '', 2147483646, 1, 0, 10),
+('bx_ads_view', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '_bx_ads_menu_item_title_edit_entry', 'page.php?i=edit-ad&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 20),
+('bx_ads_view', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '_bx_ads_menu_item_title_delete_entry', 'page.php?i=delete-ad&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 30);
 
 
 -- MENU: all actions menu for view entry 
 -- MENU: all actions menu for view entry 
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
@@ -215,8 +217,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_ads_view_actions', 'bx_ads', '_sys_menu_set_title_view_actions', 0);
 ('bx_ads_view_actions', 'bx_ads', '_sys_menu_set_title_view_actions', 0);
 
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `submenu_popup`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_ads_view_actions', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 10),
-('bx_ads_view_actions', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
+('bx_ads_view_actions', 'bx_ads', 'interested', '_bx_ads_menu_item_title_system_interested_entry', '', '', '', '', '', '', '', 0, 2147483646, 1, 0, 10),
+('bx_ads_view_actions', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
+('bx_ads_view_actions', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 30),
 ('bx_ads_view_actions', 'bx_ads', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_ads_view_actions', 'bx_ads', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_ads_view_actions', 'bx_ads', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
 ('bx_ads_view_actions', 'bx_ads', 'view', '_sys_menu_item_title_system_va_view', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 210),
 ('bx_ads_view_actions', 'bx_ads', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 220),
 ('bx_ads_view_actions', 'bx_ads', 'vote', '_sys_menu_item_title_system_va_vote', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 220),
@@ -278,9 +281,10 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_ads_snippet_meta', 'bx_ads', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
 ('bx_ads_snippet_meta', 'bx_ads', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
 ('bx_ads_snippet_meta', 'bx_ads', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
 ('bx_ads_snippet_meta', 'bx_ads', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
 ('bx_ads_snippet_meta', 'bx_ads', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 1, 0, 1, 3),
 ('bx_ads_snippet_meta', 'bx_ads', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 1, 0, 1, 3),
-('bx_ads_snippet_meta', 'bx_ads', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 4),
-('bx_ads_snippet_meta', 'bx_ads', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
-('bx_ads_snippet_meta', 'bx_ads', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 6);
+('bx_ads_snippet_meta', 'bx_ads', 'price', '_bx_ads_menu_item_title_system_sm_price', '_bx_ads_menu_item_title_sm_price', '', '', '', '', '', 2147483647, 1, 0, 1, 4),
+('bx_ads_snippet_meta', 'bx_ads', 'tags', '_sys_menu_item_title_system_sm_tags', '_sys_menu_item_title_sm_tags', '', '', '', '', '', 2147483647, 0, 0, 1, 5),
+('bx_ads_snippet_meta', 'bx_ads', 'views', '_sys_menu_item_title_system_sm_views', '_sys_menu_item_title_sm_views', '', '', '', '', '', 2147483647, 0, 0, 1, 6),
+('bx_ads_snippet_meta', 'bx_ads', 'comments', '_sys_menu_item_title_system_sm_comments', '_sys_menu_item_title_sm_comments', '', '', '', '', '', 2147483647, 0, 0, 1, 7);
 
 
 -- MENU: profile stats
 -- MENU: profile stats
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
@@ -480,4 +484,10 @@ INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
 
 
 -- CRON
 -- CRON
 INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
 INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
+('bx_ads_pruning', '0 0 * * *', 'BxAdsCronPruning', 'modules/boonex/ads/classes/BxAdsCronPruning.php', ''),
 ('bx_ads_publishing', '* * * * *', 'BxAdsCronPublishing', 'modules/boonex/ads/classes/BxAdsCronPublishing.php', '');
 ('bx_ads_publishing', '* * * * *', 'BxAdsCronPublishing', 'modules/boonex/ads/classes/BxAdsCronPublishing.php', '');
+
+
+-- EMAIL TEMPLATES
+INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES 
+('bx_ads', '_bx_ads_et_txt_name_interested', 'bx_ads_interested', '_bx_ads_et_txt_subject_interested', '_bx_ads_et_txt_body_interested');

+ 9 - 0
modules/boonex/ads/install/sql/install.sql

@@ -143,6 +143,15 @@ INSERT INTO `bx_ads_categories` (`parent_id`, `level`, `type`, `name`, `title`,
 (@iParentId, 1, 2, 'sale_car_auto', '_bx_ads_cat_title_auto_truck', '', '', 1, 2),
 (@iParentId, 1, 2, 'sale_car_auto', '_bx_ads_cat_title_auto_truck', '', '', 1, 2),
 (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_ads_cat_title_motorcycle', '', '', 1, 3);
 (@iParentId, 1, 2, 'sale_car_motorcycle', '_bx_ads_cat_title_motorcycle', '', '', 1, 3);
 
 
+CREATE TABLE IF NOT EXISTS `bx_ads_interested_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `entry_id` int(11) NOT NULL default '0',
+  `profile_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `interested` (`entry_id`, `profile_id`)
+);
+
 -- TABLE: storages & transcoders
 -- TABLE: storages & transcoders
 CREATE TABLE IF NOT EXISTS `bx_ads_covers` (
 CREATE TABLE IF NOT EXISTS `bx_ads_covers` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id` int(11) NOT NULL AUTO_INCREMENT,

+ 1 - 1
modules/boonex/ads/install/sql/uninstall.sql

@@ -1,6 +1,6 @@
 
 
 -- TABLES
 -- TABLES
-DROP TABLE IF EXISTS `bx_ads_entries`, `bx_ads_categories_types`, `bx_ads_categories`, `bx_ads_covers`, `bx_ads_files`, `bx_ads_photos`, `bx_ads_photos_resized`, `bx_ads_videos`, `bx_ads_videos_resized`, `bx_ads_cmts`, `bx_ads_reviews`, `bx_ads_votes`, `bx_ads_votes_track`, `bx_ads_reactions`, `bx_ads_reactions_track`, `bx_ads_views_track`, `bx_ads_meta_keywords`, `bx_ads_meta_locations`, `bx_ads_meta_mentions`, `bx_ads_reports`, `bx_ads_reports_track`, `bx_ads_favorites_track`, `bx_ads_scores`, `bx_ads_scores_track`, `bx_ads_polls`, `bx_ads_polls_answers`, `bx_ads_polls_answers_votes`, `bx_ads_polls_answers_votes_track`;
+DROP TABLE IF EXISTS `bx_ads_entries`, `bx_ads_categories_types`, `bx_ads_categories`, `bx_ads_interested_track`, `bx_ads_covers`, `bx_ads_files`, `bx_ads_photos`, `bx_ads_photos_resized`, `bx_ads_videos`, `bx_ads_videos_resized`, `bx_ads_cmts`, `bx_ads_reviews`, `bx_ads_votes`, `bx_ads_votes_track`, `bx_ads_reactions`, `bx_ads_reactions_track`, `bx_ads_views_track`, `bx_ads_meta_keywords`, `bx_ads_meta_locations`, `bx_ads_meta_mentions`, `bx_ads_reports`, `bx_ads_reports_track`, `bx_ads_favorites_track`, `bx_ads_scores`, `bx_ads_scores_track`, `bx_ads_polls`, `bx_ads_polls_answers`, `bx_ads_polls_answers_votes`, `bx_ads_polls_answers_votes_track`;
 
 
 -- STORAGES & TRANSCODERS
 -- STORAGES & TRANSCODERS
 DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_ads_%';
 DELETE FROM `sys_objects_storage` WHERE `object` LIKE 'bx_ads_%';

+ 21 - 0
modules/boonex/ads/js/entry.js

@@ -17,6 +17,27 @@ function BxAdsEntry(oOptions) {
     this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
     this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
 }
 }
 
 
+BxAdsEntry.prototype.interested = function(oElement, iContentId) {
+    var $this = this;
+
+    if(oElement)
+        this.loadingInButton(oElement, true);
+
+    jQuery.get (
+        this._sActionsUrl + 'interested',
+        {
+            id: iContentId
+        },
+        function(oData) {
+            if(oElement)
+                $this.loadingInButton(oElement, false);
+
+            processJsonData(oData);
+        },
+        'json'
+    );
+};
+
 BxAdsEntry.prototype.onChangeCategory = function(oElement) {
 BxAdsEntry.prototype.onChangeCategory = function(oElement) {
     this.loadingInBlock(oElement, true);
     this.loadingInBlock(oElement, true);
 
 

+ 5 - 0
modules/boonex/ads/template/css/main.css

@@ -7,4 +7,9 @@
 .bx-ads-category .sys-icon {
 .bx-ads-category .sys-icon {
     display: inline-block;
     display: inline-block;
     width: 1.0rem;
     width: 1.0rem;
+}
+
+/*--- Snippet ---*/
+div.bx-base-general-unit-meta .bx-menu-item-price span.price {
+    color: #307424;
 }
 }

+ 14 - 0
modules/boonex/ads/template/css/timeline.css

@@ -0,0 +1,14 @@
+div.bx-ads-c-line {  
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: center;
+    align-items: center;
+    -webkit-justify-content: space-between;
+    justify-content: space-between;
+}
+
+.bx-ads-cl-item.price {
+    font-weight: bold;
+    color: #307424;
+}

+ 7 - 0
modules/boonex/ads/template/timeline_post_text.html

@@ -0,0 +1,7 @@
+<div class="bx-ads-content">
+    <div class="bx-ads-c-line bx-def-padding-sec-bottom">
+        <div class="bx-ads-cl-item category"><a href="__category_link__" title="__category_title_attr__">__category_title__</a></div>
+        <div class="bx-ads-cl-item price">__price__</div>
+    </div>
+    __text__
+</div>