8 require_once(CH_DIRECTORY_PATH_INC .
'header.inc.php');
9 require_once(CH_DIRECTORY_PATH_INC .
'design.inc.php');
10 require_once(CH_DIRECTORY_PATH_INC .
'profiles.inc.php');
11 require_once(CH_DIRECTORY_PATH_INC .
'utils.inc.php');
165 $this->sHomeUrl = $this->_oConfig->getHomeUrl();
166 $this->sHomePath = $this->_oConfig->getHomePath();
168 $this->sUploadDir =
'media/images/classifieds/';
170 $this->bUseFriendlyLinks =
getParam(
'permalinks_module_ads') ==
'on' ?
true :
false;
173 $this->sPicNotAvail = $this->_oTemplate->getImageUrl(
'no-image-thumb.png');
174 $this->sPicNotAvailPath = $this->_oTemplate->getImagePath(
'no-image-thumb.png');
178 $this->bAdminMode = ($this->
isAdmin() ==
true) ?
true :
false;
179 $this->_oConfig->bAdminMode = ($this->
isAdmin() ==
true) ?
true :
false;
187 $this->aPageTmpl[
'name_index'] = 71;
194 $iOwnerId = (int)$sOwnerId;
195 $aAdd = array($sAddParam, $sAddParam1, $sAddParam2);
197 ch_import(
'SearchUnit', $this->_aModule);
199 $oTmpAdsSearch->bShowCheckboxes =
false;
200 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
201 $oTmpAdsSearch->aCurrent[
'restriction'][
'owner'][
'value'] = $iOwnerId;
204 $oTmpAdsSearch->bShowCheckboxes =
true;
205 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'active';
206 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'manage';
209 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'new';
210 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'outtime';
213 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'active';
214 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'expired';
217 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'inactive';
218 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'outtime';
222 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'manage';
224 $sCode = $oTmpAdsSearch->displayResultBlock();
226 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
230 $sBoxId =
'ads_' . $iOwnerId .
'_' .
$sMode;
231 $sLink = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'get_list/' .
$sMode .
'/' . $iOwnerId;
233 'page_url' =>
'javascript:void();',
234 'count' => $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'],
235 'per_page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'],
236 'page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'page'],
237 'on_change_page' =>
'getHtmlData(\'' . $sBoxId .
'\', \
'' . $sLink .
'&page={page}&per_page={per_page}\');',
238 'on_change_per_page' =>
'getHtmlData(\'' . $sBoxId .
'\', \
'' . $sLink .
'&page=1&per_page=\' + this.value);'
240 $sPgn =
'<div class="clear_both"></div>' . $oPgn->getPaginate();
242 header(
'Content-Type: text/xml; charset=UTF-8');
258 $sCategory = (int)
ch_get(
'FilterCat');
259 $sSubCategory = (int)
ch_get(
'FilterSubCat');
265 if ($sSubCategory <= 0) {
266 if ($sCategory > 0) {
268 $vSubCats = $this->_oDb->getAllSubCatsInfo($sCategory);
269 while ($aSubCat = $vSubCats->fetch()) {
270 $aSubCats[] = (int)$aSubCat[
'ID'];
273 if (count($aSubCats) > 0) {
274 $sSubCats =
"`{$this->_oConfig->sSQLSubcatTable}`.`ID` IN (" . implode(
",", $aSubCats) .
")";
284 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
286 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
287 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
289 if ($sCategory > 0) {
290 $oTmpAdsSearch->aCurrent[
'restriction'][
'categoryID'][
'value'] = $sCategory;
293 if (count($aSubCats) > 0) {
294 $oTmpAdsSearch->aCurrent[
'third_restr'] =
"`{$this->_oConfig->sSQLSubcatTable}`.`ID` IN (" . implode(
",",
297 if ($sSubCategory > 0) {
298 $oTmpAdsSearch->aCurrent[
'restriction'][
'subcategoryID'][
'value'] = $sSubCategory;
303 $oTmpAdsSearch->aCurrent[
'restriction'][
'country'][
'value'] =
$sCountry;
306 if ($sKeywords !=
'') {
307 $oTmpAdsSearch->aCurrent[
'restriction'][
'message_filter'][
'value'] = $sKeywords;
310 $oTmpAdsSearch->aCurrent[
'restriction'][
'categoryID'][
'value'] = $iSafeCatID;
311 $sFilteredAds = $oTmpAdsSearch->displayResultBlock();
312 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
313 $sFilteredAds =
MsgBox(
_t(
'_Empty'));
317 foreach (
$_GET as $sKey => $sValue) {
318 $sRequest .=
'&' . $sKey .
'=' . $sValue;
320 $sRequest .=
'&page={page}&per_page={per_page}';
322 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
323 $sPagination = $oTmpAdsSearch->showPagination();
330 <script language=
"JavaScript" type=
"text/javascript">
332 var sAdsSiteUrl =
"{$this->sHomeUrl}";
339 $this->aPageTmpl[
'header'] =
_t(
'_ch_ads_Filter');
340 $this->aPageTmpl[
'css_name'] = array(
'ads.css',
'twig.css');
341 $this->aPageTmpl[
'js_name'] = array(
'main.js');
342 $this->_oTemplate->pageCode($this->aPageTmpl, array(
'page_main_code' => $sJS .
$sCode));
347 header(
'Content-type:text/html;charset=utf-8');
349 $iEntryId = (int)$iEntryId;
350 if (!($aDataEntry = $this->_oDb->getAdInfo($iEntryId))) {
355 $sEntryUrl = $this->
genUrl($iEntryId, $aDataEntry[
'EntryUri'],
'entry');
357 require_once(CH_DIRECTORY_PATH_INC .
"shared_sites.inc.php");
371 $this->_oTemplate->addJs(
'main.js');
374 <script language=
"JavaScript" type=
"text/javascript">
376 var sAdsSiteUrl =
"{$this->sHomeUrl}";
379 <
form action=
"{$sAdsLink}" method=
"post" name=
"command_activate_advertisement">
380 <input
type=
"hidden" name=
"ActivateAdvertisementID" id=
"ActivateAdvertisementID" value=
"" />
383 <
form action=
"{$sAdsLink}" method=
"post" name=
"command_delete_advertisement">
384 <input
type=
"hidden" name=
"DeleteAdvertisementID" id=
"DeleteAdvertisementID" value=
"" />
396 $sMsgMain = $sMsgAdd =
'';
397 switch (
ch_get(
'action')) {
398 case 'show_featured':
399 $sMsgMain =
'_ch_ads_Featured';
401 case 'show_top_rated':
402 $sMsgMain =
'_ch_ads_Top_Rated';
405 $sMsgMain =
'_ch_ads_All_ads';
408 $sMsgMain =
'_ch_ads_Popular';
413 case 'show_categories':
414 $sMsgMain =
'_ch_ads_Categories';
416 case 'show_calendar':
417 $sMsgMain =
'_ch_ads_Calendar';
419 case 'show_calendar_ads':
421 $aDate = explode(
'/', $sDate);
423 $iValue1 = (int)
$aDate[0];
424 $iValue2 = (int)
$aDate[1];
425 $iValue3 = (int)
$aDate[2];
427 $sMsgMain =
'_ch_ads_caption_browse_by_day';
433 $sMsgMain =
'_ch_ads_Add';
436 $sMsgMain =
'_ch_ads_Manage_ads';
439 $sMsgMain =
'_ch_ads_pending_approval';
442 $sMsgMain =
'_ch_ads_expired';
445 $sMsgMain =
'_ch_ads_Disapproved';
448 $sMsgMain =
'_ch_ads_My_Ads';
452 $sMsgMain =
'_ch_ads_Filtered_ads';
455 if (
false !==
ch_get(
'ShowAdvertisementID')) {
456 $sMsgAdd = $this->_oDb->getAdSubjectByID((
int)
ch_get(
'ShowAdvertisementID'));
457 } elseif (
false !==
ch_get(
'entryUri')) {
459 } elseif (
false !==
ch_get(
'UsersOtherListing') && (
int)
ch_get(
'IDProfile') > 0) {
460 $sMsgMain =
'_ch_ads_Users_other_listing';
461 } elseif (
false !==
ch_get(
'bClassifiedID') ||
false !==
ch_get(
'catUri')) {
462 if (
false !==
ch_get(
'bClassifiedID') && (
int)
ch_get(
'bClassifiedID') > 0) {
463 $sMsgAdd = $this->_oDb->getCategoryNameByID((
int)
ch_get(
'bClassifiedID'));
464 } elseif (
false !==
ch_get(
'catUri') &&
ch_get(
'catUri') !=
'') {
467 } elseif (
false !==
ch_get(
'bSubClassifiedID') ||
false !==
ch_get(
'scatUri')) {
469 if (
false !==
ch_get(
'bSubClassifiedID') && (
int)
ch_get(
'bSubClassifiedID') > 0) {
470 $aSubcatRes = $this->_oDb->getCatSubCatNameBySubCatID((
int)
ch_get(
'bSubClassifiedID'));
471 } elseif (
false !==
ch_get(
'scatUri') &&
ch_get(
'scatUri') !=
'') {
477 $sMsgAdd = $aSubcatRes[
'Name'] .
' / ' . $aSubcatRes[
'NameSub'];
480 $sMsgMain =
'_ch_ads_Ads_Home';
483 if (!
empty($sMsgMain)) {
484 $sMsgMain =
_t($sMsgMain) .
' ';
487 return trim($sMsgMain . $sMsgAdd);
494 if (($aAdPost[
'IDProfile'] == $this->_iVisitorID &&
isMember()) || $this->
isAdmin()) {
498 return $this->oPrivacy->check(
'comment', $aAdPost[
'ID'], $this->_iVisitorID);
503 if ($this->
isAdmin() || $iOwnerID == $this->_iVisitorID) {
507 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_VIEW, $isPerformAction);
518 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_BROWSE, $isPerformAction);
529 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_SEARCH, $isPerformAction);
543 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_ADD, $isPerformAction);
550 if ($this->
isAdmin() || (
isMember() && $iOwnerID == $this->_iVisitorID)) {
554 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_EDIT_ANY_AD, $isPerformAction);
561 if ($this->
isAdmin() || (
isMember() && $iOwnerID == $this->_iVisitorID)) {
565 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_DELETE_ANY_AD, $isPerformAction);
579 $aCheck =
checkAction($this->_iVisitorID, CH_ADS_APPROVING, $isPerformAction);
620 $iId = $this->_oDb->getSettingsCategory();
622 return MsgBox(
_t(
'_sys_request_page_not_found_cpt'));
628 if (isset($_POST[
'save']) && isset($_POST[
'cat'])) {
630 $mixedResult =
$oSettings->saveChanges($_POST);
636 if ($mixedResult !==
true && !
empty($mixedResult)) {
645 $sCatID = (int)
ch_get(
'id');
646 $iCatID = ($sCatID) ? $sCatID : 0;
664 $sAdministrationC =
_t(
'_ch_ads_Administration');
665 $sMyAdsC =
_t(
'_ch_ads_My_Ads');
666 $sPendApprC =
_t(
'_ch_ads_pending_approval');
667 $sDisApprC =
_t(
'_ch_ads_Disapproved');
668 $sAddC =
_t(
'_ch_ads_Add');
670 if (
ch_get(
'action_delete') && is_array(
ch_get(
'ads'))) {
676 ch_import(
'SearchUnit', $this->_aModule);
678 $oTmpAdsSearch->bShowCheckboxes =
false;
679 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
681 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'manage';
683 $GLOBALS[
'oTopMenu']->setCurrentProfileID($this->_iVisitorID);
684 $sMyAds = $oTmpAdsSearch->displayResultBlock();
685 if ($this->bUseFriendlyLinks) {
686 $sAdsMainLink = $sAdsAddLink = $sAdsManageLink = $sAdsPendingLink = $sAdsDisapprovedLink = $sAdsExpiredLink = CH_WSB_URL_ROOT;
687 $sAdsMainLink .=
'ads/my_page/';
688 $sAdsAddLink .=
'ads/my_page/add/';
689 $sAdsManageLink .=
'ads/my_page/manage/';
690 $sAdsPendingLink .=
'ads/my_page/pending/';
691 $sAdsExpiredLink .=
'ads/my_page/expired/';
692 $sAdsDisapprovedLink .=
'ads/my_page/disapproved/';
695 $sAdsMainLink =
"{$this->sCurrBrowsedFile}?action=my_page";
696 $sAdsAddLink =
"{$this->sCurrBrowsedFile}?action=my_page&mode=add";
697 $sAdsManageLink =
"{$this->sCurrBrowsedFile}?action=my_page&mode=manage";
698 $sAdsPendingLink =
"{$this->sCurrBrowsedFile}?action=my_page&mode=pending";
699 $sAdsExpiredLink =
"{$this->sCurrBrowsedFile}?action=my_page&mode=expired";
700 $sAdsDisapprovedLink =
"{$this->sCurrBrowsedFile}?action=my_page&mode=disapproved";
706 $sAjLink = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'get_list/';
707 $sAddPages =
'&page={page}&per_page={per_page}';
709 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
712 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] < $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum']) {
713 $sBoxId =
'ads_' . $this->_iVisitorID .
'_view';
715 'page_url' => $sAdsMainLink . $sAddPages,
716 'count' => $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'],
717 'per_page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'],
718 'page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'page'],
719 'on_change_page' =>
"getHtmlData('$sBoxId', '{$sAjLink}view/{$this->_iVisitorID}{$sAddPages}');",
720 'on_change_per_page' =>
"getHtmlData('$sBoxId', '{$sAjLink}view/{$this->_iVisitorID}&page=1&per_page=' + this.value);"
722 $sPgn =
'<div class="clear_both"></div>' . $oPgn->getPaginate();
725 $sMyAdsBox =
DesignBoxContent($sMyAdsC,
'<div id="' . $sBoxId .
'">' . $sMyAds . $sPgn .
'</div>', 1);
729 $sMainTabClass = $sAddTabClass = $sManageTabClass = $sPendingTabClass = $sDisapprovedTabClass = $sExpiredTabClass = 0;
730 $sMode = ($sForceMode !=
'') ? $sForceMode :
ch_get(
'mode');
733 $sBoxIdSpec =
'ads_' . $this->_iVisitorID .
'_' .
$sMode;
735 'on_change_page' =>
"getHtmlData('$sBoxIdSpec', '{$sAjLink}{$sMode}/{$this->_iVisitorID}{$sAddPages}');",
736 'on_change_per_page' =>
"getHtmlData('$sBoxIdSpec', '{$sAjLink}{$sMode}/{$this->_iVisitorID}&page=1&per_page=' + this.value);"
738 $sPgn =
'<div class="clear_both"></div>';
739 $aButtons = array(
'action_delete' =>
'_Delete');
740 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'';
746 $sAdmContent = $sNewPostForm;
750 $sExpiredTabClass = 1;
751 $oTmpAdsSearch->bShowCheckboxes =
true;
752 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'active';
753 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'expired';
755 $sBoxIdSpec, $aButtons, $sAdsExpiredLink . $sPgnAdd . $sAddPages, $aPgn);
759 $sManageTabClass = 1;
760 $oTmpAdsSearch->bShowCheckboxes =
true;
761 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'active';
762 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'manage';
764 $sBoxIdSpec, $aButtons, $sAdsManageLink . $sPgnAdd . $sAddPages, $aPgn);
768 $sPendingTabClass = 1;
769 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'new';
770 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'outtime';
772 $sBoxIdSpec, $aButtons, $sAdsPendingLink . $sPgnAdd . $sAddPages, $aPgn);
776 $sDisapprovedTabClass = 1;
777 $oTmpAdsSearch->aCurrent[
'restriction'][
'activeStatus'][
'value'] =
'inactive';
778 $oTmpAdsSearch->aCurrent[
'second_restr'] =
'outtime';
780 $aButtons, $sBoxIdSpec, $sAdsDisapprovedLink . $sPgnAdd . $sAddPages, $aPgn);
787 $iMyAdsCnt = $this->_oDb->getMemberAdsCnt($this->_iVisitorID,
'active',
true);
788 $sAdministrationDescC =
_t(
'_ch_ads_admin_box_desc', $iMyAdsCnt, $sAdsManageLink, $sAdsAddLink);
789 $sAdmContent = $sAdministrationDescC;
797 'href' => $sAdsMainLink,
798 'title' =>
_t(
'_ch_ads_Manage_main'),
799 'active' => $sMainTabClass
801 'ads_add' => array(
'href' => $sAdsAddLink,
'title' =>
_t(
'_ch_ads_Add'),
'active' => $sAddTabClass),
802 'ads_manage' => array(
803 'href' => $sAdsManageLink,
804 'title' =>
_t(
'_ch_ads_Manage_ads'),
805 'active' => $sManageTabClass
807 'ads_pending' => array(
808 'href' => $sAdsPendingLink,
809 'title' =>
_t(
'_ch_ads_pending_approval'),
810 'active' => $sPendingTabClass
812 'ads_expired' => array(
813 'href' => $sAdsExpiredLink,
814 'title' =>
_t(
'_ch_ads_expired'),
815 'active' => $sExpiredTabClass
817 'ads_disapproved' => array(
818 'href' => $sAdsDisapprovedLink,
819 'title' =>
_t(
'_ch_ads_Disapproved'),
820 'active' => $sDisapprovedTabClass
824 $sAdministrationUnitsSect =
DesignBoxContent($sAdministrationC, $sAdmContent, 1, $sAdmPost);
826 return $sAdministrationUnitsSect . $sMyAdsBox;
843 return $this->_oTemplate->displayAccessDenied();
846 $aAdUnitInfo = $this->_oDb->getAdInfo($iPostID);
848 $iOwnerID = (int)$aAdUnitInfo[
'OwnerID'];
850 return $this->_oTemplate->displayAccessDenied();
854 $sMsgDeleteImage =
'';
855 $sNewAdC =
_t(
'_Add Post');
856 $sDaysC =
_t(
'_days');
857 $iMaxLt = (int)
getParam(
'ch_ads_max_live_days');
858 $sMaxedString =
_t(
'_ch_ads_Warn_max_live_days');
860 $sAdsAddLink = (
$this->bUseFriendlyLinks) ?
'ads/my_page/add/' :
"{$this->sCurrBrowsedFile}?action=my_page&mode=add";
863 $aLifeTimeValues = array();
864 for ($i = 5; $i <= $iMaxLt; $i += 5) {
865 $aLifeTimeValues[] = array(
'key' => $i,
'value' => $i);
869 $iCategoryID = (int)
ch_get(
'Classified');
870 $iSubCategoryID = (int)
ch_get(
'IDClassifiedsSubs');
871 $sCustomValues = $sScriptHandle =
'';
872 if (
false !==
ch_get(
'IDClassifiedsSubs')) {
873 $sScriptHandle = <<<EOF
874 <script
type=
"text/javascript">
875 addEvent( window,
'load',
function(){ $(
'#Classified').val(
'{$iCategoryID}'); } );
881 $aAllowView = $this->oPrivacy->getGroupChooser($this->_iVisitorID,
'ads',
'view', array(),
882 _t(
'_ch_ads_privacy_view'));
883 $aAllowRate = $this->oPrivacy->getGroupChooser($this->_iVisitorID,
'ads',
'rate', array(),
884 _t(
'_ch_ads_privacy_rate'));
885 $aAllowComment = $this->oPrivacy->getGroupChooser($this->_iVisitorID,
'ads',
'comment', array(),
886 _t(
'_ch_ads_privacy_comment'));
891 if ($sMsgDeleteImage) {
892 $aAdUnitInfo = $this->_oDb->getAdInfo($iPostID);
895 $sAdsAddLink = (
$this->bUseFriendlyLinks) ?
'ads/my_page/edit/' . $iPostID :
"{$this->sCurrBrowsedFile}?action=my_page&mode=add&EditPostID={$iPostID}";
896 $aAdUnitInfo = (is_array($aAdUnitInfo) && count($aAdUnitInfo) > 0) ? $aAdUnitInfo : $this->_oDb->getAdInfo($iPostID);
897 $iCategoryID = (int)$aAdUnitInfo[
'CatID'];
898 $iSubCategoryID = (int)$aAdUnitInfo[
'SubID'];
900 $sCity = $aAdUnitInfo[
'City'];
903 $sScriptHandle = <<<EOF
904 <script
type=
"text/javascript">
905 addEvent( window,
'load',
function(){ $(
'#Classified').val(
'{$iCategoryID}'); } );
906 addEvent( window,
'load',
function(){ $(
'#SubClassified').val(
'{$iSubCategoryID}'); } );
910 $vSubs = $this->_oDb->getSubsNameIDCountAdsByAdID($iCategoryID);
911 while ($aSub = $vSubs->fetch()) {
912 $iSubID = (int)$aSub[
'ID'];
913 $iSubName = $aSub[
'Name'];
914 $sSubsRows .=
'<option value="' . $iSubID .
'">' . $iSubName .
'</option>';
916 $sFieldSec = $aAdUnitInfo[
'CustomFieldName2'] ?
"{$aAdUnitInfo['CustomFieldName2']} {$aAdUnitInfo['Unit2']} <input type=\"text\" name=\"CustomFieldValue2\" value=\"{$aAdUnitInfo['CustomFieldValue2']}\" size=\"20\" maxlength=\"20\" />" :
"";
918 $sCustomValues = <<<EOF
919 {$aAdUnitInfo[
'CustomFieldName1']} {$aAdUnitInfo[
'Unit1']} <input
type=
"text" name=
"CustomFieldValue1" value=
"{$aAdUnitInfo['CustomFieldValue1']}" size=
"20" maxlength=
"20" />
923 $sNewAdC =
_t(
'_Save Changes');
924 $sMaxedString =
_t(
'_ch_ads_Warn_max_live_days');
928 $vSqlRes = $this->_oDb->getAllCatsInfo();
930 return _t(
'_Error Occured');
933 while ($aSqlResStr = $vSqlRes->fetch()) {
934 $sCatOptions .=
"<option value=\"{$aSqlResStr['ID']}\">{$aSqlResStr['Name']}</option>\n";
937 $iSubCatID = (int)
ch_get(
'IDClassifiedsSubs');
938 $sExclamationIcon =
$GLOBALS[
'oSysTemplate']->getIconUrl(
'exclamation.png');
941 'sCatOptions' => $sCatOptions,
942 'sSubsRows' => $sSubsRows,
943 'sScriptHandle' => $sScriptHandle,
944 'sCustomValues' => $sCustomValues,
945 'ch_if:cat_warning' => array(
946 'condition' => (
false !==
ch_get(
'add_button') && !$iSubCatID),
950 $sCustomCategories = $this->_oTemplate->parseHtmlByName(
'ads_add_categ_form.html',
$aVars);
953 $aCountries = $oProfileFields->convertValues4Input(
'#!Country');
957 'form_attrs' => array(
958 'name' =>
'CreateAdsForm',
959 'action' => $sAdsAddLink,
961 'enctype' =>
'multipart/form-data',
965 'table' => $this->_oConfig->sSQLPostsTable,
967 'submit_name' =>
'add_button',
971 'CustomCategories' => array(
972 'caption' =>
_t(
'_Category'),
974 'name' =>
'CustomCategories',
975 'content' => $sCustomCategories
980 'caption' =>
_t(
'_Caption'),
984 'params' => array(3, 100),
985 'error' =>
_t(
'_ch_ads_Caption_error'),
993 'name' =>
'LifeTime',
994 'caption' =>
_t(
'_ch_ads_Life_Time') .
" ({$sDaysC})",
995 'info' => $sMaxedString,
997 'values' => $aLifeTimeValues,
1001 'params' => array(1, 3),
1002 'error' =>
_t(
'_Error Occured'),
1011 'caption' =>
_t(
'_Tags'),
1012 'info' =>
_t(
'_sys_tags_note'),
1013 'required' =>
false,
1019 'type' =>
'textarea',
1020 'name' =>
'Message',
1021 'caption' =>
_t(
'_ch_ads_post_text'),
1026 'params' => array(3, 65535),
1027 'error' =>
_t(
'_ch_ads_Text_error'),
1030 'pass' =>
'XssHtml',
1035 'name' =>
'Country',
1036 'caption' =>
_t(
'_ch_ads_caption_country'),
1037 'values' => $aCountries,
1042 'params' => array(
'/^[a-zA-Z]{2}$/'),
1043 'error' =>
_t(
'_ch_ads_err_country'),
1047 'params' => array(
'/([a-zA-Z]{2})/'),
1053 'caption' =>
_t(
'_ch_ads_caption_city'),
1058 'params' => array(3, 50),
1059 'error' =>
_t(
'_ch_ads_err_city'),
1067 'name' =>
'userfile[]',
1068 'caption' =>
_t(
'_associated_image'),
1070 'multiplyable' =>
'true',
1073 'ExistedImages' => array(
1076 'allowView' => $aAllowView,
1077 'allowRate' => $aAllowRate,
1078 'allowComment' => $aAllowComment,
1079 'add_button' => array(
1081 'name' =>
'add_button',
1082 'value' => $sNewAdC,
1087 $sExistedMedia =
'';
1089 $aAdUnitInfo = (is_array($aAdUnitInfo) && count($aAdUnitInfo) > 0) ? $aAdUnitInfo : $this->_oDb->getAdInfo($iPostID);
1090 $sExistedMedia = $aAdUnitInfo[
'Media'];
1091 $sSubject = $aAdUnitInfo[
'Subject'];
1093 $sPostTags = $aAdUnitInfo[
'Tags'];
1095 $sPostLifeTime = (int)$aAdUnitInfo[
'LifeTime'];
1097 $sPostPictureElements = $sMsgDeleteImage . $this->
getImageManagingCode($aAdUnitInfo[
'Media'], $iPostID);
1098 if ($sPostPictureElements !=
'') {
1099 $aForm[
'inputs'][
'ExistedImages'][
'type'] =
'custom';
1100 $aForm[
'inputs'][
'ExistedImages'][
'content'] = $sPostPictureElements;
1101 $aForm[
'inputs'][
'ExistedImages'][
'caption'] =
_t(
'_ch_ads_Existed_images');
1104 $aForm[
'inputs'][
'Subject'][
'value'] = $sSubject;
1106 $aForm[
'inputs'][
'Tags'][
'value'] = $sPostTags;
1107 $aForm[
'inputs'][
'LifeTime'][
'value'] = $sPostLifeTime;
1109 $aForm[
'inputs'][
'allowView'][
'value'] = $aAdUnitInfo[
'AllowView'];
1110 $aForm[
'inputs'][
'allowRate'][
'value'] = $aAdUnitInfo[
'AllowRate'];
1111 $aForm[
'inputs'][
'allowComment'][
'value'] = $aAdUnitInfo[
'AllowComment'];
1113 $aForm[
'inputs'][
'hidden_postid'] = array(
1115 'name' =>
'EditPostID',
1116 'value' => $iPostID,
1120 if (
empty(
$aForm[
'inputs'][
'allowView'][
'value']) || !
$aForm[
'inputs'][
'allowView'][
'value']) {
1123 if (
empty(
$aForm[
'inputs'][
'allowRate'][
'value']) || !
$aForm[
'inputs'][
'allowRate'][
'value']) {
1126 if (
empty(
$aForm[
'inputs'][
'allowComment'][
'value']) || !
$aForm[
'inputs'][
'allowComment'][
'value']) {
1132 if (
$oForm->isSubmittedAndValid() && $iSubCatID) {
1136 $sPostUri =
uriGenerate(
ch_get(
'Subject'), $this->_oConfig->sSQLPostsTable,
'EntryUri');
1137 $sAutoApprovalVal = (
getParam(
'ch_ads_auto_approving') ==
'on') ?
'active' :
'new';
1139 $sCustomFieldValue1 = floatval(
ch_get(
'CustomFieldValue1'));
1140 $sCustomFieldValue2 = floatval(
ch_get(
'CustomFieldValue2'));
1144 $sErrorImageProcessing = ob_get_clean();
1147 'DateTime' => $sCurTime,
1148 'Status' => $sAutoApprovalVal,
1149 'IDClassifiedsSubs' => $iSubCatID,
1150 'CustomFieldValue1' => $sCustomFieldValue1,
1151 'CustomFieldValue2' => $sCustomFieldValue2
1153 if ($sMedIds !=
'') {
1154 $sMedIds = ($sExistedMedia !=
'') ? $sExistedMedia .
',' . $sMedIds : $sMedIds;
1155 $aValsAdd[
'Media'] = $sMedIds;
1160 $oForm->update($iPostID, $aValsAdd);
1161 $iLastId = $iPostID;
1163 $aValsAdd[
'EntryUri'] = $sPostUri;
1165 $iLastId =
$oForm->insert($aValsAdd);
1174 $oTags->reparseObjTags(
'ad', $iLastId);
1177 ChWsbService::call(
'wmap', $iPostID ?
'response_entry_change' :
'response_entry_add',
1178 array($this->_oConfig->getUri(), $iLastId ? $iLastId : $iPostID));
1182 $sAlertAction = ($iPostID) ?
'edit' :
'create';
1183 $oZ =
new ChWsbAlerts(
'ads', $sAlertAction, $iLastId, $this->_iVisitorID);
1186 $sResult = ($iPostID > 0) ?
_t(
'_ch_ads_Ad_succ_updated') :
_t(
'_ch_ads_Ad_succ_added');
1188 return ($sErrorImageProcessing ? $sErrorImageProcessing :
'') .
MsgBox(
$sResult) . (!$iPostID ?
'<script>setTimeout(function () { document.location="' . $this->
genUrl($iLastId,
1189 '',
'entry',
true) .
'"; } , 1000);</script>' :
'');
1191 return MsgBox(
_t(
'_Error Occured'));
1194 $sNewAdFormVal =
'<div class="blogs-view ch-def-bc-margin">' .
$oForm->getCode() .
'</div>';
1196 return ($bBox) ?
DesignBoxContent(
_t(
'_ch_ads_Add_ad'), $sNewAdFormVal, 1) : $sNewAdFormVal;
1208 $sCurrentTime =
time();
1213 for ($i = 0; $i < count($_FILES[
'userfile'][
'tmp_name']); $i++) {
1214 if ($_FILES[
'userfile'][
'error'][$i]) {
1217 if ($_FILES[
'userfile'][
'size'][$i] > $this->iMaxUplFileSize) {
1218 echo
_t_err(
'_ch_ads_Warn_max_file_size', $_FILES[
'userfile'][
'name'][$i]);
1222 list($width, $height, $type, $attr) = getimagesize($_FILES[
'userfile'][
'tmp_name'][$i]);
1224 if ($type != 1 && $type != 2 && $type != 3) {
1228 $sBaseName = $this->_iVisitorID .
'_' . $sCurrentTime .
'_' . ($i + 1);
1229 $sExt = strrchr($_FILES[
'userfile'][
'name'][$i],
'.');
1232 $sImg = CH_DIRECTORY_PATH_ROOT .
"{$this->sUploadDir}img_{$sBaseName}{$sExt}";
1233 $sImgThumb = CH_DIRECTORY_PATH_ROOT .
"{$this->sUploadDir}thumb_{$sBaseName}{$sExt}";
1234 $sImgThumbBig = CH_DIRECTORY_PATH_ROOT .
"{$this->sUploadDir}big_thumb_{$sBaseName}{$sExt}";
1235 $sImgIcon = CH_DIRECTORY_PATH_ROOT .
"{$this->sUploadDir}icon_{$sBaseName}{$sExt}";
1236 $vResizeRes =
imageResize($_FILES[
'userfile'][
'tmp_name'][$i], $sImg, $this->iImgSize,
1238 $vThumbResizeRes =
imageResize($_FILES[
'userfile'][
'tmp_name'][$i], $sImgThumb, $this->iThumbSize,
1240 $vBigThumbResizeRes =
imageResize($_FILES[
'userfile'][
'tmp_name'][$i], $sImgThumbBig,
1241 $this->iBigThumbSize, $this->iBigThumbSize);
1242 $vIconResizeRes =
imageResize($_FILES[
'userfile'][
'tmp_name'][$i], $sImgIcon, $this->iIconSize,
1244 if ($vResizeRes || $vThumbResizeRes || $vBigThumbResizeRes || $vIconResizeRes) {
1245 echo
_t_err(
"_ERROR_WHILE_PROCESSING");
1249 $iImgId = $this->_oDb->insertMedia($this->_iVisitorID, $sBaseName,
$sExt);
1252 @unlink($sImgThumb);
1253 @unlink($sImgThumbBig);
1260 return implode(
',', $aIDs);
1264 function getManageArea($oSearch, $sBoxIdSpec, $aButtons = array(), $sPgnUrl =
'', $aPgn = array())
1266 $sCode = $oSearch->displayResultBlock();
1267 if ($oSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
1270 if ($oSearch->aCurrent[
'paginate'][
'perPage'] < $oSearch->aCurrent[
'paginate'][
'totalNum']) {
1272 'page_url' => $sPgnUrl,
1273 'count' => $oSearch->aCurrent[
'paginate'][
'totalNum'],
1274 'per_page' => $oSearch->aCurrent[
'paginate'][
'perPage'],
1275 'page' => $oSearch->aCurrent[
'paginate'][
'page'],
1277 $sPgn =
'<div class="clear_both"></div>';
1278 $aPgnParams = array_merge($aPgn, $aPgnSpec);
1280 $sPgn .= $oPgnSpec->getPaginate();
1281 $sCode =
'<div id="' . $sBoxIdSpec .
'">' .
$sCode . $sPgn .
'</div>';
1282 $sPgn =
'<div class="clear_both"></div>';
1285 if (!
empty($aButtons) && $oSearch->bShowCheckboxes) {
1286 $sActionsPanel = $oSearch->showAdminActionsPanel(
'ads_box', $aButtons,
'ads');
1306 function getMemberAds($iOtherProfileID = 0, $iRandLim = 0, $iExceptUnit = 0)
1308 $sBrowseAllAds =
_t(
'_ch_ads_Browse_All_Ads');
1309 $sUserListC =
_t(
'_ch_ads_Users_other_listing');
1313 $sSiteUrl = CH_WSB_URL_ROOT;
1315 $sBreadCrumbs = <<<EOF
1316 <div
class=
"paginate ch-def-padding-left ch-def-padding-right">
1317 <div
class=
"view_all">
1318 <
a href=
"{$sHomeLink}">{$sBrowseAllAds}</
a>
1323 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
1325 if ($iRandLim > 0) {
1326 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = (int)$iRandLim;
1328 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
1330 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
1331 $oTmpAdsSearch->aCurrent[
'restriction'][
'owner'][
'value'] = $iOtherProfileID;
1332 if ($iExceptUnit > 0) {
1333 $oTmpAdsSearch->aCurrent[
'restriction'][
'id'][
'value'] = $iExceptUnit;
1334 $oTmpAdsSearch->aCurrent[
'restriction'][
'id'][
'operator'] =
'!=';
1337 $sMemberAds = $oTmpAdsSearch->displayResultBlock();
1338 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
1339 $sMemberAds =
MsgBox(
_t(
'_Empty'));
1342 if ($iRandLim == 0) {
1343 $GLOBALS[
'oTopMenu']->setCurrentProfileID($iOtherProfileID);
1353 if ($this->bAdminMode ==
true) {
1354 $vDelSQL = $this->_oDb->getMemberAds((
int)$iProfileID);
1355 while ($aAdv = $vDelSQL->fetch()) {
1369 $iDeleteAdvertisementID = (int)$iID;
1371 $iAdvOwner = $this->_oDb->getOwnerOfAd($iDeleteAdvertisementID);
1374 return $this->_oTemplate->displayAccessDenied();
1377 if ($iDeleteAdvertisementID > 0) {
1378 $sSuccDel =
_t(
"_ch_ads_Ad_succ_deleted");
1379 $sFailDel =
_t(
"_ch_ads_Ad_fail_delete");
1382 $sMediaIDs = $this->_oDb->getMediaOfAd($iDeleteAdvertisementID);
1383 if ($sMediaIDs !=
'') {
1384 $aChunks = explode(
',', $sMediaIDs);
1385 foreach ($aChunks
as $sMedId) {
1386 $iMedId = (int)$sMedId;
1388 $sMediaFileName = $this->_oDb->getMediaFile($iMedId);
1389 if ($sMediaFileName !=
'') {
1390 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'img_' . $sMediaFileName);
1391 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'thumb_' . $sMediaFileName);
1392 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'big_thumb_' . $sMediaFileName);
1393 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'icon_' . $sMediaFileName);
1395 $this->_oDb->deleteMedia($iMedId);
1400 if ($this->_oDb->deleteAd($iDeleteAdvertisementID)) {
1403 $oCmts =
new ChWsbCmts(
'ads', $iDeleteAdvertisementID);
1404 $oCmts->onObjectDelete();
1409 $oTags->reparseObjTags(
'ad', $iDeleteAdvertisementID);
1413 $oViews =
new ChWsbViews(
'ads', $iDeleteAdvertisementID,
false);
1414 $oViews->onObjectDelete();
1419 array($this->_oConfig->getUri(), $iDeleteAdvertisementID));
1425 'type' =>
'object_id',
1427 'object_id' => $iDeleteAdvertisementID
1431 $oZ =
new ChWsbAlerts(
'ads',
'delete', $iDeleteAdvertisementID, $iDeleteAdvertisementID);
1434 $sRetHtml .=
MsgBox(
_t($sSuccDel));
1436 $sRetHtml .=
MsgBox(
_t($sFailDel));
1441 return MsgBox(
_t(
'_Error Occured'));
1447 $sDeleteC =
_t(
'_Delete');
1449 if ($sMediaIDs !=
'') {
1450 $aChunks = explode(
',', $sMediaIDs);
1451 foreach ($aChunks
as $sMedId) {
1452 $iMedId = (int)$sMedId;
1453 if (is_numeric($iMedId) && $iMedId) {
1454 $aSqlRes = $this->_oDb->getMediaInfo($iMedId);
1456 $sFileName = CH_WSB_URL_ROOT . $this->sUploadDir .
'thumb_' . $aSqlRes[
'MediaFile'];
1457 $sAdsEditLink = ($this->bUseFriendlyLinks ? CH_WSB_URL_ROOT .
"ads/my_page/edit/{$iPostID}/dimg/{$iMedId}" :
"{$this->sCurrBrowsedFile}?action=my_page&mode=add&EditPostID={$iPostID}&dimg={$iMedId}");
1459 <div style=
"float:left;">
1460 <img
class=
"photo1 ch-def-round-corners ch-def-shadow ch-def-margin-sec-right" src=
"{$sFileName}" style=
"width:{$this->iThumbSize}px;" />
1462 <
a href=
"{$sAdsEditLink}">{$sDeleteC}</
a>
1470 <div
class=
"cls_edit_imgs_cont">
1472 <div
class=
"clear_both"></div>
1481 if ($isSubstituteNoImage) {
1482 $sFileName = (
$sType !=
'icon') ? $this->sPicNotAvail :
$GLOBALS[
'oSysTemplate']->getIconUrl(
'no-photo-64.png');
1485 if ($sMediaIDs !=
'') {
1486 $aChunks = explode(
',', $sMediaIDs);
1487 $iMedId = (int)$aChunks[0];
1489 if (is_numeric($iMedId) && $iMedId) {
1490 $aSqlRes = $this->_oDb->getMediaInfo($iMedId);
1492 if (file_exists(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
$sType .
'_' . $aSqlRes[
'MediaFile'])) {
1493 $sFileName = CH_WSB_URL_ROOT . $this->sUploadDir .
$sType .
'_' . $aSqlRes[
'MediaFile'];
1505 if ($isSubstituteNoImage) {
1506 $sFileName = (
$sType !=
'icon') ? $this->sPicNotAvailPath :
$GLOBALS[
'oSysTemplate']->getIconPath(
'no-photo-64.png');
1509 if ($sMediaIDs !=
'') {
1510 $aChunks = explode(
',', $sMediaIDs);
1511 $iMedId = (int)$aChunks[0];
1513 if (is_numeric($iMedId) && $iMedId) {
1514 $aSqlRes = $this->_oDb->getMediaInfo($iMedId);
1516 if (file_exists(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
$sType .
'_' . $aSqlRes[
'MediaFile'])) {
1517 $sFileName = CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
$sType .
'_' . $aSqlRes[
'MediaFile'];
1535 if ($this->_iVisitorID > 0) {
1536 $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID);
1538 $sCustDetails = ($aSqlResStr[
'CustomFieldName1'] !=
null && $aSqlResStr[
'CustomFieldValue1']) ?
"{$aSqlResStr['Unit1']} {$aSqlResStr['CustomFieldValue1']}" :
'';
1539 $sBuyMsg1 =
_t(
'_ch_ads_BuyMsg1');
1540 $sBuyDet1 =
_t(
'_ch_ads_BuyDetails1');
1541 $sContinue =
_t(
'_Continue');
1544 <div
class=
"dbContent">
1549 <
b>{$sBuyDet1}</
b> {$sCustDetails}
1552 <input
class=
"button ch-btn" type=
"submit" onclick=
"javascript:this.value='Wait...';this.disabled=true;document.bid_form.submit();" value=
"{$sContinue}" />
1553 <div
class=
"clear_both"></div>
1560 <
form action=
"{$this->sCurrBrowsedFile}" name=
"bid_form" method=
"post">
1561 <input
type=
"hidden" name=
"BuySendNow" value=
"BuySendNow" />
1562 <input
type=
"hidden" name=
"IDAdv" value=
"{$iAdvertisementID}" />
1563 <input
type=
"hidden" name=
"IDSeller" value=
"{$aSqlResStr['IDProfile']}" />
1582 $iSellerId = (int)
ch_get(
'IDSeller');
1583 $sRetHtml =
_t(
'_WARNING');
1584 if ($this->_iVisitorID > 0) {
1585 $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID);
1589 $sCustDetails = ($aSqlResStr[
'CustomFieldName1'] !=
null && $aSqlResStr[
'CustomFieldValue1']) ?
"{$aSqlResStr['Unit1']} {$aSqlResStr['CustomFieldValue1']}" :
'';
1591 $sPowDol =
_t(
'_powered_by_Cheetah');
1592 $sBuyMsg2 =
_t(
'_ch_ads_BuyMsg2');
1593 $sBuyDet1 =
_t(
'_ch_ads_BuyDetails1');
1594 $sReturnBackC =
_t(
'_ch_ads_Back');
1598 $aTemplate = $rEmailTemplate->getTemplate(
't_BuyNow', $this->_iVisitorID);
1599 $aTemplateS = $rEmailTemplate->getTemplate(
't_BuyNowS', $this->_iVisitorID);
1602 $sMessageB = $aTemplate[
'Body'];
1603 $sMessageS = $aTemplateS[
'Body'];
1604 $sSubject = $aTemplate[
'Subject'];
1605 $sSubjectS = $aTemplateS[
'Subject'];
1608 $aPlus[
'Subject'] = $aSqlResStr[
'Subject'];
1609 $aPlus[
'NickName'] =
getNickName($aSqlSellerRes[
'ID']);
1610 $aPlus[
'EmailS'] = $aSqlSellerRes[
'Email'];
1611 $aPlus[
'NickNameB'] =
getNickName($aSqlMemberRes[
'ID']);
1612 $aPlus[
'EmailB'] = $aSqlMemberRes[
'Email'];
1613 $aPlus[
'sCustDetails'] = $sCustDetails;
1615 $sGenUrl = $this->
genUrl($iAdvertisementID, $aSqlResStr[
'EntryUri']);
1616 $aPlus[
'ShowAdvLnk'] = $sGenUrl;
1618 $aPlus[
'sPowDol'] = $sPowDol;
1619 $aPlus[
'site_email'] =
$site[
'email'];
1622 $aPlus[
'Who'] =
'buyer';
1623 $aPlus[
'String1'] =
_t(
'_ch_ads_you_have_purchased_an_item');
1624 sendMail($aSqlMemberRes[
'Email'], $sSubject, $sMessageB, $aSqlSellerRes[
'ID'], $aPlus,
'html');
1626 $aPlus[
'Who'] =
'seller';
1627 $aPlus[
'String1'] =
_t(
'_ch_ads_someone_wants_to_purchase');
1628 if (
sendMail($aSqlSellerRes[
'Email'], $sSubjectS, $sMessageS, $aSqlSellerRes[
'ID'], $aPlus,
'html')) {
1629 $sRetHtml .=
MsgBox(
_t(
'_Email was successfully sent'));
1631 $oZ =
new ChWsbAlerts(
'ads',
'buy', $iAdvertisementID, $this->_iVisitorID);
1640 <
b>{$sBuyDet1}</
b> {$sCustDetails}
1643 <
a class=
"ch-btn" href=
"{$sGenUrl}">{$sReturnBackC}</
a>
1644 <div
class=
"clear_both"></div>
1665 $iAdvertisementID = (int)$iID;
1667 $sSiteUrl = CH_WSB_URL_ROOT;
1669 if ($this->bAdminMode && $iAdvertisementID > 0) {
1670 $iFeaturedStatus = $this->_oDb->getFeaturedStatus($iAdvertisementID);
1671 $iNewStatus = ($iFeaturedStatus == 1) ? 0 : 1;
1672 if (
ch_get(
'do') ==
'cfs') {
1673 $this->_oDb->UpdateFeatureStatus($iAdvertisementID, $iNewStatus);
1677 $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID);
1679 $iOwnerID = (int)$aSqlResStr[
'IDProfile'];
1681 $bPossibleToView = $this->oPrivacy->check(
'view', $iAdvertisementID, $this->_iVisitorID);
1682 if ($this->
isAllowedView($iOwnerID,
true) ==
false || $bPossibleToView ==
false) {
1683 return $this->_oTemplate->displayAccessDenied();
1690 $sCountryName = $aSqlResStr[
'Country'];
1691 $sCountryPic = ($sCountryName ==
'') ?
'' :
' <img alt="' . $sCountryName .
'" src="' . (
$site[
'flags'] . strtolower($sCountryName)) .
'.gif"/>';
1692 $sCountryName =
_t($aPreValues[
'Country'][$sCountryName][
'LKey']);
1694 $sPostedByC =
_t(
'_ch_ads_Posted_by');
1695 $sPhoneC =
_t(
'_Phone');
1696 $sDetailsC =
_t(
'_ch_ads_Details');
1697 $sUserOtherListC =
_t(
'_ch_ads_Users_other_listing');
1698 $sActionsC =
_t(
'_Actions');
1699 $sSureC =
_t(
'_Are_you_sure');
1701 $sPostedBy .=
'<div class="cls_res_info">';
1702 $sPostedBy .= $sPostedByC .
': <span style="color:#333333;"><a href="' .
getProfileLink($aNameRet[
'ID']) .
'">' . $aNameRet[
'NickName'] .
'</a></span>';
1703 $sPostedBy .=
'</div>';
1704 if ($aNameRet[
'Phone'] !=
"") {
1705 $sPostedBy .=
'<div class="cls_res_info">';
1706 $sPostedBy .= $sPhoneC .
": <div class=\"clr3\">{$aNameRet['Phone']}</div>";
1707 $sPostedBy .=
'</div>';
1713 $aTagsLinks = array();
1715 $aTags = preg_split(
"/[;,]/", $aSqlResStr[
'Tags']);
1716 foreach ($aTags
as $sTag) {
1718 $sTagS = htmlspecialchars(
title2uri($sTag));
1719 $aTagsLinks[] =
'<a href="' .
"{$sSubLink}{$sTagS}" .
'">' . $sTag .
'</a>';
1721 $sTags .= implode(
", ", $aTagsLinks);
1723 $sMemberActionForms =
'';
1724 if ($this->_iVisitorID > 0 && $this->_iVisitorID != $aNameRet[
'ID']) {
1725 if (
getParam(
'ch_ads_enable_paid') ==
'on') {
1726 $sMemberActionForms .= <<<EOF
1727 <
form action=
"{$this->sCurrBrowsedFile}" name=
"BuyNowForm" method=
"post">
1729 <input
type=
"hidden" name=
"IDAdv" value=
"{$iAdvertisementID}" />
1730 <input
type=
"hidden" name=
"IDSeller" value=
"{$aSqlResStr['IDProfile']}" />
1734 $sMemberActionForms .= <<<EOF
1735 <
form action=
"{$sSiteUrl}mail.php" name=
"post_pm" id=
"post_pm" method=
"get">
1737 <input
type=
"hidden" name=
"recipient_id" value=
"{$aSqlResStr['IDProfile']}" />
1738 <input
type=
"hidden" name=
"subject" value=
"{$aSqlResStr['Subject']}" />
1743 $sEntryUrl = $this->
genUrl($iAdvertisementID, $aSqlResStr[
'EntryUri'],
'entry');
1745 $sMediaIDs = $this->_oDb->getMediaOfAd($iAdvertisementID);
1746 if ($sMediaIDs !=
'') {
1747 $aReadyMedia = explode(
',', $sMediaIDs);
1748 $sPictureSectContent = $this->
_blockPhoto($aReadyMedia, $iOwnerID);
1751 $sPictureSect = ($sPictureSectContent !=
'') ?
DesignBoxContent(
_t(
'_ch_ads_Ad_photos'),
1752 $sPictureSectContent, 1) :
'';
1753 $this->sTAPhotosContent = $sPictureSectContent;
1757 $aButton =
$oSubscription->getButton($this->_iVisitorID, $this->_oConfig->getUri(),
'',
1761 $aActionKeys = array(
1762 'BaseUri' => $this->_oConfig->getBaseUri(),
1763 'visitor_id' => $this->_iVisitorID,
1764 'owner_id' => $aNameRet[
'ID'],
1765 'admin_mode' =>
"'" . $this->bAdminMode .
"'",
1766 'ads_id' => $iAdvertisementID,
1767 'ads_status' => $aSqlResStr[
'Status'],
1768 'ads_act_type' => $aSqlResStr[
'Status'] ==
'active' ?
'inactive' :
'active',
1769 'ads_featured' => (
int)$aSqlResStr[
'Featured'],
1770 'sure_label' => $sSureC,
1771 'ads_entry_url' => $sEntryUrl,
1773 'sbs_ads_title' => $aButton[
'title'],
1774 'sbs_ads_script' => $aButton[
'script'],
1775 'TitleShare' => $this->isAllowedShare($aSqlResStr) ?
_t(
'_Share') :
'',
1778 $aActionKeys[
'repostCpt'] = $aActionKeys[
'repostScript'] =
'';
1782 $aActionKeys[
'repostCpt'] =
_t(
'_Repost');
1784 array($this->_iVisitorID,
'ads',
'create', $iAdvertisementID));
1786 $sActionsTable =
$GLOBALS[
'oFunctions']->genObjectsActions($aActionKeys,
'ch_ads',
false);
1788 $sActionsSectContent = $sSubsAddon . $sMemberActionForms . $sActionsTable;
1790 $sActionsSectContent, 1) :
'';
1791 $this->sTAActionsContent = ($this->_iVisitorID > 0 ||
$this->bAdminMode) ? $sActionsSectContent :
'';
1794 $this->oCmtsView =
new ChAdsCmts ($this->_oConfig->getCommentSystemName(), $iAdvertisementID);
1795 $sCommentsSectContent = $this->oCmtsView->getExtraCss();
1796 $sCommentsSectContent .= $this->oCmtsView->getExtraJs();
1797 $sCommentsSectContent .= (!$this->oCmtsView->isEnabled()) ?
'' : $this->oCmtsView->getCommentsFirst();
1798 $this->sTACommentsContent = $sCommentsSectContent;
1799 $sCommSect =
DesignBoxContent($aCaptions[
'Comments'], $sCommentsSectContent, 1);
1801 $sUserOtherListing = $this->
getMemberAds($aSqlResStr[
'IDProfile'], 2, $iAdvertisementID);
1803 $sDataTimeFormatted =
getLocaleDate($aSqlResStr[
'DateTime_UTS']);
1804 $iViews = (int)$aSqlResStr[
'Views'];
1809 $sCategLink = (
$this->bUseFriendlyLinks) ? CH_WSB_URL_ROOT .
'ads/cat/' . $aSqlResStr[
'CEntryUri'] :
"{$this->sCurrBrowsedFile}?bClassifiedID={$aSqlResStr['CatID']}";
1810 $sSCategLink = (
$this->bUseFriendlyLinks) ? CH_WSB_URL_ROOT .
'ads/subcat/' . $aSqlResStr[
'SEntryUri'] :
"{$this->sCurrBrowsedFile}?bSubClassifiedID={$aSqlResStr['SubID']}";
1812 $aSubjVariables = array(
1813 'author_unit' => $sOwnerThumb,
1814 'date' => $sDataTimeFormatted,
1815 'date_ago' => $sTimeAgo,
1816 'cats' => $this->_oTemplate->parseHtmlByTemplateName(
'category', array(
1817 'cat_link' => $sCategLink,
1818 'sub_cat_link' => $sSCategLink,
1819 'cat_name' => $aSqlResStr[
'Name'],
1820 'sub_cat_name' => $aSqlResStr[
'NameSub']
1825 $sSubjectSectContent = $this->_oTemplate->parseHtmlByName(
'entry_view_block_info.html', $aSubjVariables);
1828 $this->sTAInfoContent = $sSubjectSectContent;
1830 $sDescriptionContent =
'<div class="dbContent ch-def-bc-margin ch-def-font-large">' . $sAdsMessage .
'</div>';
1832 $this->sTADescription = $sDescriptionContent;
1836 'form_attrs' => array(
1837 'name' =>
'custom_values_form',
1838 'action' =>
$oAds->sCurrBrowsedFile,
1843 'name' =>
'Country',
1844 'caption' =>
_t(
'_Country'),
1845 'value' => $sCountryName . $sCountryPic,
1850 'caption' =>
_t(
'_City'),
1851 'value' => $aSqlResStr[
'City'],
1856 if ($aSqlResStr[
'CustomFieldName1'] && $aSqlResStr[
'CustomFieldValue1']) {
1857 $aForm[
'inputs'][
'Custom1'] = array(
1859 'name' =>
'Custom1',
1860 'caption' => $aSqlResStr[
'CustomFieldName1'],
1861 'value' => $aSqlResStr[
'Unit1'] . $aSqlResStr[
'CustomFieldValue1'],
1864 if ($aSqlResStr[
'CustomFieldName2'] && $aSqlResStr[
'CustomFieldValue2']) {
1865 $aForm[
'inputs'][
'Custom2'] = array(
1867 'name' =>
'Custom2',
1868 'caption' => $aSqlResStr[
'CustomFieldName2'],
1869 'value' => $aSqlResStr[
'Unit2'] . $aSqlResStr[
'CustomFieldValue2'],
1874 $sOtherInfoContent =
$oForm->getCode();
1875 $sOtherInfoSect =
DesignBoxContent(
_t(
'_ch_ads_Custom_Values'), $sOtherInfoContent, 1);
1876 $this->sTAOtherInfo = $sOtherInfoContent;
1878 $bPossibleToRate = $this->oPrivacy->check(
'rate', $iAdvertisementID, $this->_iVisitorID);
1880 $iVote = ($oVotingView && $oVotingView->isEnabled() && $bPossibleToRate) ? 1 : 0;
1881 $sVotePostRating = $oVotingView->getBigVoting($iVote);
1884 $this->sTARateContent =
'<div class="ch-def-bc-margin">' . $sVotePostRating .
'</div>';
1886 $sOtherListingContent = <<<EOF
1887 <div
class=
"dbContent">
1888 {$sUserOtherListing}
1892 $sSPaginateActions = <<<EOF
1893 <div
class=
"paginate ch-def-padding-left ch-def-padding-right">
1894 <div
class=
"view_all">
1895 <
a href=
"{$this->sCurrBrowsedFile}" onclick=
"document.forms['UsersOtherListingForm'].submit(); return false;">{$sUserOtherListC}</
a>
1896 <
form action=
"{$this->sCurrBrowsedFile}" name=
"UsersOtherListingForm" method=
"post">
1898 <input
type=
"hidden" name=
"IDProfile" value=
"{$aSqlResStr['IDProfile']}" />
1901 <div
class=
"pages_section"></div>
1906 $sOtherListingContent . $sSPaginateActions, 1);
1907 $this->sTAOtherListingContent = $sOtherListingContent . $sSPaginateActions;
1911 $sBrowseAllAds =
_t(
'_ch_ads_Browse_All_Ads');
1912 $sBreadCrumbs = <<<EOF
1913 <div
class=
"breadcrumbs">
1914 <
a href=
"{$sHomeLink}">{$sBrowseAllAds}</
a>
1916 <
a href=
"{$sCategLink}">{$aSqlResStr[
'Name']}</
a>
1918 <
a href=
"{$sSCategLink}">{$aSqlResStr[
'NameSub']}</
a>
1922 $aBlocks[1] .= $sActionsSect;
1923 $aBlocks[1] .= $sSubjectSect;
1924 $aBlocks[1] .= $sRatingSect;
1925 $aBlocks[1] .= $sOtherListingSect;
1926 $aBlocks[2] .= $sPictureSect;
1927 $aBlocks[2] .= $sCommSect;
1932 <div
class=
"clear_both"></div>
1933 <div
class=
"cls_info_left">
1936 <div
class=
"cls_info">
1940 <div
class=
"clear_both"></div>
1942 <div
class=
"clear_both"></div>
1946 $oZ =
new ChWsbAlerts(
'ads',
'view', $iAdvertisementID, $this->_iVisitorID);
1949 $sAdCover = $this->
getAdCover($aSqlResStr[
'Media'],
'icon');
1950 if ($sAdCover !=
'' && $aSqlResStr[
'Media']) {
1951 $GLOBALS[
'oTopMenu']->setCustomSubIconUrl($sAdCover);
1954 $GLOBALS[
'oTopMenu']->setCustomSubHeader(htmlspecialchars($aSqlResStr[
'Subject']));
1955 $GLOBALS[
'oTopMenu']->setCustomSubHeaderUrl($sEntryUrl);
1957 $GLOBALS[
'oTopMenu']->setCustomBreadcrumbs(array(
1958 _t(
'_ch_ads_Ads') => $sHomeLink,
1959 $aSqlResStr[
'Subject'] =>
'',
1962 $this->_oTemplate->setPageDescription(htmlspecialchars($aSqlResStr[
'Subject']));
1963 $this->_oTemplate->addPageKeywords(htmlspecialchars($aSqlResStr[
'Tags']));
1971 $aPostInfo = $this->_oDb->getAdInfo($iEntryId);
1972 if (isset($aPostInfo[
'EntryUri']) && isset($aPostInfo[
'Subject'])) {
1973 $sEntryUrl = $this->
genUrl($iEntryId, $aPostInfo[
'EntryUri']);
1974 $sEntryCaption = $aPostInfo[
'Subject'];
1976 return array(
'skip' =>
true);
1979 $aActionList = array(
1980 'commentPost' =>
'_ch_ads_sbs_comments'
1983 $sActionName = isset($aActionList[
$sAction]) ?
' (' .
_t($aActionList[
$sAction]) .
')' :
'';
1987 'template' => array(
1988 'Subscription' => $sEntryCaption . $sActionName,
1989 'ViewLink' => $sEntryUrl,
2003 'item_img_src' =>
'money',
2004 'item_img_alt' =>
_t(
'_ch_ads_Ads'),
2005 'item_link' => CH_WSB_URL_ROOT . (
getParam(
'permalinks_module_ads') ==
'on' ?
'ads/my_page/' :
'modules/cheetah/ads/classifieds.php?action=my_page'),
2006 'item_title' =>
_t(
'_ch_ads_Ads'),
2007 'extra_info' => $this->_oDb->getMemberAdsCnt(
getLoggedId(),
'active',
true),
2026 'item_img_src' =>
'money',
2027 'item_img_alt' =>
_t(
'_ch_ads_Ad'),
2028 'item_link' => CH_WSB_URL_ROOT . (
getParam(
'permalinks_module_ads') ==
'on' ?
'ads/my_page/add/' :
'modules/cheetah/ads/classifieds.php?action=my_page&mode=add'),
2029 'item_title' =>
_t(
'_ch_ads_Ad'),
2048 'title' =>
'_ch_ads_Ads',
2049 'title_singular' =>
'_ch_ads_Ad',
2050 'icon' =>
'modules/cheetah/ads/|map_marker.png',
2051 'icon_site' =>
'money',
2052 'join_table' =>
'ch_ads_main',
2053 'join_where' =>
"AND `p`.`Status` = 'active' AND UNIX_TIMESTAMP() - `p`.`LifeTime`*24*60*60 < `p`.`DateTime`",
2054 'join_field_id' =>
'ID',
2055 'join_field_country' =>
'Country',
2056 'join_field_city' =>
'City',
2057 'join_field_state' =>
'',
2058 'join_field_zip' =>
'',
2059 'join_field_address' =>
'',
2060 'join_field_title' =>
'Subject',
2061 'join_field_uri' =>
'EntryUri',
2062 'join_field_author' =>
'IDProfile',
2063 'join_field_privacy' =>
'AllowView',
2064 'permalink' =>
'modules/cheetah/ads/classifieds.php?entryUri=',
2077 $iSafeCatID = (int)$iClassifiedID;
2078 $sSiteUrl = CH_WSB_URL_ROOT;
2080 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
2082 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
2083 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
2084 $oTmpAdsSearch->aCurrent[
'restriction'][
'categoryID'][
'value'] = $iSafeCatID;
2085 $sCategoryAds = $oTmpAdsSearch->displayResultBlock();
2087 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
2088 $sCategoryAds =
MsgBox(
_t(
'_Empty'));
2091 if ($this->bUseFriendlyLinks ==
false) {
2092 $sRequest =
ch_html_attribute($_SERVER[
'PHP_SELF']) .
'?bClassifiedID=' . $iSafeCatID .
'&page={page}&per_page={per_page}';
2094 $sRequest = CH_WSB_URL_ROOT .
'ads/all/cat/';
2096 $sRequest .=
'{per_page}/{page}' . $sPaginAddon;
2100 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
2101 $sCategoryAds .= $oTmpAdsSearch->showPagination();
2105 $sBrowseAllAds =
_t(
'_ch_ads_Browse_All_Ads');
2107 $sNameCat = $this->_oDb->getCategoryNameByID($iSafeCatID);
2109 $sBreadCrumbs = <<<EOF
2110 <div
class=
"breadcrumbs">
2111 <
a href=
"{$sHomeLink}">{$sBrowseAllAds}</
a>
2112 <span
class=
"bullet">→</span>
2113 <span
class=
"active_link">{$sNameCat}</span>
2120 $sCategoryAdsPageContent =
DesignBoxContent($sBreadCrumbs, $sFilter . $sCategoryAds, 1);
2122 return $sCategoryAdsPageContent;
2133 $iIDClassifiedsSubs = (int)$iIDClassifiedsSubs;
2134 $sSiteUrl = CH_WSB_URL_ROOT;
2136 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
2138 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
2139 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
2140 $oTmpAdsSearch->aCurrent[
'restriction'][
'subcategoryID'][
'value'] = $iIDClassifiedsSubs;
2141 $sSubAds = $oTmpAdsSearch->displayResultBlock();
2142 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
2146 if ($this->bUseFriendlyLinks ==
false) {
2147 $sRequest =
ch_html_attribute($_SERVER[
'PHP_SELF']) .
'?bSubClassifiedID=' . $iIDClassifiedsSubs .
'&page={page}&per_page={per_page}';
2149 $sRequest = CH_WSB_URL_ROOT .
'ads/all/subcat/';
2151 $sRequest .=
'{per_page}/{page}' . $sPaginAddon;
2155 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
2156 $sSubAds .= $oTmpAdsSearch->showPagination();
2160 $aSubcatRes = $this->_oDb->getCatAndSubInfoBySubID($iIDClassifiedsSubs);
2161 $sCaption =
"<div class=\"fl\">{$aSubcatRes['Name']}->{$aSubcatRes['NameSub']}</div>\n";
2163 $sDesc =
"<div class=\"cls_result_row\">{$aSubcatRes['Description']}</div>";
2166 $sCategLink = (
$this->bUseFriendlyLinks) ? CH_WSB_URL_ROOT .
'ads/cat/' . $aSubcatRes[
'CEntryUri'] :
"{$this->sCurrBrowsedFile}?bClassifiedID={$aSubcatRes['ClassifiedsID']}";
2168 $sBrowseAllAds =
_t(
'_ch_ads_Browse_All_Ads');
2169 $sBreadCrumbs = <<<EOF
2170 <div
class=
"breadcrumbs">
2171 <
a href=
"{$sHomeLink}">{$sBrowseAllAds}</
a>
2172 <span
class=
"bullet">→</span>
2173 <
a href=
"{$sCategLink}">{$aSubcatRes[
'Name']}</
a>
2174 <span
class=
"bullet">→</span>
2175 <span
class=
"active_link">{$aSubcatRes[
'NameSub']}</span>
2181 $sSubPageContent =
DesignBoxContent($sBreadCrumbs, $sFilter . $sSubAds, 1);
2183 return $sSubPageContent;
2193 $sHomeLink = ($this->bUseFriendlyLinks && $this->bAdminMode ==
false) ? CH_WSB_URL_ROOT .
'ads/' :
"{$this->sCurrBrowsedFile}?Browse=1";
2195 $sReturnBackC =
_t(
'_ch_ads_Back');
2199 <
a href=
"{$sHomeLink}">{$sReturnBackC}</
a>
2215 $sDisplayMode =
'last';
2219 $sTypeMode =
'featured';
2220 $sDisplayMode =
'last';
2224 $sDisplayMode =
'popular';
2229 $sDisplayMode =
'top';
2234 if (
false !==
ch_get(
'action')) {
2235 $aParams[] =
'action=' .
ch_get(
'action');
2237 $aParams[] =
'Browse=1';
2239 $aParams[] =
'page={page}';
2240 $aParams[] =
'per_page={per_page}';
2241 $sParams = implode(
'&', $aParams);
2244 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
2246 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
2247 $oTmpAdsSearch->aCurrent[
'sorting'] = $sDisplayMode;
2248 if ($sTypeMode !=
'' && $sTypeMode ==
'featured') {
2249 $oTmpAdsSearch->aCurrent[
'restriction'][
'featuredStatus'][
'value'] = 1;
2254 $oTmpAdsSearch->aCurrent[
'restriction'][
'allow_view'][
'value'] = $this->_iVisitorID ? array(
2260 $sLastAds = $oTmpAdsSearch->displayResultBlock();
2261 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
2264 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
2265 $sLastAds .= $isSimplePaginage ? $oTmpAdsSearch->showPagination2() : $oTmpAdsSearch->showPagination();
2270 return $sLastAdsSection;
2275 $sCategoriesHtml =
'';
2278 $iColumnWidth = (100 / $iColumnsCnt);
2280 $vSqlRes = $this->_oDb->getAllCatsInfo();
2281 $iCategoriesCnt = $vSqlRes->rowCount();
2282 $iCategPerColumn = ceil($iCategoriesCnt / $iColumnsCnt);
2285 while ($aSqlResStr = $vSqlRes->fetch()) {
2286 $iID = $aSqlResStr[
'ID'];
2287 $sCatName = htmlspecialchars($aSqlResStr[
'Name']);
2288 $sCatUri = $aSqlResStr[
'CEntryUri'];
2290 $sCategLink = (
$this->bUseFriendlyLinks) ? CH_WSB_URL_ROOT .
'ads/cat/' . $sCatUri :
"{$this->sCurrBrowsedFile}?bClassifiedID={$iID}";
2292 $sqlResSubs = $this->_oDb->getAllSubCatsInfo($aSqlResStr[
'ID']);
2294 return _t(
'_Error Occured');
2297 while ($aSqlResSubsStr = $sqlResSubs->fetch()) {
2298 $iSubID = (int)$aSqlResSubsStr[
'ID'];
2300 $iAdsCnt = $this->_oDb->getCountOfAdsInSubCat($iSubID);
2301 $sCntSub = ($iAdsCnt > 0) ?
" ({$iAdsCnt})" :
'';
2303 $sNameSubUp = htmlspecialchars(ucwords($aSqlResSubsStr[
'NameSub']));
2304 $sSCategLink = (
$this->bUseFriendlyLinks) ? CH_WSB_URL_ROOT .
'ads/subcat/' . $aSqlResSubsStr[
'SEntryUri'] :
"{$this->sCurrBrowsedFile}?bSubClassifiedID={$iSubID}";
2306 $sSubsHtml .= <<<EOF
2308 <
a class=
"sub_l" href=
"{$sSCategLink}">
2317 <
a href=
"{$sCategLink}">
2322 $sOpenColDiv = $sCloseColDiv =
'';
2323 $iResidueOfDiv = $iCounter % $iCategPerColumn;
2325 if ($iResidueOfDiv == 0) {
2326 $sOpenColDiv = <<<EOF
2327 <div
class=
"ch_ads_categories_col" style=
"width:{$iColumnWidth}%;">
2330 if ($iResidueOfDiv == $iCategPerColumn - 1) {
2331 $sCloseColDiv = <<<EOF
2338 $sCategoryCover =
false == strpos($aSqlResStr[
'Picture'],
2339 '.') ? $aSqlResStr[
'Picture'] : $this->_oTemplate->getIconUrl($aSqlResStr[
'Picture']);
2341 $aCategoryVariables = array(
2342 'category_cover_image' =>
$GLOBALS[
'oFunctions']->sysImage($sCategoryCover,
'', $sCatName,
'',
false,
2344 'category_url' => $sCategLink,
2345 'category_name' => $sCatName,
2346 'sub_categories_list' => $sSubsHtml,
2351 $sCategoryBlock = $this->_oTemplate->parseHtmlByName(
'category_unit.html', $aCategoryVariables);
2353 $sCategoriesHtml .= $sOpenColDiv . $sCategoryBlock . $sCloseColDiv;
2357 if ($iCounter == 0) {
2361 $iResidueOfDivLast = $iCounter % $iCategPerColumn;
2362 if ($iCounter > 0 && $iResidueOfDivLast > 0 && $iResidueOfDivLast < $iCategPerColumn) {
2363 $sCategoriesHtml .=
'</div>';
2367 <script
type=
"text/javascript">
2368 function ShowHideController()
2370 this.ShowHideToggle =
function(rObject) {
2371 var sChildID = $(rObject).attr(
"bxchild");
2372 var sBlockState = $(
"#" + sChildID).css(
"display");
2374 if ( sBlockState ==
'block' ){
2375 $(
"#" + sChildID).slideUp(300);
2376 $(rObject).css({ backgroundPosition :
"0 -17px"});
2378 $(rObject).css({ backgroundPosition :
"0 0"});
2379 $(
"#" + sChildID).slideDown(300);
2386 $sCategoriesBlocks = <<<EOF
2387 <div
class=
"ch_ads_categories_cols ch-def-bc-padding-thd">
2390 <div
class=
"clear_both"></div>
2393 $this->_oTemplate->addCss(array(
'ads_phone.css'));
2406 return $this->_oTemplate->displayAccessDenied();
2411 return $oAdsPageHome->getCode();
2427 $sCategoriesC =
_t(
'_ch_ads_Categories');
2428 $sViewAllC =
_t(
'_View All');
2430 $iClassifiedID = (
false !==
ch_get(
'FilterCat') && (int)
ch_get(
'FilterCat') > 0) ? (
int)
ch_get(
'FilterCat') : (int)$iClassifiedID;
2431 $iSubClassifiedID = (
false !==
ch_get(
'FilterSubCat') && (int)
ch_get(
'FilterSubCat') > 0) ? (
int)
ch_get(
'FilterSubCat') : (int)$iSubClassifiedID;
2437 $iFilterStyleHeight = 38;
2438 $sSubDspStyle = ($sCategorySub !=
"") ?
'' :
'none';
2440 $sClassifiedsOptions =
'';
2441 $vSqlRes = $this->_oDb->getAllCatsInfo();
2443 return _t(
'_Error Occured');
2446 while ($aSqlResStr = $vSqlRes->fetch()) {
2447 $sClassifiedsOptions .=
"<option value=\"{$aSqlResStr['ID']}\"" . (($aSqlResStr[
'ID'] == $iClassifiedID) ?
" selected" :
'') .
">{$aSqlResStr['Name']}</option>\n";
2450 $sCountryOptions =
'';
2452 foreach ($aPreValues[
'Country']
as $key => $value) {
2453 $sCountrySelected = ($sSelCountry == $key) ?
'selected="selected"' :
'';
2454 $sCountryOptions .=
"<option value=\"{$key}\" " . $sCountrySelected .
" >" .
_t($value[
'LKey']) .
"</option>";
2457 $sKeywordsStr = ($sKeywords !=
'') ? $sKeywords :
'';
2460 if ($iClassifiedID == 0 && $iSubClassifiedID == 0) {
2461 $iFilterStyleHeight = 70;
2463 $sOnChange = ($iClassifiedID > 0) ?
'' : <<<EOF
2464 onchange=
"AjaxyAskForSubcatsWithInfo('FilterSubCat', this.value, 'custom_values');"
2469 <div
class=
"ordered_block_select ch-def-margin-sec-top ch-def-margin-sec-right">
2470 <span>{$sCategoriesC}:</span>
2471 <div
class=
"input_wrapper input_wrapper_select ch-def-margin-sec-left clearfix">
2472 <select
class=
"form_input_select ch-def-font-inputs" name=
"FilterCat" id=
"FilterCat" {$sOnChange} style=
"width:250px;">
2473 <option
value=
"-1">{$sViewAllC}</option>{$sClassifiedsOptions}
2480 <div
class=
"ordered_block_select ch-def-margin-sec-top ch-def-margin-sec-right">
2481 <div
class=
"input_wrapper input_wrapper_select clearfix">
2482 <select
class=
"form_input_select ch-def-font-inputs" name=
"FilterSubCat" id=
"FilterSubCat" style=
"display:{$sSubDspStyle};"></select>
2485 <input
id=
"unit" type=
"text" value=
"" size=
"3" maxlength=
"8" style=
"display:none;" />
2490 if ($iClassifiedID > 0) {
2491 $sCateg .=
'<input type="hidden" name="FilterCat" value="' . $iClassifiedID .
'" />';
2494 if ($iSubClassifiedID > 0) {
2495 $sCateg .=
'<input type="hidden" name="FilterSubCat" value="' . $iSubClassifiedID .
'" />';
2499 $aVariables = array(
2501 'sCountryOptions' => $sCountryOptions,
2502 'sCateg' => $sCateg,
2503 'sSubCateg' => $sSubCateg,
2506 $sContent = $this->_oTemplate->parseHtmlByTemplateName(
'filter_form', $aVariables);
2508 return $this->_oTemplate->parseHtmlByName(
'designbox_top_controls.html', array(
'top_controls' =>
$sContent));
2521 $sCustomName1 = $sCustomName2 = $sUnit = $sUnit2 = $sPicture =
'';
2524 $aCatInfos = $this->_oDb->getCatInfo($iCategoryID);
2525 $sTitle = $aCatInfos[0][
'Name'];
2526 $sDescription = $aCatInfos[0][
'Description'];
2527 $sCustomName1 = $aCatInfos[0][
'CustomFieldName1'];
2528 $sCustomName2 = $aCatInfos[0][
'CustomFieldName2'];
2529 $sUnit = $aCatInfos[0][
'Unit1'];
2530 $sUnit2 = $aCatInfos[0][
'Unit2'];
2531 $sPicture = $aCatInfos[0][
'Picture'];
2536 'form_attrs' => array(
2537 'name' =>
'create_main_cats_form',
2543 'table' => $this->_oConfig->sSQLCatTable,
2545 'submit_name' =>
'add_button',
2557 'caption' =>
_t(
'_Title'),
2562 'params' => array(3, 64),
2563 'error' =>
_t(
'_ch_ads_title_error_desc', 64),
2569 'Description' => array(
2571 'name' =>
'Description',
2572 'caption' =>
_t(
'_Description'),
2574 'value' => $sDescription,
2577 'params' => array(3, 128),
2578 'error' =>
_t(
'_ch_ads_description_error_desc', 128),
2584 'CustomFieldName1' => array(
2586 'name' =>
'CustomFieldName1',
2587 'caption' =>
_t(
'_ch_ads_customFieldName1'),
2588 'required' =>
false,
2589 'value' => $sCustomName1,
2597 'caption' =>
_t(
'_ch_ads_Unit') .
' 1',
2598 'required' =>
false,
2604 'CustomFieldName2' => array(
2606 'name' =>
'CustomFieldName2',
2607 'caption' =>
_t(
'_ch_ads_customFieldName2'),
2608 'required' =>
false,
2609 'value' => $sCustomName2,
2617 'caption' =>
_t(
'_ch_ads_Unit') .
' 2',
2618 'required' =>
false,
2626 'name' =>
'Picture',
2627 'caption' =>
_t(
'_Picture'),
2628 'info' =>
_t(
'_In') .
' \modules\cheetah\ads\templates\base\images\icons\'',
2629 'value' => $sPicture,
2634 'add_button' => array(
2636 'name' =>
'add_button',
2637 'value' => ($iCategoryID) ?
_t(
'_Edit') :
_t(
'_ch_ads_add_main_category'),
2643 $aForm[
'inputs'][
'hidden_postid'] = array(
2646 'value' => $iCategoryID,
2653 if (
$oForm->isSubmittedAndValid()) {
2654 $aValsAdd = array();
2655 if ($iCategoryID == 0) {
2656 $sCategUri =
uriGenerate(
ch_get(
'Name'), $this->_oConfig->sSQLCatTable,
'CEntryUri');
2657 $aValsAdd[
'CEntryUri'] = $sCategUri;
2661 if ($iCategoryID > 0) {
2662 $oForm->update($iCategoryID, $aValsAdd);
2663 $iLastId = $iCategoryID;
2665 $iLastId =
$oForm->insert($aValsAdd);
2669 $sCode =
MsgBox(
_t(
'_ch_ads_Main_category_successfully_added'), 3);
2680 'add_subcat' => array(
2681 'href' =>
'javascript: void(0);',
2682 'title' =>
_t(
'_ch_ads_add_subcategory'),
2683 'onclick' =>
'loadHtmlInPopup(\'ads_add_sub_category\', \'modules/cheetah/ads/post_mod_ads.php?action=add_sub_category\');',
2687 'href' =>
'javascript: void(0);',
2688 'title' =>
_t(
'_ch_ads_category_manager'),
2689 'onclick' =>
'loadHtmlInPopup(\'ads_category_manager\', \'modules/cheetah/ads/post_mod_ads.php?action=category_manager\');',
2700 $sSubmitC = !
empty($iSubCategoryID) ?
_t(
'_Edit') :
_t(
'_ch_ads_add_subcategory');
2702 $aParentCategories = array();
2703 $vParentValues = $this->_oDb->getAllCatsInfo();
2704 while ($aCategInfo = $vParentValues->fetch()) {
2705 $iID = $aCategInfo[
'ID'];
2706 $sName = $aCategInfo[
'Name'];
2707 $aParentCategories[$iID] =
$sName;
2712 if ($iSubCategoryID) {
2713 $aSubcatInfos = $this->_oDb->getSubcatInfo($iSubCategoryID);
2714 $sTitle = $aSubcatInfos[0][
'NameSub'];
2715 $sDescription = $aSubcatInfos[0][
'Description'];
2716 $iParentID = (int)$aSubcatInfos[0][
'IDClassified'];
2721 'form_attrs' => array(
2722 'name' =>
'create_sub_cats_form',
2723 'action' =>
'javascript: void(0)',
2728 'table' => $this->_oConfig->sSQLSubcatTable,
2730 'submit_name' =>
'add_button',
2739 'IDClassified' => array(
2741 'name' =>
'IDClassified',
2742 'caption' =>
_t(
'_ch_ads_parent_category'),
2743 'values' => $aParentCategories,
2744 'value' => $iParentID,
2751 'name' =>
'NameSub',
2752 'caption' =>
_t(
'_Title'),
2757 'params' => array(3, 128),
2758 'error' =>
_t(
'_ch_ads_title_error_desc', 128),
2764 'Description' => array(
2766 'name' =>
'Description',
2767 'caption' =>
_t(
'_Description'),
2768 'value' => $sDescription,
2773 'add_button' => array(
2775 'name' =>
'add_button',
2776 'value' => $sSubmitC,
2778 'onClick' =>
"AdmCreateSubcategory(this, '{$this->sHomeUrl}{$this->sCurrBrowsedFile}'); return false;"
2784 if ($iSubCategoryID) {
2785 $aForm[
'inputs'][
'hidden_postid'] = array(
2788 'value' => $iSubCategoryID,
2794 $sJS = $this->_oTemplate->addJs(
'main.js',
true);
2798 if (
$oForm->isSubmittedAndValid()) {
2799 $aValsAdd = array();
2800 if ($iSubCategoryID == 0) {
2801 $sCategUri =
uriGenerate(
ch_get(
'NameSub'), $this->_oConfig->sSQLSubcatTable,
'SEntryUri');
2802 $aValsAdd[
'SEntryUri'] = $sCategUri;
2807 if ($iSubCategoryID > 0) {
2808 $oForm->update($iSubCategoryID, $aValsAdd);
2810 $iLastId = $iSubCategoryID;
2811 $sMessage =
'_ch_ads_Sub_category_successfully_updated';
2813 $iLastId =
$oForm->insert($aValsAdd);
2814 $sMessage =
'_ch_ads_Sub_category_successfully_added';
2826 if (
ch_get(
'mode') ==
'json') {
2830 $sResult = $this->_oTemplate->parseHtmlByName(
'default_margin.html', array(
'content' =>
$sResult));
2832 return $GLOBALS[
'oFunctions']->popupBox(
'ads_add_sub_category',
_t(
'_ch_ads_add_subcategory'),
$sResult);
2837 $sCatID = (int)
ch_get(
'id');
2838 if ($sCatID &&
false !==
ch_get(
'sa')) {
2850 if ($this->_oDb->deleteCat($sCatID)) {
2854 $vSubCats = $this->_oDb->getAllSubCatsInfo($sCategory);
2855 while ($aSubCat = $vSubCats->fetch()) {
2856 $iSubcat = (int)$aSubCat[
'ID'];
2857 $this->_oDb->deleteSubCat($iSubcat);
2863 if ($this->_oDb->deleteSubCat($sCatID)) {
2870 $sJS = $this->_oTemplate->addJs(
'main.js',
true);
2871 $sRootCaptionC =
_t(
'_ch_ads_root');
2872 $sViewC =
_t(
'_View');
2873 $sEditC =
_t(
'_Edit');
2874 $sDeleteC =
_t(
'_Delete');
2876 $sFolder2Icon = $this->_oTemplate->getImageUrl(
'folder_s.gif');
2877 $vSqlRes = $this->_oDb->getAllCatsInfo();
2879 return _t(
'_Error Occured');
2882 while ($aSqlResCls = $vSqlRes->fetch()) {
2883 $iID = (int)$aSqlResCls[
'ID'];
2884 $sName = $aSqlResCls[
'Name'];
2885 $sCUri = $aSqlResCls[
'CEntryUri'];
2886 $sCategLink = $this->
genUrl($iID, $sCUri,
'cat');
2887 $sCategDelLink = $this->
sCurrBrowsedFile .
'?action=category_manager&sa=delcat&id=' . $iID;
2888 $sCategEditLink = $this->
sCurrBrowsedFile .
'?action=category_manager&sa=editcat&id=' . $iID;
2890 $vSubs = $this->_oDb->getSubsNameIDCountAdsByAdID($iID);
2892 while ($aSub = $vSubs->fetch()) {
2893 $iSubID = (int)$aSub[
'ID'];
2894 $iSubName = $aSub[
'Name'];
2895 $sSUri = $aSub[
'SEntryUri'];
2896 $sSubCategLink = $this->
genUrl($iSubID, $sSUri,
'subcat');
2897 $sSubCategDelLink = $this->
sCurrBrowsedFile .
'?action=category_manager&sa=delscat&id=' . $iSubID;
2898 $sSubCategEditLink = $this->
sCurrBrowsedFile .
'?action=category_manager&sa=editscat&id=' . $iSubID;
2900 $sSubsRows .= <<<EOF
2901 <li
id=
'{$iSubID}'><span>{$iSubName} </span><
a href=
"{$sSubCategLink}">({$sViewC})</
a><
a href=
"javascript: void(0)" onclick=
"AdmAction2Category('{$this->sCurrBrowsedFile}?action=category_manager', 'editscat', {$iSubID}); return false;">({$sEditC})</
a><
a href=
"javascript: void(0)" onclick=
"AdmAction2Category('{$this->sCurrBrowsedFile}?action=category_manager', 'delscat', {$iSubID}); return false;">({$sDeleteC})</
a></li>
2905 $sTreeRows .= <<<EOF
2906 <li
id=
'{$iID}'><span>{
$sName}</span><
a href=
"{$sCategLink}">({$sViewC})</
a><
a href=
"javascript: void(0)" onclick=
"AdmAction2Category('{$this->sCurrBrowsedFile}?action=category_manager', 'editcat', {$iID}); return false;">({$sEditC})</
a><
a href=
"javascript: void(0)" onclick=
"AdmAction2Category('{$this->sCurrBrowsedFile}?action=category_manager', 'delcat', {$iID}); return false;">({$sDeleteC})</
a>
2915 <script
type=
"text/javascript">
2916 var simpleTreeCollection;
2918 simpleTreeCollection = $(
'.simpleTree').simpleTree({
2920 afterClick:
function(node){
2923 afterDblClick:
function(node){
2926 afterMove:
function(destination, source, pos){
2929 afterAjax:
function() {
2939 <ul
class=
"simpleTree">
2940 <li
class=
"root" id=
'1'><span>{$sRootCaptionC}</span>
2946 <div
class=
"clear_both"></div>
2947 <!-- <div
id=
"cat_manage_div"></div>
2948 <div
class=
"clear_both"></div> -->
2951 if (
ch_get(
'mode') ==
'json') {
2955 $sResult = $this->_oTemplate->parseHtmlByName(
'default_margin.html', array(
'content' => $sJS .
$sResult));
2957 return $GLOBALS[
'oFunctions']->popupBox(
'ads_category_manager',
_t(
'_ch_ads_category_manager'),
$sResult);
2962 if ($this->bAdminMode) {
2964 if (
ch_get(
'action_approve') && is_array(
ch_get(
'ads'))) {
2965 foreach (
ch_get(
'ads')
as $iAdID) {
2966 if ($this->_oDb->setPostStatus((
int)$iAdID,
'active')) {
2969 } elseif (
ch_get(
'action_disapprove') && is_array(
ch_get(
'ads'))) {
2970 foreach (
ch_get(
'ads')
as $iAdID) {
2971 $this->_oDb->setPostStatus((
int)$iAdID);
2973 } elseif (
ch_get(
'action_delete') && is_array(
ch_get(
'ads'))) {
2974 foreach (
ch_get(
'ads')
as $iAdID) {
2979 $sCap2C =
_t(
'_ch_ads_Moderating');
2980 $sAct =
_t(
"_ch_ads_Activate");
2981 $sWholesaleC =
_t(
"_ch_ads_wholesale");
2983 $sActivateAdvWholesale = <<<EOF
2984 <h2>{$sCap2C} ( <
a href=\
"{$this->sCurrBrowsedFile}?ActivateAdvWholesale=1\">{$sAct} {$sWholesaleC}</a> )</h2>
2987 require_once($this->_oConfig->getClassPath() . 'ChAdsSearchUnit.php');
2988 $oTmpAdsSearch = new ChAdsSearchUnit();
2989 $oTmpAdsSearch->aCurrent['paginate']['perPage'] = 10;
2990 $oTmpAdsSearch->aCurrent['sorting'] = 'last';
2991 $oTmpAdsSearch->aCurrent['restriction']['activeStatus']['value'] = 'new';
2992 $oTmpAdsSearch->bShowCheckboxes = true;
2993 $sAdminSideAds = $oTmpAdsSearch->displayResultBlock();
2994 $sAdminSideAds = ($oTmpAdsSearch->aCurrent['paginate']['totalNum'] == 0) ? MsgBox(_t('_Empty')) : $sAdminSideAds;
2996 $sAdmPanel = $oTmpAdsSearch->showAdminActionsPanel('ads_box', array(
2997 'action_approve' => '_Approve',
2998 'action_disapprove' => '_Disapprove',
2999 'action_delete' => '_Delete'
3002 // Prepare link to pagination
3003 $sRequest = $this->sCurrBrowsedFile . '?page={page}&per_page={per_page}';
3004 // End of prepare link to pagination
3005 $oTmpAdsSearch->aCurrent['paginate']['page_url'] = $sRequest;
3006 $sPostPagination = $oTmpAdsSearch->showPagination();
3008 $sPostsBox = $sAdminSideAds . '<div class="clear_both
"></div>' . $sPostPagination;
3021 function GenReportSubmitForm($iCommentID)
3024 $iClsID = (int)ch_get('clsID');
3025 $sMessageC = _t("_Message text
");
3027 $sCurrBrowsedFile = $this->sHomeUrl . 'classifieds.php';
3030 <div class="mediaInfo
">
3032 <input type="hidden
" name="commentID
" value="{$iCommentID}
" />
3033 <input type="hidden
" name="clsID
" value="{$iClsID}
" />
3034 <input type="hidden
" name="action
" value="post_report
" />
3035 <div>{$sMessageC}</div>
3036 <div><textarea cols="30
" rows="10
" name="messageText
"></textarea></div>
3038 <input type="submit
" size="15
" name="send
" value="Send
" />
3039 <input type="reset
" size="15
" name="send
" value="Reset
" />
3047 function ActionReportSubmit()
3051 $iClsID = (int)ch_get('clsID');
3052 $iCommID = (int)ch_get('commentID');
3053 $aUser = getProfileInfo($this->_iVisitorID);
3055 $sMailHeader = "From: {
$site[
'title']} <{
$site[
'email_notify']}>
";
3056 $sMailParameters = "-f{
$site[
'email_notify']}
";
3058 $sMessage = process_db_input(ch_get('messageText'), CH_TAGS_VALIDATE);
3060 $sMailHeader = "MIME-
Version: 1.0\r\n
" . "Content-
type: text/html;
charset=UTF-8\r\n
" . $sMailHeader;
3061 $sMailSubject = $aUser['NickName'] . ' bad comment report';
3063 $sGenUrl = $this->genUrl($iClsID, '', 'entry', true);
3065 $sMailBody = "Hello,\n
3066 {
$aUser[
'NickName']} bad classified
comment (comm num {$iCommID}): <
a href=\
"{$sGenUrl}\">See it</a>\n
3070 $sMail =
$site[
'email_notify'];
3072 if (
sendMail($sMail, sMailSubject, nl2br($sMailBody),
'',
'',
'html')) {
3073 $sCode =
'<div class="mediaInfo">' .
_t(
"_File info was sent") .
'</div>';
3087 $sSiteUrl = CH_WSB_URL_ROOT;
3089 $sSafeTag = addslashes(trim(strtolower($sTag)));
3090 $sTagResultC =
_t(
'_ch_ads_search_results_by_tag');
3091 $sBrowseAllAds =
_t(
'_ch_ads_Browse_All_Ads');
3095 $sBreadCrumbs = <<<EOF
3096 <
a href=
"{$sHomeLink}">{$sBrowseAllAds}</
a> / {$sTagResultC} - {$sSafeTag}
3099 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
3101 if ($iRandLim > 0) {
3102 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = (int)$iRandLim;
3104 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
3106 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
3107 $oTmpAdsSearch->aCurrent[
'restriction'][
'tag'][
'value'] = $sSafeTag;
3109 $sAdsByTags = $oTmpAdsSearch->displayResultBlock();
3110 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
3111 $sAdsByTags =
MsgBox(
_t(
'_Empty'));
3115 if ($this->bUseFriendlyLinks ==
false) {
3116 $sRequest = $this->sHomeUrl .
"classifieds_tags.php?tag={$sSafeTagS}&page={page}&per_page={per_page}";
3118 $sRequest = CH_WSB_URL_ROOT .
"ads/tag/{$sSafeTagS}/{per_page}/{page}";
3121 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
3122 $sAdsByTags .= $oTmpAdsSearch->showPagination();
3130 $aDateParams = array();
3133 $aDateParams = explode(
'/', $sDate);
3136 require_once($this->_oConfig->getClassPath() .
'ChAdsCalendar.php');
3137 $oCalendar =
new ChAdsCalendar((
int)$aDateParams[0], (
int)$aDateParams[1], $this);
3138 $sAdsCalendar = $oCalendar->display();
3148 $aDate = explode(
'/', $sDate);
3150 $iValue1 = (int)
$aDate[0];
3151 $iValue2 = (int)
$aDate[1];
3152 $iValue3 = (int)
$aDate[2];
3154 if ($iValue1 > 0 && $iValue2 > 0 && $iValue3 > 0) {
3159 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
3161 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
3162 $oTmpAdsSearch->aCurrent[
'restriction'][
'calendar-min'] = array(
3163 'value' =>
"UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 00:00:00')",
3164 'field' =>
'DateTime',
3166 'no_quote_value' =>
true
3168 $oTmpAdsSearch->aCurrent[
'restriction'][
'calendar-max'] = array(
3169 'value' =>
"UNIX_TIMESTAMP('{$iValue1}-{$iValue2}-{$iValue3} 23:59:59')",
3170 'field' =>
'DateTime',
3172 'no_quote_value' =>
true
3174 $sLastAds = $oTmpAdsSearch->displayResultBlock();
3175 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] == 0) {
3178 $oTmpAdsSearch->aCurrent[
'paginate'][
'page_url'] = $sRequest;
3179 $sLastAds .= $oTmpAdsSearch->showPagination();
3182 $sRetHtmlVal = <<<EOF
3183 <div
class=
"dbContent">
3194 $iMediaID = (int)
ch_get(
'dimg');
3199 if (!($iEditAdvertisementID = (
int)
ch_get(
'EditPostID'))) {
3203 if (!($iAdvOwner = $this->_oDb->getOwnerOfAd($iEditAdvertisementID))) {
3208 return MsgBox(
_t(
'_Access denied'));
3212 $aAdvData = $this->_oDb->getAdInfo($iEditAdvertisementID);
3213 $sMediaIDs = $aAdvData[
'Media'];
3219 $aChunks = explode(
',', $sMediaIDs);
3222 $aNewMediaIDs = array();
3223 foreach ($aChunks
as $iMedId) {
3224 if ($iMedId != $iMediaID) {
3225 $aNewMediaIDs[] = $iMedId;
3230 $sNewMedia = implode(
",", $aNewMediaIDs);
3233 if ($this->_oDb->updatePostMedia($iEditAdvertisementID, $sNewMedia)) {
3235 $sMediaFileName = $this->_oDb->getMediaFile($iMediaID);
3236 if ($sMediaFileName !=
'') {
3237 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'img_' . $sMediaFileName);
3238 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'thumb_' . $sMediaFileName);
3239 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'big_thumb_' . $sMediaFileName);
3240 @unlink(CH_DIRECTORY_PATH_ROOT . $this->sUploadDir .
'icon_' . $sMediaFileName);
3243 if ($this->_oDb->deleteMedia($iMediaID)) {
3244 return MsgBox(
_t(
'_ch_ads_img_succ_deleted'));
3248 return MsgBox(
_t(
'_Error Occured'));
3256 if (!$aReadyMedia) {
3262 foreach ($aReadyMedia
as $sMedId) {
3263 $iMedId = (int)$sMedId;
3264 if (!is_numeric($iMedId) || !$iMedId) {
3268 $aSqlRes = $this->_oDb->getMediaInfo($iMedId);
3274 'icon_url' => CH_WSB_URL_ROOT . $this->sUploadDir .
'icon_' . $aSqlRes[
'MediaFile'],
3275 'image_url' => CH_WSB_URL_ROOT . $this->sUploadDir .
'img_' . $aSqlRes[
'MediaFile'],
3284 return $GLOBALS[
'oFunctions']->genGalleryImages($aImages);
3297 'orderby' =>
'popular'
3299 $oTags =
new ChTemplTagsModule($aParam,
_t(
'_all'), CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'tags');
3301 return $oTags->getCode();
3307 $sEntryUri = $this->_oDb->getAdUriByID($iEntryId);
3310 if ($this->bUseFriendlyLinks) {
3311 $sUrl = CH_WSB_URL_ROOT .
"ads/{$sType}/{$sEntryUri}";
3316 $sUrl =
"{$this->sCurrBrowsedFile}?ShowAdvertisementID={$iEntryId}";
3331 require_once($this->_oConfig->getClassPath() .
'ChAdsSearchUnit.php');
3333 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 4;
3334 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
3337 $oTmpAdsSearch->aCurrent[
'restriction'][
'allow_view'][
'value'] = $this->_iVisitorID ? array(
3342 $sPostPagination =
'';
3343 $sAllAds = $oTmpAdsSearch->displayResultBlock();
3344 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] > 0) {
3345 $sPostPagination = $oTmpAdsSearch->showPagination2();
3347 $aMenu = $oTmpAdsSearch->displayMenu();
3349 return array($sAllAds,
$aMenu[0], $sPostPagination);
3362 $GLOBALS[
'oTopMenu']->setCurrentProfileID($_iProfileID);
3364 ch_import(
'SearchUnit', $this->_aModule);
3366 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 10;
3367 $oTmpAdsSearch->aCurrent[
'sorting'] =
'last';
3368 $oTmpAdsSearch->aCurrent[
'restriction'][
'owner'][
'value'] = $_iProfileID;
3369 $sMemberAds = $oTmpAdsSearch->displayResultBlock();
3371 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] > 0) {
3372 $sClr =
'<div class="clear_both"></div>';
3373 if ($oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] < $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum']) {
3374 $sAjLink = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'get_list/';
3376 $sBoxId =
'ads_' . $_iProfileID .
'_view';
3378 'page_url' =>
'javascript:void();',
3379 'count' => $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'],
3380 'per_page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'],
3381 'page' => $oTmpAdsSearch->aCurrent[
'paginate'][
'page'],
3382 'on_change_page' =>
"getHtmlData('$sBoxId', '{$sAjLink}view/{$_iProfileID}&page={page}&per_page={per_page}');",
3383 'on_change_per_page' =>
"getHtmlData('$sBoxId', '{$sAjLink}view/{$_iProfileID}&page=1&per_page=' + this.value);"
3385 $sMemberAds =
'<div id="' . $sBoxId .
'">' . $sMemberAds . $sClr . $oPgn->getPaginate() .
'</div>';
3389 <div
class=
"clear_both"></div>
3390 <div
class=
"dbContent">
3407 $iPID = (int)
ch_get(
'pid');
3408 $aRssUnits = $this->_oDb->getMemberAdsRSS($iPID);
3409 if (is_array($aRssUnits) && count($aRssUnits) > 0) {
3411 foreach ($aRssUnits
as $iUnitID => $aUnitInfo) {
3412 $iPostID = (int)$aUnitInfo[
'UnitID'];
3413 $sPostLink = $this->
genUrl($iPostID, $aUnitInfo[
'UnitUri']);
3415 $aRssUnits[$iUnitID][
'UnitLink'] = $sPostLink;
3416 $aRssUnits[$iUnitID][
'UnitIcon'] = $this->
getAdCover($aUnitInfo[
'UnitIcon'],
'big_thumb');
3419 $sUnitTitleC =
_t(
'_ch_ads_Ads');
3420 $sMainLink =
'modules/cheetah/ads/classifieds.php';
3424 $oRssFactory->SetRssHeader();
3426 echo $oRssFactory->GenRssByData($aRssUnits, $sUnitTitleC, $sMainLink);
3437 return $this->_oTemplate->addCss(array(
'ads.css',
'twig.css'), $bText);
3448 $this->bAdminMode =
true;
3462 'handlers' => array(
3464 'alert_unit' =>
'ads',
3465 'alert_action' =>
'create',
3466 'module_uri' =>
'ads',
3467 'module_class' =>
'Module',
3468 'module_method' =>
'get_spy_post'
3471 'alert_unit' =>
'ads',
3472 'alert_action' =>
'rate',
3473 'module_uri' =>
'ads',
3474 'module_class' =>
'Module',
3475 'module_method' =>
'get_spy_post'
3478 'alert_unit' =>
'ads',
3479 'alert_action' =>
'commentPost',
3480 'module_uri' =>
'ads',
3481 'module_class' =>
'Module',
3482 'module_method' =>
'get_spy_post'
3486 array(
'unit' =>
'ads',
'action' =>
'create'),
3487 array(
'unit' =>
'ads',
'action' =>
'rate'),
3488 array(
'unit' =>
'ads',
'action' =>
'delete'),
3489 array(
'unit' =>
'ads',
'action' =>
'commentPost'),
3490 array(
'unit' =>
'ads',
'action' =>
'commentRemoved')
3508 $aPostInfo = $this->_oDb->getAdInfo($iObjectId);
3509 if (!$aPostInfo[
'IDProfile']) {
3513 $sRecipientNickName =
getNickName($aPostInfo[
'IDProfile']);
3514 $sRecipientProfileLink =
getProfileLink($aPostInfo[
'IDProfile']);
3515 $sSenderNickName = $iSenderId ?
getNickName($iSenderId) :
_t(
'_Guest');
3516 $sSenderProfileLink = $iSenderId ?
getProfileLink($iSenderId) :
'javascript:void(0)';
3518 $sEntryUrl = $this->
genUrl($iObjectId, $aPostInfo[
'EntryUri'],
'entry');
3524 $sLangKey =
'_ch_ads_added_spy';
3529 $sLangKey =
'_ch_ads_rated_spy';
3530 $iRecipientId = $aPostInfo[
'OwnerID'];
3533 case 'commentPost' :
3534 $sLangKey =
'_ch_ads_commented_spy';
3535 $iRecipientId = $aPostInfo[
'OwnerID'];
3540 'lang_key' => $sLangKey,
3542 'recipient_p_link' => $sRecipientProfileLink,
3543 'recipient_p_nick' => $sRecipientNickName,
3544 'profile_nick' => $sSenderNickName,
3545 'profile_link' => $sSenderProfileLink,
3546 'ads_url' => $sEntryUrl,
3549 'recipient_id' => $iRecipientId,
3550 'spy_type' =>
'content_activity',
3556 $sUri = $this->_oConfig->getUri();
3559 'handlers' => array(
3561 'alert_unit' => $sUri,
3562 'alert_action' =>
'create',
3563 'module_uri' => $sUri,
3564 'module_class' =>
'Module',
3565 'module_method' =>
'get_wall_post',
3572 'alert_unit' => $sUri,
3573 'alert_action' =>
'comment_add',
3574 'module_uri' => $sUri,
3575 'module_class' =>
'Module',
3576 'module_method' =>
'get_wall_add_comment',
3585 'alert_unit' => $sUri,
3586 'alert_action' =>
'commentPost',
3587 'module_uri' => $sUri,
3588 'module_class' =>
'Module',
3589 'module_method' =>
'get_wall_post_comment',
3597 array(
'unit' => $sUri,
'action' =>
'create')
3604 $aObjectIds = strpos($aEvent[
'object_id'],
',') !==
false ? explode(
',',
3605 $aEvent[
'object_id']) : array($aEvent[
'object_id']);
3610 foreach ($aObjectIds
as $iId) {
3611 $aItem = $this->_oDb->getAdInfo(
$iId);
3612 if (
empty($aItem)) {
3615 if ($aItem[
'Status'] ==
'active' && $this->oPrivacy->check(
'view', $aItem[
'ID'], $this->_iVisitorID)) {
3621 if ($iDeleted == count($aObjectIds)) {
3622 return array(
'perform_delete' =>
true);
3626 if(!
empty($aEvent[
'owner_id']))
3627 $iOwner = (int)$aEvent[
'owner_id'];
3630 if(!
empty($aEvent[
'date']))
3631 $iDate = (
int)$aEvent[
'date'];
3633 $bItems = !
empty($aItems) && is_array($aItems);
3634 if($iOwner == 0 && $bItems && !
empty($aItems[0][
'OwnerID']))
3635 $iOwner = (int)$aItems[0][
'OwnerID'];
3637 if(
$iDate == 0 && $bItems && !
empty($aItems[0][
'DateTime_UTS']))
3638 $iDate = (
int)$aItems[0][
'DateTime_UTS'];
3640 if($iOwner == 0 ||
empty($aItems))
3644 $sNoPhoto = $this->_oTemplate->getIconUrl(
'no-photo.png');
3645 if ($aEvent[
'js_mode']) {
3646 $sCss = $this->_oTemplate->addCss(
'wall_post.css',
true);
3648 $this->_oTemplate->addCss(
'wall_post.css');
3651 $iItems = count($aItems);
3657 $aItems = array_slice($aItems, 0, 4);
3660 $aTmplItems = array();
3661 foreach ($aItems
as $aItem) {
3662 $aTmplItems[] = array(
3663 'unit' => $this->
getUnit($aItem[
'ID']),
3668 'owner_id' => $iOwner,
3669 'title' =>
_t(
'_ch_ads_wall_added_new_title_items', $sOwner, $iItems),
3670 'description' =>
'',
3671 'content' => $sCss . $this->_oTemplate->parseHtmlByName(
'wall_post_grouped.html', array(
3672 'cpt_user_name' => $sOwner,
3673 'cpt_added_new' =>
_t(
'_ch_ads_wall_added_new_items', $iItems),
3674 'ch_repeat:items' => $aTmplItems,
3675 'post_id' => $aEvent[
'id']
3682 $aItem = $aItems[0];
3683 $aItem[
'url'] = $this->
genUrl($aItem[
'ID'], $aItem[
'EntryUri'],
'entry');
3685 $sPostTxt =
_t(
'_ch_ads_wall_object');
3688 'owner_id' => $iOwner,
3689 'title' =>
_t(
'_ch_ads_wall_added_new_title', $sOwner, $sPostTxt),
3690 'description' =>
_t(
'_ch_ads_wall_added_new_title', $sOwner, $sPostTxt),
3691 'content' => $sCss . $this->_oTemplate->parseHtmlByName(
'wall_post.html', array(
3692 'cpt_user_name' => $sOwner,
3693 'cpt_added_new' =>
_t(
'_ch_ads_wall_added_new'),
3694 'cpt_object' => $sPostTxt,
3695 'cpt_item_url' => $aItem[
'url'],
3696 'unit' => $this->
getUnit($aItem[
'ID']),
3697 'post_id' => $aEvent[
'id'],
3705 $iId = (int)$aEvent[
'object_id'];
3706 $iOwner = (int)$aEvent[
'owner_id'];
3707 $sOwner = $iOwner != 0 ?
getNickName($iOwner) :
_t(
'_Anonymous');
3709 $aContent = unserialize($aEvent[
'content']);
3710 if (
empty($aContent) ||
empty($aContent[
'object_id'])) {
3714 $iItem = (int)$aContent[
'object_id'];
3715 $aItem = $this->_oDb->getAdInfo($iItem);
3716 if (
empty($aItem) || !is_array($aItem)) {
3717 return array(
'perform_delete' =>
true);
3720 if (!$this->oPrivacy->check(
'view', $iItem, $this->_iVisitorID)) {
3725 $oCmts =
new ChAdsCmts($this->_oConfig->getCommentSystemName(), $iItem);
3726 if (!$oCmts->isEnabled()) {
3730 $aComment = $oCmts->getCommentRow(
$iId);
3731 if(
empty($aComment) || !is_array($aComment))
3732 return array(
'perform_delete' =>
true);
3735 if ($aEvent[
'js_mode']) {
3736 $sCss = $this->_oTemplate->addCss(
'wall_post.css',
true);
3738 $this->_oTemplate->addCss(
'wall_post.css');
3741 $aItem[
'url'] = $this->
genUrl($aItem[
'ID'], $aItem[
'EntryUri'],
'entry');
3743 $sTextWallObject =
_t(
'_ch_ads_wall_object');
3746 'title' =>
_t(
'_ch_ads_wall_added_new_title_comment', $sOwner, $sTextWallObject),
3747 'description' => $aComment[
'cmt_text'],
3748 'content' => $sCss . $this->_oTemplate->parseHtmlByName(
'wall_post_comment.html', array(
3749 'cpt_user_name' => $sOwner,
3750 'cpt_added_new' =>
_t(
'_ch_ads_wall_added_new_comment'),
3751 'cpt_object' => $sTextWallObject,
3752 'cpt_item_url' => $aItem[
'url'],
3753 'cnt_comment_text' => $aComment[
'cmt_text'],
3754 'unit' => $this->
getUnit($aItem[
'ID']),
3755 'post_id' => $aEvent[
'id'],
3765 $iId = (int)$aEvent[
'object_id'];
3766 $iOwner = (int)$aEvent[
'owner_id'];
3769 $aItem = $this->_oDb->getAdInfo(
$iId);
3770 if (
empty($aItem) || !is_array($aItem)) {
3771 return array(
'perform_delete' =>
true);
3774 if (!$this->oPrivacy->check(
'view',
$iId, $this->_iVisitorID)) {
3778 $aContent = unserialize($aEvent[
'content']);
3779 if (
empty($aContent) || !isset($aContent[
'comment_id'])) {
3784 $oCmts =
new ChAdsCmts($this->_oConfig->getCommentSystemName(),
$iId);
3785 if (!$oCmts->isEnabled()) {
3789 $aItem[
'url'] = $this->
genUrl($aItem[
'ID'], $aItem[
'EntryUri'],
'entry');
3790 $aComment = $oCmts->getCommentRow((
int)$aContent[
'comment_id']);
3791 if(
empty($aComment) || !is_array($aComment))
3792 return array(
'perform_delete' =>
true);
3795 if ($aEvent[
'js_mode']) {
3796 $sCss = $this->_oTemplate->addCss(
'wall_post.css',
true);
3798 $this->_oTemplate->addCss(
'wall_post.css');
3801 $sTextWallObject =
_t(
'_ch_ads_wall_object');
3804 'title' =>
_t(
'_ch_ads_wall_added_new_title_comment', $sOwner, $sTextWallObject),
3805 'description' => $aComment[
'cmt_text'],
3806 'content' => $sCss . $this->_oTemplate->parseHtmlByName(
'wall_post_comment.html', array(
3807 'cpt_user_name' => $sOwner,
3808 'cpt_added_new' =>
_t(
'_ch_ads_wall_added_new_comment'),
3809 'cpt_object' => $sTextWallObject,
3810 'cpt_item_url' => $aItem[
'url'],
3811 'cnt_comment_text' => $aComment[
'cmt_text'],
3812 'unit' => $this->
getUnit($aItem[
'ID']),
3813 'post_id' => $aEvent[
'id'],
3820 $sPrefix =
'ch_' . $this->_oConfig->getUri();
3826 $aObjectIds = strpos($aEvent[
'object_id'],
',') !==
false ? explode(
',',
3827 $aEvent[
'object_id']) : array($aEvent[
'object_id']);
3830 $iItems = count($aObjectIds);
3832 if ($iItems > $iItemsLimit) {
3833 $aObjectIds = array_slice($aObjectIds, 0, $iItemsLimit);
3837 $aContent = array();
3838 if (!
empty($aEvent[
'content'])) {
3839 $aContent = unserialize($aEvent[
'content']);
3842 if (!isset($aContent[
'idims'])) {
3843 $aContent[
'idims'] = array();
3847 $aItems = $aTmplItems = array();
3848 foreach ($aObjectIds
as $iId) {
3849 $aItem = $this->_oDb->getAdInfo(
$iId);
3850 if (
empty($aItem)) {
3853 if ($aItem[
'Status'] ==
'active' && $this->oPrivacy->check(
'view', $aItem[
'ID'], $this->_iVisitorID)) {
3854 $aItem[
'thumb_file'] = $this->
getAdCover($aItem[
'Media'],
'big_thumb');
3855 $aItem[
'thumb_file_path'] = $this->
getAdCoverPath($aItem[
'Media'],
'big_thumb');
3856 $sPath = file_exists($aItem[
'thumb_file_path']) ? $aItem[
'thumb_file_path'] : $aItem[
'thumb_file'];
3858 $aItem[
'thumb_dims'] = array();
3859 if (!
empty($aItem[
'Media']) && !
empty($sPath)) {
3860 if (!isset($aContent[
'idims'][
$iId])) {
3865 $aItem[
'thumb_dims'] = $aContent[
'idims'][
$iId];
3868 $aItem[
'thumb_file_2x'] = $this->
getAdCover($aItem[
'Media'],
'img');
3869 if (
empty($aItem[
'thumb_file_2x'])) {
3870 $aItem[
'thumb_file_2x'] = $aItem[
'thumb_file'];
3873 $aItem[
'thumb_file_2x_path'] = $this->
getAdCoverPath($aItem[
'Media'],
'img');
3874 if (
empty($aItem[
'thumb_file_2x_path'])) {
3875 $aItem[
'thumb_file_2x_path'] = $aItem[
'thumb_file_path'];
3878 $aItem[
'EntryUri'] = $this->
genUrl($aItem[
'ID'], $aItem[
'EntryUri'],
'entry');
3881 $aTmplItems[] = array(
3882 'mod_prefix' => $sPrefix,
3883 'item_width' => isset($aItem[
'thumb_dims'][
'w']) ? $aItem[
'thumb_dims'][
'w'] : $this->iThumbSize,
3884 'item_height' => isset($aItem[
'thumb_dims'][
'h']) ? $aItem[
'thumb_dims'][
'h'] : $this->iThumbSize,
3885 'item_icon' => $aItem[
'thumb_file'],
3886 'item_icon_2x' => $aItem[
'thumb_file_2x'],
3887 'item_page' => $aItem[
'EntryUri'],
3888 'item_title' => $aItem[
'Subject']
3894 if ($iDeleted == count($aObjectIds)) {
3895 return array(
'perform_delete' =>
true);
3898 if (
empty($aItems)) {
3904 $aResult[
'save'][
'content'] = serialize($aContent);
3908 if ($aEvent[
'js_mode']) {
3909 $sCss = $this->_oTemplate->addCss(array(
'wall_outline.css'),
true);
3911 $this->_oTemplate->addCss(array(
'wall_outline.css'));
3914 $iItems = count($aItems);
3915 $iOwner = (int)$aEvent[
'owner_id'];
3920 $iItems = count($aItems);
3922 $sTmplName =
'wall_outline_grouped.html';
3923 $aResult[
'content'] = $sCss . $this->_oTemplate->parseHtmlByName($sTmplName, array(
3924 'mod_prefix' => $sPrefix,
3925 'mod_icon' =>
'money',
3926 'user_name' => $sOwner,
3927 'user_link' => $sOwnerLink,
3928 'ch_repeat:items' => $aTmplItems,
3929 'item_comments' => 0 ?
_t(
'_wall_n_comments', 0) :
_t(
'_wall_no_comments'),
3930 'item_comments_link' =>
'',
3931 'post_id' => $aEvent[
'id'],
3932 'post_ago' => $aEvent[
'ago']
3939 $aItem = $aItems[0];
3940 $aTmplItem = $aTmplItems[0];
3942 $sTmplName =
'modules/cheetah/wall/|outline_item_image.html';
3943 $aResult[
'content'] = $sCss . $this->_oTemplate->parseHtmlByName($sTmplName, array_merge($aTmplItem, array(
3944 'mod_prefix' => $sPrefix,
3945 'mod_icon' =>
'money',
3946 'user_name' => $sOwner,
3947 'user_link' => $sOwnerLink,
3948 'item_page' => $aItem[
'EntryUri'],
3949 'item_title' => $aItem[
'Subject'],
3951 'item_comments' => (
int)$aItem[
'CommentsCount'] > 0 ?
_t(
'_wall_n_comments',
3952 $aItem[
'CommentsCount']) :
_t(
'_wall_no_comments'),
3953 'item_comments_link' => $aItem[
'EntryUri'] .
'#cmta-' . $this->_oConfig->getUri() .
'-' . $aItem[
'ID'],
3954 'post_id' => $aEvent[
'id'],
3955 'post_ago' => $aEvent[
'ago']
3963 ch_import(
'SearchUnit', $this->_aModule);
3965 if ($sUnitTemplate) {
3966 $oTmpAdsSearch->sSelectedUnit = $sUnitTemplate;
3968 $oTmpAdsSearch->aCurrent[
'paginate'][
'forcePage'] = 1;
3969 $oTmpAdsSearch->aCurrent[
'paginate'][
'perPage'] = 1;
3970 $oTmpAdsSearch->aCurrent[
'restriction'][
'id'][
'value'] = (int)
$iId;
3971 $s = $oTmpAdsSearch->displayResultBlock(
false);
3973 return $oTmpAdsSearch->aCurrent[
'paginate'][
'totalNum'] > 0 ?
$s :
'';
3978 return $this->
getUnit($aEntryData[
'ID'],
'wall_outline_extra_info');