| 1 | <?
|
|---|
| 2 |
|
|---|
| 3 | /***************************************************************************
|
|---|
| 4 | * Dolphin Smart Community Builder
|
|---|
| 5 | * -------------------
|
|---|
| 6 | * begin : Mon Mar 23 2006
|
|---|
| 7 | * copyright : (C) 2007 BoonEx Group
|
|---|
| 8 | * website : http://www.boonex.com
|
|---|
| 9 | * This file is part of Dolphin - Smart Community Builder
|
|---|
| 10 | *
|
|---|
| 11 | * Dolphin is free software; you can redistribute it and/or modify it under
|
|---|
| 12 | * the terms of the GNU General Public License as published by the
|
|---|
| 13 | * Free Software Foundation; either version 2 of the
|
|---|
| 14 | * License, or any later version.
|
|---|
| 15 | *
|
|---|
| 16 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|---|
| 17 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 18 | * See the GNU General Public License for more details.
|
|---|
| 19 | * You should have received a copy of the GNU General Public License along with Dolphin,
|
|---|
| 20 | * see license.txt file; if not, write to marketing@boonex.com
|
|---|
| 21 | ***************************************************************************/
|
|---|
| 22 |
|
|---|
| 23 | require_once( 'inc/header.inc.php' );
|
|---|
| 24 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
|
|---|
| 25 | require_once( BX_DIRECTORY_PATH_INC . 'admin.inc.php' );
|
|---|
| 26 |
|
|---|
| 27 | require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolClassifieds.php' );
|
|---|
| 28 |
|
|---|
| 29 | // --------------- page variables and login
|
|---|
| 30 | $_page['name_index'] = 151;
|
|---|
| 31 | $_page['css_name'] = 'classifieds_view.css';
|
|---|
| 32 | $_page['extra_js'] = $oTemplConfig -> sTinyMceEditorJS;
|
|---|
| 33 |
|
|---|
| 34 | check_logged();
|
|---|
| 35 |
|
|---|
| 36 | $oClassifieds = new BxDolClassifieds();
|
|---|
| 37 |
|
|---|
| 38 | $_page['header'] = $oClassifieds -> GetHeaderString();//_t( "_CLASSIFIEDS_VIEW_H" );
|
|---|
| 39 | $_page['header_text'] = $oClassifieds -> GetHeaderString();
|
|---|
| 40 |
|
|---|
| 41 | $_ni = $_page['name_index'];
|
|---|
| 42 | $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
|
|---|
| 43 |
|
|---|
| 44 | PageCode();
|
|---|
| 45 |
|
|---|
| 46 | /**
|
|---|
| 47 | * Generating Main page code
|
|---|
| 48 | *
|
|---|
| 49 | * @return ALL presentation of data
|
|---|
| 50 | */
|
|---|
| 51 | function PageCompPageMainCode() {
|
|---|
| 52 | $sRetHtml = '';
|
|---|
| 53 | global $oClassifieds;
|
|---|
| 54 |
|
|---|
| 55 | $oAPV = new BxDolAdPageView($oClassifieds);
|
|---|
| 56 |
|
|---|
| 57 | $oClassifieds -> sCurrBrowsedFile = $_SERVER['PHP_SELF'];
|
|---|
| 58 | $sRetHtml .= $oClassifieds -> PrintCommandForms();
|
|---|
| 59 |
|
|---|
| 60 | if ($_REQUEST) {
|
|---|
| 61 | //print functions
|
|---|
| 62 | if (isset($_REQUEST['action'])) {
|
|---|
| 63 | if ((int)$_REQUEST['action']==3) {
|
|---|
| 64 | $sRetHtml .= $oClassifieds -> PrintFilterForm();
|
|---|
| 65 | $sRetHtml .= $oClassifieds -> PrintFilteredAllAdvertisements();
|
|---|
| 66 | }
|
|---|
| 67 | elseif ((int)$_REQUEST['action']==2) {
|
|---|
| 68 | $iClassifiedSubID = (int)$_REQUEST['FilterSubCat'];
|
|---|
| 69 | //$iClassifiedSubID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `ClassifiedsSubs` WHERE `ÑEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['FilterCat']) . "' LIMIT 1") : (int)$_REQUEST['FilterSubCat'];
|
|---|
| 70 | $sRetHtml .= $oClassifieds -> PrintSubRecords($iClassifiedSubID, TRUE);
|
|---|
| 71 | }
|
|---|
| 72 | elseif ((int)$_REQUEST['action']==1) {
|
|---|
| 73 | $iClassifiedID = (int)$_REQUEST['FilterCat'];
|
|---|
| 74 | //$iClassifiedID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `Classifieds` WHERE `SEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['SEntryUri']) . "' LIMIT 1") : (int)$_REQUEST['FilterCat'];
|
|---|
| 75 | $sRetHtml .= $oClassifieds -> PrintAllSubRecords($iClassifiedID);
|
|---|
| 76 | }
|
|---|
| 77 | elseif ($_REQUEST['action']=='report') {
|
|---|
| 78 | $iCommentID = (int)$_REQUEST['commentID'];
|
|---|
| 79 | print $oClassifieds -> GenReportSubmitForm($iCommentID);
|
|---|
| 80 | exit();
|
|---|
| 81 | }
|
|---|
| 82 | elseif ($_REQUEST['action']=='post_report') {
|
|---|
| 83 | print $oClassifieds->ActionReportSubmit();
|
|---|
| 84 | exit();
|
|---|
| 85 | }
|
|---|
| 86 | }
|
|---|
| 87 | elseif ((isset($_GET['bClassifiedID']) AND (int)$_GET['bClassifiedID'] > 0) OR (isset($_GET['catUri']) && $_GET['catUri']!='')) {
|
|---|
| 88 | //$iClassifiedID = (int)$_GET['bClassifiedID'];
|
|---|
| 89 | $iClassifiedID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `Classifieds` WHERE `CEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['catUri']) . "' LIMIT 1") : (int)$_REQUEST['bClassifiedID'];
|
|---|
| 90 | if ($iClassifiedID > 0) {
|
|---|
| 91 | $sRetHtml .= $oClassifieds -> PrintFilterForm($iClassifiedID);
|
|---|
| 92 | $sRetHtml .= $oClassifieds -> PrintAllSubRecords($iClassifiedID);
|
|---|
| 93 | }
|
|---|
| 94 | }
|
|---|
| 95 | elseif ((isset($_GET['bSubClassifiedID']) AND (int)$_GET['bSubClassifiedID'] > 0) OR (isset($_GET['scatUri']) && $_GET['scatUri']!='')) {
|
|---|
| 96 | //$iSubClassifiedID = (int)$_GET['bSubClassifiedID'];
|
|---|
| 97 | $iSubClassifiedID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `ClassifiedsSubs` WHERE `SEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['scatUri']) . "' LIMIT 1") : (int)$_REQUEST['bSubClassifiedID'];
|
|---|
| 98 | if ($iSubClassifiedID > 0) {
|
|---|
| 99 | $sRetHtml .= $oClassifieds -> PrintFilterForm(0, $iSubClassifiedID);
|
|---|
| 100 | $sRetHtml .= $oClassifieds -> PrintSubRecords($iSubClassifiedID, TRUE);
|
|---|
| 101 | }
|
|---|
| 102 | }
|
|---|
| 103 | elseif ((isset($_REQUEST['ShowAdvertisementID']) && (int)$_REQUEST['ShowAdvertisementID']>0) OR (isset($_GET['entryUri']) && $_GET['entryUri']!='')) {
|
|---|
| 104 | //$id = (int)$_REQUEST['ShowAdvertisementID'];
|
|---|
| 105 | $id = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `ClassifiedsAdvertisements` WHERE `EntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['entryUri']) . "' LIMIT 1") : (int)$_REQUEST['ShowAdvertisementID'];
|
|---|
| 106 | /*$sRetHtml .=*/ $oClassifieds -> ActionPrintAdvertisement($id);
|
|---|
| 107 | $sRetHtml .= $oAPV -> getCode();
|
|---|
| 108 | }
|
|---|
| 109 | elseif (isset($_GET['SearchForm'])) {
|
|---|
| 110 | if (((int)$_GET['SearchForm']) == 1) {
|
|---|
| 111 | $sRetHtml .= $oClassifieds -> PrintFilterForm();
|
|---|
| 112 | }
|
|---|
| 113 | }
|
|---|
| 114 | elseif (isset($_REQUEST['UsersOtherListing'])) {
|
|---|
| 115 | $iProfileID = (int)$_REQUEST['IDProfile'];
|
|---|
| 116 | if ($iProfileID > -1) {
|
|---|
| 117 | $sRetHtml .= $oClassifieds -> PrintMyAds($iProfileID);
|
|---|
| 118 | }
|
|---|
| 119 | }
|
|---|
| 120 | //non safe functions
|
|---|
| 121 | elseif (isset($_REQUEST['DeleteAdvertisementID'])) {
|
|---|
| 122 | $id = (int)$_REQUEST['DeleteAdvertisementID'];
|
|---|
| 123 | if ($id > 0) {
|
|---|
| 124 | $sRetHtml .= $oClassifieds -> ActionDeleteAdvertisement($id);
|
|---|
| 125 | }
|
|---|
| 126 | }
|
|---|
| 127 | elseif (isset($_REQUEST['BuyNow'])) {
|
|---|
| 128 | $advId = (int)$_REQUEST['IDAdv'];
|
|---|
| 129 | if ($advId > 0) {
|
|---|
| 130 | $sRetHtml .= $oClassifieds -> ActionBuyAdvertisement($advId);
|
|---|
| 131 | }
|
|---|
| 132 | }
|
|---|
| 133 | elseif (isset($_REQUEST['BuySendNow'])) {
|
|---|
| 134 | $advId = (int)$_REQUEST['IDAdv'];
|
|---|
| 135 | if ($advId > 0) {
|
|---|
| 136 | $sRetHtml .= $oClassifieds -> ActionBuySendMailAdvertisement($advId);
|
|---|
| 137 | }
|
|---|
| 138 | }
|
|---|
| 139 | else {
|
|---|
| 140 | $sRetHtml .= $oClassifieds -> PrintClassifieds();
|
|---|
| 141 | }
|
|---|
| 142 | }
|
|---|
| 143 | else {
|
|---|
| 144 | $sRetHtml .= $oClassifieds -> PrintClassifieds();
|
|---|
| 145 | }
|
|---|
| 146 |
|
|---|
| 147 | return $sRetHtml;
|
|---|
| 148 | }
|
|---|
| 149 | ?> |
|---|