/** * Gets the guestbook status * * @global ADONewConnection * @global array * @global array * @access private */ function _showList() { global $objDatabase, $_CONFIG, $_ARRAYLANG; $this->_objTpl->setTemplate($this->pageContent, true, true); // initialize variables $i = 1; $paging = ""; $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; /** start paging * */ $query = " SELECT id\n FROM " . DBPREFIX . "module_guestbook\n WHERE " . ($this->arrSettings['guestbook_only_lang_entries'] ? "lang_id='{$this->langId}' AND " : '') . "status = 1"; $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); $paging = getPaging($count, $pos, "§ion=GuestBook", "<b>" . $_ARRAYLANG['TXT_GUESTBOOK_ENTRIES'] . "</b>", false); /** end paging * */ $this->_objTpl->setVariable("GUESTBOOK_PAGING", $paging); $this->_objTpl->setVariable("GUESTBOOK_TOTAL_ENTRIES", $count); $query = " SELECT id,\n\t\t\t\t\t\t\t\tforename,\n\t\t\t\t\t\t\t\tname,\n gender,\n url,\n email,\n comment,\n ip,\n location,\n datetime\n FROM " . DBPREFIX . "module_guestbook\n WHERE " . ($this->arrSettings['guestbook_only_lang_entries'] ? "lang_id='{$this->langId}' AND " : '') . "status = 1\n ORDER BY id DESC"; $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); while ($objResult !== false and !$objResult->EOF) { $class = $i % 2 ? "row1" : "row2"; $gender = $objResult->fields["gender"] == "M" ? $_ARRAYLANG['guestbookGenderMale'] : $_ARRAYLANG['guestbookGenderFemale']; // N/A if ($objResult->fields['url'] != "") { $this->_objTpl->setVariable('GUESTBOOK_URL', '<a href="' . $objResult->fields['url'] . '" target="_blank"><img alt="' . $objResult->fields['url'] . '" src=".' . ASCMS_MODULE_FOLDER . '/GuestBook/View/Media/www.gif" style="vertical-align:baseline" border="0" /></a>'); } if ($objResult->fields['email'] != "") { if ($this->arrSettings['guestbook_replace_at']) { $email = $this->changeMail($objResult->fields['email']); } else { $email = $objResult->fields['email']; } $strMailTo = $this->createAsciiString('mailto:' . $email); $strMailAdress = $this->createAsciiString($email); $asciiStrGuestbookEmail = '<a href="' . $strMailTo . '"><img alt="' . $strMailAdress . '" src=".' . ASCMS_MODULE_FOLDER . '/GuestBook/View/Media/email.gif" style="vertical-align:baseline" border="0" /></a>'; $this->_objTpl->setVariable('GUESTBOOK_EMAIL', $asciiStrGuestbookEmail); } $this->_objTpl->setVariable(array('GUESTBOOK_ROWCLASS' => $class, 'GUESTBOOK_FORENAME' => htmlentities($objResult->fields["forename"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_NAME' => htmlentities($objResult->fields["name"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_GENDER' => $gender, 'GUESTBOOK_LOCATION' => htmlentities($objResult->fields["location"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_DATE' => date(ASCMS_DATE_FORMAT, strtotime($objResult->fields['datetime'])), 'GUESTBOOK_COMMENT' => nl2br($objResult->fields["comment"]), 'GUESTBOOK_ID' => $objResult->fields["id"], 'GUESTBOOK_IP' => $objResult->fields["ip"])); $this->_objTpl->parse('guestbook_row'); $i++; $objResult->MoveNext(); } $this->_objTpl->setVariable("GUESTBOOK_STATUS", $this->statusMessage); }
/** * Show current voting */ function votingShowCurrent($page_content) { global $objDatabase, $_CONFIG, $_ARRAYLANG, $_COOKIE; $paging = ''; $objTpl = new \Cx\Core\Html\Sigma('.'); \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTpl); $objTpl->setErrorHandling(PEAR_ERROR_DIE); $objTpl->setTemplate($page_content); if (!isset($_GET['vid'])) { $_GET['vid'] = ''; } if (!isset($_POST['votingemail'])) { $_POST['votingemail'] = ''; } $votingId = intval($_GET['vid']); $msg = ''; $voted = false; if ($_POST["votingoption"]) { $voteId = intval($_POST["votingoption"]); $query = "SELECT voting_system_id from " . DBPREFIX . "voting_results WHERE id=" . $voteId; $objResult = $objDatabase->SelectLimit($query, 1); if (!$objResult->EOF) { $votingId = $objResult->fields["voting_system_id"]; } $objVoting = $objDatabase->SelectLimit("SELECT submit_check FROM `" . DBPREFIX . "voting_system` WHERE `id`=" . $votingId, 1); if ($objVoting !== false && $objVoting->RecordCount() == 1) { if ($objVoting->fields['submit_check'] == 'email') { $email = contrexx_addslashes($_POST['votingemail']); $objValidator = new \FWValidator(); if ($objValidator->isEmail($email)) { if (!_alreadyVotedWithEmail($votingId, $email)) { if (($msg = VotingSubmitEmail($votingId, $voteId, $email)) === true) { $msg = ''; $voted = true; } else { $msg = $_ARRAYLANG['TXT_VOTING_NONEXISTENT_EMAIL'] . '<br /><br />'; } } else { $msg = $_ARRAYLANG['TXT_VOTING_ALREADY_VOTED'] . '<br /><br />'; } } else { $msg = $_ARRAYLANG['TXT_VOTING_INVALID_EMAIL_ERROR'] . '<br /><br />'; } } else { VotingSubmit(); $voted = true; } } } if ($_GET['vid'] != '' && $_GET['act'] != 'delete') { $query = "SELECT\n\t\t\tid, status,\n\t\t\tdate as datesec, question,\n\t\t\tvotes, submit_check,\n\t\t\tadditional_nickname, additional_forename,\n\t\t\tadditional_surname, additional_phone,\n\t\t\tadditional_street, additional_zip,\n additional_city, additional_email,\n additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where id=" . intval($_GET['vid']); } else { $query = "SELECT\n\t\t\tid, status,\n\t\t\tdate as datesec, question,\n\t\t\tvotes, submit_check,\n\t\t\tadditional_nickname, additional_forename,\n\t\t\tadditional_surname, additional_phone,\n\t\t\tadditional_street, additional_zip,\n\t\t \tadditional_city, additional_email,\n additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where status=1"; } $objResult = $objDatabase->Execute($query); if ($objResult->RecordCount() == 0) { // Only show old records when no voting is set available $objTpl->setVariable(array('VOTING_TITLE' => $_ARRAYLANG['TXT_VOTING_NOT_AVAILABLE'], 'VOTING_DATE' => '', 'VOTING_OLDER_TEXT' => '', 'VOTING_OLDER_DATE' => '', 'VOTING_PAGING' => '', 'TXT_DATE' => '', 'TXT_TITLE' => '', 'VOTING_RESULTS_TEXT' => '', 'VOTING_RESULTS_TOTAL_VOTES' => '', 'VOTING_OLDER_TITLE' => $_ARRAYLANG['TXT_VOTING_OLDER'], 'TXT_SUBMIT' => '')); /** start paging **/ $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc"; $objResult = $objDatabase->SelectLimit($query, 5); $count = $objResult->RecordCount(); $pos = intval($_GET[pos]); if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, "§ion=Voting", "<b>" . $_ARRAYLANG['TXT_VOTING_ENTRIES'] . "</b>", true); } /** end paging **/ $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc "; $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); while (!$objResult->EOF) { $votingid = $objResult->fields['id']; $votingTitle = stripslashes($objResult->fields['title']); $votingVotes = $objResult->fields['votes']; $votingDate = strtotime($objResult->fields['datesec']); if ($i % 2 == 0) { $class = "row2"; } else { $class = "row1"; } $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '<a href="index.php?section=Voting&vid=' . $votingid . '" title="' . $votingTitle . '">' . $votingTitle . '</a>', 'VOTING_OLDER_DATE' => showFormattedDate($votingDate), 'VOTING_VOTING_ID' => $votingid, 'VOTING_LIST_CLASS' => $class, 'VOTING_PAGING' => $paging)); $objTpl->parse("votingRow"); $i++; $objResult->MoveNext(); } } else { if (!$objResult->EOF) { $votingId = $objResult->fields['id']; $votingTitle = stripslashes($objResult->fields['question']); $votingVotes = $objResult->fields['votes']; $votingDate = strtotime($objResult->fields['datesec']); $votingStatus = $objResult->fields['status']; $votingMethod = $objResult->fields['submit_check']; $additional_fields = _create_additional_input_fields($objResult); $objResult->MoveNext(); } else { errorHandling(); return false; } $images = 1; $query = "SELECT id, question, votes FROM " . DBPREFIX . "voting_results WHERE voting_system_id='{$votingId}' ORDER BY id"; $objResult = $objDatabase->Execute($query); while (!$objResult->EOF) { if ($votingStatus == 1 && ($votingMethod == 'email' && !$voted || $votingMethod == 'cookie' && $_COOKIE['votingcookie'] != '1')) { $votingOptionText .= "<div><input type='radio' id='votingoption_" . $objResult->fields['id'] . "' name='votingoption' value='" . $objResult->fields['id'] . "' " . ($_POST["votingoption"] == $objResult->fields['id'] ? 'checked="checked"' : '') . " /> "; $votingOptionText .= "<label for='votingoption_" . $objResult->fields['id'] . "'>" . stripslashes($objResult->fields['question']) . "</label></div>"; } $objResult->MoveNext(); } $votingResultText = _vote_result_html($votingId); if ($votingStatus == 1 && ($votingMethod == 'email' && !$voted || $votingMethod == 'cookie' && $_COOKIE['votingcookie'] != '1')) { $votingVotes = ''; if ($votingMethod == 'email') { $objTpl->setVariable('VOTING_EMAIL', !empty($_POST['votingemail']) ? htmlentities($_POST['votingemail'], ENT_QUOTES) : ''); $objTpl->parse('voting_email_input'); } else { if ($objTpl->blockExists('voting_email_input')) { $objTpl->hideBlock('voting_email_input'); } } $submitbutton = '<input type="submit" value="' . $_ARRAYLANG['TXT_SUBMIT'] . '" name="Submit" />'; } else { if ($objTpl->blockExists('voting_email_input')) { $objTpl->hideBlock('voting_email_input'); } if ($objTpl->blockExists('additional_fields')) { $objTpl->hideBlock('additional_fields'); } $votingVotes = $_ARRAYLANG['TXT_VOTING_TOTAL'] . ":\t" . $votingVotes; $submitbutton = ''; } if (sizeof($additional_fields)) { $objTpl->parse('additional_fields'); foreach ($additional_fields as $field) { list($name, $label, $tag) = $field; $objTpl->setVariable(array('VOTING_ADDITIONAL_INPUT_LABEL' => $label, 'VOTING_ADDITIONAL_INPUT' => $tag, 'VOTING_ADDITIONAL_NAME' => $name)); $objTpl->parse('additional_elements'); } } else { $objTpl->hideBlock('additional_fields'); } $objTpl->setVariable(array('VOTING_MSG' => $msg, 'VOTING_TITLE' => $votingTitle, 'VOTING_DATE' => showFormattedDate($votingDate), 'VOTING_OPTIONS_TEXT' => $votingOptionText, 'VOTING_RESULTS_TEXT' => $votingResultText, 'VOTING_RESULTS_TOTAL_VOTES' => $votingVotes, 'VOTING_OLDER_TITLE' => $_ARRAYLANG['TXT_VOTING_OLDER'], 'TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_VOTES' => $_ARRAYLANG['TXT_VOTES'], 'TXT_SUBMIT' => $submitbutton)); // show other Poll entries /** start paging **/ $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system WHERE id<>{$votingId} order by id desc"; $objResult = $objDatabase->SelectLimit($query, 5); $count = $objResult->RecordCount(); $pos = intval($_GET[pos]); if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, "§ion=Voting", "<b>" . $_ARRAYLANG['TXT_VOTING_ENTRIES'] . "</b>", true); } /** end paging **/ $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system WHERE id<>{$votingId} order by id desc "; $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '', 'VOTING_OLDER_DATE' => '', 'VOTING_VOTING_ID' => '', 'VOTING_PAGING' => '', 'TXT_DATE' => '', 'TXT_TITLE' => '')); while (!$objResult->EOF) { $votingid = $objResult->fields['id']; $votingTitle = stripslashes($objResult->fields['title']); $votingVotes = $objResult->fields['votes']; $votingDate = strtotime($objResult->fields['datesec']); if ($i % 2 == 0) { $class = "row2"; } else { $class = "row1"; } $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '<a href="index.php?section=Voting&vid=' . $votingid . '" title="' . $votingTitle . '">' . $votingTitle . '</a>', 'VOTING_OLDER_DATE' => showFormattedDate($votingDate), 'VOTING_VOTING_ID' => $votingid, 'VOTING_LIST_CLASS' => $class, 'VOTING_PAGING' => $paging)); $objTpl->parse("votingRow"); $i++; $objResult->MoveNext(); } } return $objTpl->get(); }
/** * Show overview of all transactions. * * @access private */ private function showOverview() { global $objDatabase, $_ARRAYLANG, $_CONFIG; $this->objTemplate->loadTemplateFile('module_checkout_overview.html'); //check the payment service provider configuration $objSettingsGeneral = new SettingsGeneral($objDatabase); if (!$objSettingsGeneral->getEpaymentStatus()) { $this->arrStatusMessages['warning'][] = $_ARRAYLANG['TXT_CHECKOUT_EPAYMENT_DEACTIVATED']; } \JS::activate('cx'); $tableRow = ''; $pagingCount = $this->objTransaction->getRecordCount(); $pagingPosition = !empty($_GET['pos']) ? intval($_GET['pos']) : 0; $this->objTemplate->setVariable(array('TXT_CHECKOUT_ALL_ENTRIES' => $_ARRAYLANG['TXT_CHECKOUT_ALL_ENTRIES'], 'TXT_CHECKOUT_ID' => $_ARRAYLANG['TXT_CHECKOUT_ID'], 'TXT_CHECKOUT_TIME' => $_ARRAYLANG['TXT_CHECKOUT_TIME'], 'TXT_CHECKOUT_STATUS' => $_ARRAYLANG['TXT_CHECKOUT_STATUS'], 'TXT_CHECKOUT_INVOICE_NUMBER' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_NUMBER'], 'TXT_CHECKOUT_INVOICE_AMOUNT' => $_ARRAYLANG['TXT_CHECKOUT_INVOICE_AMOUNT'], 'TXT_CHECKOUT_COMPANY' => $_ARRAYLANG['TXT_CHECKOUT_COMPANY'], 'TXT_CHECKOUT_NAME' => $_ARRAYLANG['TXT_CHECKOUT_NAME'], 'TXT_CHECKOUT_PHONE' => $_ARRAYLANG['TXT_CHECKOUT_PHONE'], 'TXT_CHECKOUT_EMAIL' => $_ARRAYLANG['TXT_CHECKOUT_EMAIL'], 'TXT_CHECKOUT_ACTIONS' => $_ARRAYLANG['TXT_CHECKOUT_ACTIONS'], 'TXT_CHECKOUT_DELETE' => $_ARRAYLANG['TXT_CHECKOUT_DELETE'], 'TXT_CHECKOUT_DETAIL' => $_ARRAYLANG['TXT_CHECKOUT_DETAIL'])); $arrTransactions = $this->objTransaction->get(array(), $pagingPosition, $_CONFIG['corePagingLimit']); if (!empty($arrTransactions)) { foreach ($arrTransactions as $arrTransaction) { $arrTransaction['time'] = date('j.n.Y G:i:s', $arrTransaction['time']); switch ($arrTransaction['status']) { case self::WAITING: $arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_WAITING']; break; case self::CONFIRMED: $arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CONFIRMED']; break; case self::CANCELLED: $arrTransaction['status'] = $_ARRAYLANG['TXT_CHECKOUT_STATUS_CANCELLED']; break; } $arrTransaction['invoice_currency'] = $this->arrCurrencies[$arrTransaction['invoice_currency']]; $arrTransaction['invoice_amount'] = number_format($arrTransaction['invoice_amount'], 2, '.', '\'') . ' ' . $arrTransaction['invoice_currency']; $this->objTemplate->setVariable(array('CHECKOUT_ROW_CLASS' => $tableRow++ % 2 == 1 ? 'row1' : 'row2', 'CHECKOUT_ID' => $arrTransaction['id'], 'CHECKOUT_TIME' => contrexx_raw2xhtml($arrTransaction['time']), 'CHECKOUT_STATUS' => $arrTransaction['status'], 'CHECKOUT_INVOICE_NUMBER' => $arrTransaction['invoice_number'], 'CHECKOUT_INVOICE_AMOUNT' => contrexx_raw2xhtml($arrTransaction['invoice_amount']), 'CHECKOUT_COMPANY' => contrexx_raw2xhtml($arrTransaction['contact_company']), 'CHECKOUT_NAME' => contrexx_raw2xhtml($arrTransaction['contact_forename'] . ' ' . $arrTransaction['contact_surname']), 'CHECKOUT_PHONE' => contrexx_raw2xhtml($arrTransaction['contact_phone']), 'CHECKOUT_EMAIL' => contrexx_raw2xhtml($arrTransaction['contact_email']))); $this->objTemplate->parse('transaction'); } if ($pagingCount > $_CONFIG['corePagingLimit']) { $this->objTemplate->setVariable('CHECKOUT_PAGING', getPaging($pagingCount, $pagingPosition, "&cmd=Checkout", $_ARRAYLANG['TXT_CHECKOUT_TRANSACTIONS'])); } $this->objTemplate->parse('transactions'); } else { if (empty($this->arrStatusMessages['warning'])) { $this->arrStatusMessages['warning'][] = $_ARRAYLANG['TXT_CHECKOUT_NO_ENTRIES']; } $this->objTemplate->hideBlock('transactions'); } }
/** * Overview over a dir * * @global ADONewConnection * @global array * @global array * @param int $highlight The entry which shall be shown green * @access private */ function _overviewDir($highlight = null) { global $objDatabase, $_ARRAYLANG, $_CONFIG; $this->_objTpl->loadTemplateFile('module_memberdir_overviewDir.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_OVERVIEW']; $dirid = isset($_GET['id']) ? $_GET['id'] : ""; if (isset($_POST['memberdir_update_sorting'])) { if (!empty($_POST['userDefinedSortNumber']) && is_array($_POST['userDefinedSortNumber'])) { foreach ($_POST['userDefinedSortNumber'] as $fieldId => $fieldSortNumber) { $objDatabase->Execute("UPDATE " . DBPREFIX . "module_memberdir_values SET `0` = " . intval($fieldSortNumber) . " WHERE id = " . intval($fieldId)); } } } $fieldnames = $this->getFieldData($dirid); $this->_objTpl->setGlobalVariable(array("TXT_CONFIRM_DELETE_DATA" => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], 'TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD' => $_ARRAYLANG['TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD'], "TXT_ACTION_IS_IRREVERSIBLE" => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], "TXT_DELETE_CATEGORY_ALL" => $_ARRAYLANG['TXT_DELETE_CATEGORY_ALL'], "TXT_MANAGE_ENTRIES" => $_ARRAYLANG['TXT_OVERVIEW'] . ": " . $this->directories[$dirid]['name'], "TXT_ID" => $_ARRAYLANG['TXT_MEMBERDIR_ID'], "TXT_ACTION" => $_ARRAYLANG['TXT_ACTION'], "TXT_SELECT_ALL" => $_ARRAYLANG['TXT_SELECT_ALL'], "TXT_DESELECT_ALL" => $_ARRAYLANG['TXT_DESELECT_ALL'], "TXT_SUBMIT_SELECT" => $_ARRAYLANG['TXT_SUBMIT_SELECT'], "TXT_SUBMIT_DELETE" => $_ARRAYLANG['TXT_SUBMIT_DELETE'], "TXT_SUBMIT_EXPORT" => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], "TXT_LOCATION" => $_ARRAYLANG['TXT_LOCATION'], "TXT_FILTER" => $_ARRAYLANG['TXT_FILTER'], 'TXT_MEMBERDIR_SORTING' => $_ARRAYLANG['TXT_MEMBERDIR_SORTING'], "MEMBERDIR_CHARLIST" => $this->_getCharList("?cmd=MemberDir&act=showdir&id=" . $dirid), "DIRECTORY_LIST" => $this->dirList('id', $dirid, 100), "TXT_SEARCH" => $_ARRAYLANG['TXT_SEARCH'], "TXT_KEYWORD" => empty($_GET['keyword']) ? $_ARRAYLANG['TXT_KEYWORD'] : $_GET['keyword'], "DIRID" => $dirid)); for ($i = 1; $i <= 3; $i++) { $index = $i; while ($fieldnames[$index]['active'] == 0 && $index < 17) { $index++; } $this->_objTpl->setVariable(array("TXT_FIELD_" . $i => $fieldnames[$index]['name'])); $indexed[$i] = $index; } $sort = empty($_GET['sort']) ? "" : contrexx_addslashes($_GET['sort']); $_GET['search'] = empty($_GET['search']) ? "" : contrexx_addslashes($_GET['search']); $keyword = empty($_GET['keyword']) ? "" : $_GET['keyword']; if ($sort == "sc") { /* Special Chars */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^[^a-zA-Z]'"; if (!empty($dirid)) { $query .= " AND `dirid`= '{$dirid}'"; } } elseif (preg_match("%^[a-z]\$%i", $sort)) { /* Sort by char */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^" . $sort . "'"; if (!empty($dirid)) { $query .= " AND `dirid`= '{$dirid}'"; } } elseif ($_GET['search'] == "search") { /* Search */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE (\n `1` LIKE '%{$keyword}%' OR\n `2` LIKE '%{$keyword}%' OR\n `3` LIKE '%{$keyword}%' OR\n `4` LIKE '%{$keyword}%' OR\n `5` LIKE '%{$keyword}%' OR\n `6` LIKE '%{$keyword}%' OR\n `7` LIKE '%{$keyword}%' OR\n `8` LIKE '%{$keyword}%' OR\n `9` LIKE '%{$keyword}%' OR\n `10` LIKE '%{$keyword}%' OR\n `11` LIKE '%{$keyword}%' OR\n `12` LIKE '%{$keyword}%' OR\n `13` LIKE '%{$keyword}%' OR\n `14` LIKE '%{$keyword}%' OR\n `15` LIKE '%{$keyword}%' OR\n `16` LIKE '%{$keyword}%' OR\n `17` LIKE '%{$keyword}%' OR\n `18` LIKE '%{$keyword}%'\n )"; if (!empty($dirid)) { $query .= " AND `dirid`= '{$dirid}'"; } } else { /* All */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE"; if (!empty($dirid)) { $query .= " `dirid` = '{$dirid}'"; } $query .= " ORDER BY `0` ASC, id ASC"; } $pos = empty($_GET['pos']) ? 0 : intval($_GET['pos']); $objResult = $objDatabase->Execute($query); if ($objResult) { $count = $objResult->RecordCount(); $paging = getPaging($count, $pos, "&cmd=MemberDir&act=showdir&sort={$sort}&id={$dirid}&search={$_GET['search']}&keyword={$keyword}", "<b>" . $_ARRAYLANG['TXT_MEMBERDIR_ENTRIES'] . "</b>", true); $this->_objTpl->setVariable("MEMBERDIR_PAGING", $paging); } $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); if ($objResult) { $rowid = 2; while (!$objResult->EOF) { $this->_objTpl->setVariable(array("MEMBERDIR_ROW" => $highlight == $objResult->fields['id'] ? "highlightedGreen" : "row" . $rowid, "MEMBERDIR_ID" => $objResult->fields['id'], "MEMBERDIR_USER_DEFINED_SORT_NUMBER" => $objResult->fields['0'], "MEMBERDIR_FIELD_1" => $objResult->fields[$indexed[1]], "MEMBERDIR_FIELD_2" => $objResult->fields[$indexed[2]], "MEMBERDIR_FIELD_3" => $objResult->fields[$indexed[3]])); $rowid = $rowid == 2 ? 1 : 2; $this->_objTpl->parse("memberdir_row"); $objResult->MoveNext(); } } else { $this->statusMessage = $_ARRAYLANG['TXT_DATABASE_READ_ERROR']; echo $objDatabase->ErrorMsg(); echo $query; } }
/** * Perform the overview page functionalities * * @return null */ function showOverview() { global $objDatabase, $_ARRAYLANG, $_CORELANG; $this->_objTpl->loadTemplateFile('module_calendar_overview.html'); $this->_pageTitle = $_ARRAYLANG['TXT_CALENDAR_MENU_OVERVIEW']; $this->getSettings(); if (isset($_GET['switch_status'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['switch_status'])); if ($objEvent->switchStatus()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED']; } } if (isset($_GET['delete'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['delete'])); if ($objEvent->delete()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_DELETED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_DELETED']; } } if (isset($_GET['confirm'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['confirm'])); if ($objEvent->confirm()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED']; } } if (isset($_GET['export'])) { $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['export'])); $objEvent->export(); } if (isset($_GET['multi'])) { \Permission::checkAccess(180, 'static'); $status = true; $messageVar = 'EDITED'; foreach ($_POST['selectedEventId'] as $key => $eventId) { $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($eventId)); switch ($_GET['multi']) { case 'delete': $status = $objEvent->delete() ? true : false; $messageVar = 'DELETED'; break; case 'activate': $objEvent->status = 0; $status = $objEvent->switchStatus() ? true : false; $messageVar = 'EDITED'; break; case 'deactivate': $objEvent->status = 1; $status = $objEvent->switchStatus() ? true : false; $messageVar = 'EDITED'; break; case 'export': $objEvent->export(); break; } } if ($status) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_' . $messageVar]; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_' . $messageVar]; } } $categoryId = intval($_REQUEST['categoryId']) != 0 ? $categoryId = intval($_REQUEST['categoryId']) : ($categoryId = null); $searchTerm = isset($_REQUEST['term']) ? $_REQUEST['term'] : ($searchTerm = $_ARRAYLANG['TXT_CALENDAR_KEYWORD']); $startPos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : 0; $listType = 'all'; if ($_GET['list'] == 'actual' || !isset($_GET['list'])) { $styleListActual = 'underline'; $styleListAll = ''; $startDate = new \DateTime(); $listType = 'upcoming'; } else { $styleListActual = ''; $styleListAll = 'underline'; $startDate = null; } $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_OVERVIEW' => $this->_pageTitle, 'TXT_' . $this->moduleLangVar . '_UPCOMING_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_UPCOMING_EVENTS'], 'TXT_' . $this->moduleLangVar . '_ALL_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_ALL_EVENTS'], 'TXT_' . $this->moduleLangVar . '_FILTER' => $_ARRAYLANG['TXT_CALENDAR_FILTER'], 'TXT_' . $this->moduleLangVar . '_CONFIRMLIST' => $_ARRAYLANG['TXT_CALENDAR_CONFIRMLIST'], 'TXT_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_KEYWORD' => $searchTerm, 'TXT_' . $this->moduleLangVar . '_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_EVENTS'], 'TXT_' . $this->moduleLangVar . '_STATUS' => $_ARRAYLANG['TXT_CALENDAR_STATUS'], 'TXT_' . $this->moduleLangVar . '_DATE' => $_ARRAYLANG['TXT_CALENDAR_DATE'], 'TXT_' . $this->moduleLangVar . '_TITLE' => $_ARRAYLANG['TXT_CALENDAR_TITLE'], 'TXT_' . $this->moduleLangVar . '_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CATEGORY'], 'TXT_' . $this->moduleLangVar . '_SERIES' => $_ARRAYLANG['TXT_CALENDAR_SERIES'], 'TXT_' . $this->moduleLangVar . '_RE_DEREGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_RE_DEGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_REGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_WAITLIST' => $_ARRAYLANG['TXT_CALENDAR_WAITLIST'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_ARRAYLANG['TXT_CALENDAR_ACTION'], 'TXT_' . $this->moduleLangVar . '_EXPORT_ICAL_FORMAT' => $_ARRAYLANG['TXT_CALENDAR_EXPORT_ICAL_FORMAT'], 'TXT_' . $this->moduleLangVar . '_EDIT' => $_ARRAYLANG['TXT_CALENDAR_EDIT'], 'TXT_' . $this->moduleLangVar . '_COPY' => $_ARRAYLANG['TXT_CALENDAR_COPY'], 'TXT_' . $this->moduleLangVar . '_DELETE' => $_ARRAYLANG['TXT_CALENDAR_DELETE'], 'TXT_' . $this->moduleLangVar . '_LANGUAGES' => $_ARRAYLANG['TXT_CALENDAR_LANGUAGES'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_MARK_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_REMOVE_CHOICE'], 'TXT_SUBMIT_SELECT' => $_ARRAYLANG['TXT_SUBMIT_SELECT'], 'TXT_SUBMIT_ACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_ACTIVATE'], 'TXT_SUBMIT_DEACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_DEACTIVATE'], 'TXT_SUBMIT_DELETE' => $_ARRAYLANG['TXT_SUBMIT_DELETE'], 'TXT_SUBMIT_EXPORT' => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CALENDAR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_CALENDAR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_CALENDAR_MAKE_SELECTION'], 'TXT_' . $this->moduleLangVar . '_LIST_ACTUAL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ACTUAL'], 'TXT_' . $this->moduleLangVar . '_LIST_ALL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ALL'], $this->moduleLangVar . '_LINKSTYLE_LIST_ACTUAL' => $styleListActual, $this->moduleLangVar . '_LINKSTYLE_LIST_ALL' => $styleListAll)); $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true); $objCategoryManager->getCategoryList(); $this->_objTpl->setVariable(array('CALENDAR_CATEGORIES' => $objCategoryManager->getCategoryDropdown($categoryId, 1))); $objConfirmEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(null, null, null, null, null, null, true, null, null, false, null); $objConfirmEventManager->getEventList(); if (count($objConfirmEventManager->eventList) > 0) { $objConfirmEventManager->showEventList($this->_objTpl, 'confirm'); } else { $this->_objTpl->hideBlock('showConfirmList'); } if ($this->arrSettings['rssFeedStatus'] == 1) { $objFeedEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(time(), null, null, null, true); $objFeed = new \Cx\Modules\Calendar\Controller\CalendarFeed($objFeedEventManager); $objFeed->creatFeed(); } $showSeries = $listType == 'upcoming'; $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($startDate, null, $categoryId, $searchTerm, $showSeries, null, null, $startPos, $this->arrSettings['numPaging'], 'ASC', true, null, $listType); $objEventManager->getEventList(); if ($objEventManager->countEvents > $this->arrSettings['numPaging']) { $pagingCategory = !empty($categoryId) ? '&categoryId=' . $categoryId : ''; $pagingTerm = !empty($searchTerm) ? '&term=' . $searchTerm : ''; $pagingList = !empty($_GET['list']) ? '&list=' . $_GET['list'] : ''; $this->_objTpl->setVariable(array($this->moduleLangVar . '_PAGING' => getPaging($objEventManager->countEvents, $startPos, "&cmd=" . $this->moduleName . $pagingCategory . $pagingTerm . $pagingList, "<b>" . $_ARRAYLANG['TXT_CALENDAR_EVENTS'] . "</b>", true, $this->arrSettings['numPaging']))); } $objEventManager->showEventList($this->_objTpl); }
/** * Shows the Overview of categories * * @global ADONewConnection * @global array * @global array * @param var $intParentId */ function showCategoryOverview($intParentId = 0) { global $objDatabase, $_ARRAYLANG, $_CONFIG, $_CORELANG; $intParentId = intval($intParentId); $this->_objTpl->setTemplate($this->pageContent, true, true); // load source code if cmd value is integer if ($this->_objTpl->placeholderExists('APPLICATION_DATA')) { $page = new \Cx\Core\ContentManager\Model\Entity\Page(); $page->setVirtual(true); $page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION); $page->setModule('Gallery'); // load source code $applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page); \LinkGenerator::parseTemplate($applicationTemplate); $this->_objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate); } $categoryProtected = $this->categoryIsProtected($intParentId); if ($categoryProtected > 0) { if (!\Permission::checkAccess($categoryProtected, 'dynamic', true)) { $link = base64_encode($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']); \Cx\Core\Csrf\Controller\Csrf::header("Location: " . CONTREXX_DIRECTORY_INDEX . "?section=Login&cmd=noaccess&redirect=" . $link); exit; } } // hide image detail block // $this->_objTpl->hideBlock('galleryImage'); if ($this->arrSettings['header_type'] == 'hierarchy') { $this->_objTpl->setVariable(array('GALLERY_CATEGORY_TREE' => $this->getCategoryTree(), 'TXT_GALLERY_CATEGORY_HINT' => $_ARRAYLANG['TXT_GALLERY_CATEGORY_HINT_HIERARCHY'])); } else { $this->_objTpl->setVariable(array('GALLERY_CATEGORY_TREE' => $this->getSiblingList(), 'TXT_GALLERY_CATEGORY_HINT' => $_ARRAYLANG['TXT_GALLERY_CATEGORY_HINT_FLAT'])); } $objResult = $objDatabase->Execute("SELECT id, catid, path FROM " . DBPREFIX . "module_gallery_pictures " . "ORDER BY catimg ASC, sorting ASC, id ASC"); $showImageSizeOverview = $this->arrSettings['show_image_size'] == 'on'; while (!$objResult->EOF) { $arrImageSizes[$objResult->fields['catid']][$objResult->fields['id']] = $showImageSizeOverview ? round(filesize($this->strImagePath . $objResult->fields['path']) / 1024, 2) : ''; $arrstrImagePaths[$objResult->fields['catid']][$objResult->fields['id']] = $this->strThumbnailWebPath . $objResult->fields['path']; $objResult->MoveNext(); } if (isset($arrImageSizes) && isset($arrstrImagePaths)) { foreach ($arrImageSizes as $keyCat => $valueCat) { $arrCategorySizes[$keyCat] = 0; foreach ($valueCat as $valueImageSize) { $arrCategorySizes[$keyCat] = $arrCategorySizes[$keyCat] + $valueImageSize; } } foreach ($arrstrImagePaths as $keyCat => $valueCat) { $arrCategoryImages[$keyCat] = 0; $arrCategoryImageCounter[$keyCat] = 0; foreach ($valueCat as $valuestrImagePath) { $arrCategoryImages[$keyCat] = $valuestrImagePath; $arrCategoryImageCounter[$keyCat] = $arrCategoryImageCounter[$keyCat] + 1; } } } //$arrCategorySizes -> Sizes of all Categories //$arrCategoryImages -> The First Picture of each category //$arrCategoryImageCounter -> Counts all images in one group //begin category-paging $intPos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $objResult = $objDatabase->Execute('SELECT count(id) AS countValue FROM ' . DBPREFIX . 'module_gallery_categories WHERE pid=' . $intParentId . ' AND status="1" '); $this->_objTpl->setVariable(array('GALLERY_CATEGORY_PAGING' => getPaging($objResult->fields['countValue'], $intPos, '§ion=Gallery&cid=' . $intParentId . $this->strCmd, '<b>' . $_ARRAYLANG['TXT_GALLERY'] . '</b>', false, intval($_CONFIG['corePagingLimit'])))); //end category-paging $objResult = $objDatabase->SelectLimit('SELECT * FROM ' . DBPREFIX . 'module_gallery_categories WHERE pid=' . $intParentId . ' AND status="1" ORDER BY sorting ASC', intval($_CONFIG['corePagingLimit']), $intPos); if ($objResult->RecordCount() == 0) { // no categories in the database, hide the output //$this->_objTpl->hideBlock('galleryCategoryList'); } else { $i = 1; while (!$objResult->EOF) { $objSubResult = $objDatabase->Execute("SELECT name, value FROM " . DBPREFIX . "module_gallery_language " . "WHERE gallery_id=" . $objResult->fields['id'] . " AND " . "lang_id=" . intval($this->langId) . " ORDER BY name ASC"); unset($arrCategoryLang); while (!$objSubResult->EOF) { $arrCategoryLang[$objSubResult->fields['name']] = $objSubResult->fields['value']; $objSubResult->MoveNext(); } if (empty($arrCategoryImages[$objResult->fields['id']])) { // no pictures in this gallery, show the empty-image $strName = $arrCategoryLang['name']; $strDesc = $arrCategoryLang['desc']; $strImage = '<a href="' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery&cid=' . $objResult->fields['id'] . $this->strCmd . '" target="_self">'; $strImage .= '<img border="0" alt="' . $arrCategoryLang['name'] . '" src="modules/Gallery/View/Media/no_images.gif" /></a>'; $strInfo = $_ARRAYLANG['TXT_IMAGE_COUNT'] . ': 0'; $strInfo .= $showImageSizeOverview ? '<br />' . $_CORELANG['TXT_SIZE'] . ': 0kB' : ''; } else { $strName = $arrCategoryLang['name']; $strDesc = $arrCategoryLang['desc']; $strImage = '<a href="' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery&cid=' . $objResult->fields['id'] . $this->strCmd . '" target="_self">'; $strImage .= '<img border="0" alt="' . $arrCategoryLang['name'] . '" src="' . $arrCategoryImages[$objResult->fields['id']] . '" /></a>'; $strInfo = $_ARRAYLANG['TXT_IMAGE_COUNT'] . ': ' . $arrCategoryImageCounter[$objResult->fields['id']]; $strInfo .= $showImageSizeOverview ? '<br />' . $_CORELANG['TXT_SIZE'] . ': ' . $arrCategorySizes[$objResult->fields['id']] . 'kB' : ''; } $this->_objTpl->setVariable(array('GALLERY_STYLE' => $i % 2 + 1, 'GALLERY_CATEGORY_NAME' => $strName, 'GALLERY_CATEGORY_IMAGE' => $strImage, 'GALLERY_CATEGORY_INFO' => $strInfo, 'GALLERY_CATEGORY_DESCRIPTION' => nl2br($strDesc))); $this->_objTpl->parse('galleryCategoryList'); $i++; $objResult->MoveNext(); } } //images $this->_objTpl->setVariable(array('GALLERY_JAVASCRIPT' => $this->getJavascript())); $objResult = $objDatabase->Execute("SELECT value FROM " . DBPREFIX . "module_gallery_language " . "WHERE gallery_id={$intParentId} AND lang_id={$this->langId} AND name='desc'"); $strCategoryComment = nl2br($objResult->fields['value']); $objResult = $objDatabase->Execute("SELECT comment,voting FROM " . DBPREFIX . "module_gallery_categories " . "WHERE id=" . intval($intParentId)); $boolComment = $objResult->fields['comment']; $boolVoting = $objResult->fields['voting']; // paging $intPos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $objResult = $objDatabase->Execute("SELECT id, path, link, size_show FROM " . DBPREFIX . "module_gallery_pictures " . "WHERE status='1' AND validated='1' AND catid={$intParentId} " . "ORDER BY sorting"); $intCount = $objResult->RecordCount(); $this->_objTpl->setVariable(array('GALLERY_PAGING' => getPaging($intCount, $intPos, '§ion=Gallery&cid=' . $intParentId . $this->strCmd, '<b>' . $_ARRAYLANG['TXT_IMAGES'] . '</b>', false, intval($this->arrSettings["paging"])))); // end paging $objResult = $objDatabase->SelectLimit("SELECT id, path, link, size_show FROM " . DBPREFIX . "module_gallery_pictures " . "WHERE status='1' AND validated='1' AND catid={$intParentId} " . "ORDER BY sorting", intval($this->arrSettings["paging"]), $intPos); if ($objResult->RecordCount() == 0) { // No images in the category if (empty($strCategoryComment)) { $this->_objTpl->hideBlock('galleryImageBlock'); } else { $this->_objTpl->setVariable(array('GALLERY_CATEGORY_COMMENT' => $strCategoryComment)); } } else { $this->_objTpl->setVariable(array('GALLERY_CATEGORY_COMMENT' => $strCategoryComment)); $intFillLastRow = 1; while (!$objResult->EOF) { $imageVotingOutput = ''; $imageCommentOutput = ''; $objSubResult = $objDatabase->Execute("SELECT p.name, p.desc FROM " . DBPREFIX . "module_gallery_language_pics p " . "WHERE picture_id=" . $objResult->fields['id'] . " AND lang_id={$this->langId} LIMIT 1"); // Never used // $imageReso = getimagesize($this->strImagePath.$objResult->fields['path']); $strImagePath = $this->strImageWebPath . $objResult->fields['path']; $imageThumbPath = $this->strThumbnailWebPath . $objResult->fields['path']; $imageFileName = $this->arrSettings['show_file_name'] == 'on' ? $objResult->fields['path'] : ''; $imageName = $this->arrSettings['show_names'] == 'on' ? $objSubResult->fields['name'] : ''; $imageTitle = $this->arrSettings['show_names'] == 'on' ? $objSubResult->fields['name'] : ($this->arrSettings['show_file_name'] == 'on' ? $objResult->fields['path'] : ''); $imageLinkName = $objSubResult->fields['desc']; $imageLink = $objResult->fields['link']; $showImageSize = $this->arrSettings['show_image_size'] == 'on' && $objResult->fields['size_show']; $imageFileSize = $showImageSize ? round(filesize($this->strImagePath . $objResult->fields['path']) / 1024, 2) : ''; $imageLinkOutput = ''; $imageSizeOutput = ''; $imageTitleTag = ''; // chop the file extension if the settings tell us to do so if ($this->arrSettings['show_ext'] == 'off') { $imageFileName = substr($imageFileName, 0, strrpos($imageFileName, '.')); } if ($this->arrSettings['slide_show'] == 'slideshow') { $optionValue = "slideshowDelay:" . $this->arrSettings['slide_show_seconds']; } else { $optionValue = "counterType:'skip',continuous:true,animSequence:'sync'"; } //calculation starts here $numberOfChars = "60"; if ($imageLinkName != "") { if (strlen($imageLinkName) > $numberOfChars) { $descriptionString = " " . substr($imageLinkName, 0, $numberOfChars); $descriptionString .= " ..."; } else { $descriptionString = " " . $imageLinkName; } } else { $descriptionString = ""; } //Ends here if ($this->arrSettings['show_names'] == 'on' || $this->arrSettings['show_file_name'] == 'on') { $imageSizeOutput = $imageName; $imageTitleTag = $imageName; if ($this->arrSettings['show_file_name'] == 'on' || $showImageSize) { $imageData = array(); if ($this->arrSettings['show_file_name'] == 'on') { if ($this->arrSettings['show_names'] == 'off') { $imageSizeOutput .= $imageFileName; $imageTitleTag .= $imageFileName; } else { $imageData[] = $imageFileName; } } if (!empty($imageData)) { $imageTitleTag .= ' (' . join(' ', $imageData) . ')'; } if ($showImageSize) { // the size of the file has to be shown $imageData[] = $imageFileSize . ' kB'; } if (!empty($imageData)) { $imageSizeOutput .= ' (' . join(' ', $imageData) . ')<br />'; } } } if ($this->arrSettings['enable_popups'] == "on") { $strImageOutput = '<a rel="shadowbox[' . $intParentId . '];options={' . $optionValue . '}" title="' . $imageTitleTag . '" href="' . $strImagePath . '"><img title="' . $imageTitleTag . '" src="' . $imageThumbPath . '" alt="' . $imageTitleTag . '" /></a>'; /* $strImageOutput = '<a rel="shadowbox['.$intParentId.'];options={'.$optionValue. '}" description="'.$imageLinkName.'" title="'.$titleLink.'" href="'. $strImagePath.'"><img title="'.$imageName.'" src="'. $imageThumbPath.'" alt="'.$imageName.'" /></a>'; */ } else { $strImageOutput = '<a href="' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery' . $this->strCmd . '&cid=' . $intParentId . '&pId=' . $objResult->fields['id'] . '">' . '<img title="' . $imageTitleTag . '" src="' . $imageThumbPath . '"' . 'alt="' . $imageTitleTag . '" /></a>'; } if ($this->arrSettings['show_comments'] == 'on' && $boolComment) { $objSubResult = $objDatabase->Execute("SELECT id FROM " . DBPREFIX . "module_gallery_comments " . "WHERE picid=" . $objResult->fields['id']); if ($objSubResult->RecordCount() > 0) { if ($objSubResult->RecordCount() == 1) { $imageCommentOutput = '1 ' . $_ARRAYLANG['TXT_COMMENTS_ADD_TEXT'] . '<br />'; } else { $imageCommentOutput = $objSubResult->RecordCount() . ' ' . $_ARRAYLANG['TXT_COMMENTS_ADD_COMMENTS'] . '<br />'; } } } if ($this->arrSettings['show_voting'] == 'on' && $boolVoting) { $objSubResult = $objDatabase->Execute("SELECT mark FROM " . DBPREFIX . "module_gallery_votes " . "WHERE picid=" . $objResult->fields["id"]); if ($objSubResult->RecordCount() > 0) { $intMark = 0; while (!$objSubResult->EOF) { $intMark = $intMark + $objSubResult->fields['mark']; $objSubResult->MoveNext(); } $imageVotingOutput = $_ARRAYLANG['TXT_VOTING_SCORE'] . ' Ø' . number_format(round($intMark / $objSubResult->RecordCount(), 1), 1, '.', '\'') . '<br />'; } } if (!empty($imageLinkName)) { if (!empty($imageLink)) { $imageLinkOutput = '<a href="' . $imageLink . '" target="_blank">' . $imageLinkName . '</a>'; } else { $imageLinkOutput = $imageLinkName; } } else { if (!empty($imageLink)) { $imageLinkOutput = '<a href="' . $imageLink . '" target="_blank">' . $imageLink . '</a>'; } } $this->_objTpl->setVariable(array('GALLERY_IMAGE_LINK' . $intFillLastRow => $imageSizeOutput . $imageCommentOutput . $imageVotingOutput . $imageLinkOutput, 'GALLERY_IMAGE' . $intFillLastRow => $strImageOutput)); if ($intFillLastRow == 3) { // Parse the data after every third image $this->_objTpl->parse('galleryShowImages'); $intFillLastRow = 1; } else { $intFillLastRow++; } $objResult->MoveNext(); } if ($intFillLastRow == 2) { $this->_objTpl->setVariable(array('GALLERY_IMAGE' . $intFillLastRow => '', 'GALLERY_IMAGE_LINK' . $intFillLastRow => '')); $intFillLastRow++; } if ($intFillLastRow == 3) { $this->_objTpl->setVariable(array('GALLERY_IMAGE' . $intFillLastRow => '', 'GALLERY_IMAGE_LINK' . $intFillLastRow => '')); $this->_objTpl->parse('galleryShowImages'); } } $this->_objTpl->parse('galleryCategories'); }
/** * Gets the list with the headlines * @global array * @global ADONewConnection * @global array * @return string parsed content */ function getTitles() { global $_CONFIG, $objDatabase, $_ARRAYLANG; $selectedId = null; $paging = ""; $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; if (!isset($_REQUEST['cmd'])) { $_REQUEST['cmd'] = ''; } $this->_objTpl->setTemplate($this->pageContent); $this->_objTpl->setGlobalVariable('MODULE_INDEX', MODULE_INDEX); $sortType = ''; if (!empty($_REQUEST['category'])) { $selectedId = intval($_REQUEST['category']); $query = "\n SELECT `sort_style`\n FROM `" . DBPREFIX . "module_docsys" . MODULE_INDEX . "_categories`\n WHERE `catid`={$selectedId}"; $objRS = $objDatabase->SelectLimit($query, 1); if (!$objRS) { die('database error. ' . $objDatabase->ErrorMsg()); } $sortType = $objRS->fields['sort_style']; } $this->_objTpl->setVariable("DOCSYS_NO_CATEGORY", $_ARRAYLANG['TXT_CATEGORY']); $this->_objTpl->setVariable("DOCSYS_CAT_MENU", $this->getCategoryMenu($this->langId, array($selectedId), $_REQUEST['cmd'])); $this->_objTpl->setVariable("TXT_PERFORM", $_ARRAYLANG['TXT_PERFORM']); $count = $this->countOverviewEntries($selectedId); $entries = $this->getOverviewTitles($pos, $selectedId, $sortType); if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, "§ion=DocSys" . MODULE_INDEX, $_ARRAYLANG['TXT_DOCUMENTS'], true); } $this->_objTpl->setVariable("DOCSYS_PAGING", $paging); if ($count >= 1) { $row = 1; foreach ($entries as $entry) { $cmd = (empty($_REQUEST['cmd']) ? '' : $_REQUEST['cmd'] . '_') . 'details'; $this->_objTpl->setVariable(array('DOCSYS_STYLE' => $row++ % 2 + 1, 'DOCSYS_LONG_DATE' => date($this->dateLongFormat, $entry['date']), 'DOCSYS_DATE' => date($this->dateFormat, $entry['date']), 'DOCSYS_LINK' => "<a href=\"" . CONTREXX_SCRIPT_PATH . "?section=DocSys" . MODULE_INDEX . "&cmd={$cmd}&id=" . $entry['id'] . "\" title=\"" . contrexx_raw2xhtml($entry['title']) . "\">" . contrexx_raw2xhtml($entry['title']) . "</a>", 'DOCSYS_CATEGORY' => contrexx_raw2xhtml(current($entry['categories'])), 'DOCSYS_AUTHOR' => contrexx_raw2xhtml($entry['author']))); $this->_objTpl->parse("row"); } if ($this->_objTpl->blockExists('table')) { $this->_objTpl->parse("table"); } if ($this->_objTpl->blockExists('nothing_found')) { $this->_objTpl->hideBlock("nothing_found"); } } else { /*$this->_objTpl->setVariable(array( 'DOCSYS_STYLE' => 1, 'DOCSYS_DATE' => "", 'DOCSYS_LINK' => "", 'DOCSYS_CATEGORY' => $_ARRAYLANG['TXT_NO_DOCUMENTS_FOUND'] )); $this->_objTpl->parse("row");*/ $this->_objTpl->setVariable(array("TXT_NO_DOCUMENTS_FOUND" => $_ARRAYLANG['TXT_NO_DOCUMENTS_FOUND'])); if ($this->_objTpl->blockExists('nothing_found')) { $this->_objTpl->parse("nothing_found"); } if ($this->_objTpl->blockExists('table')) { $this->_objTpl->hideBlock("table"); } } return $this->_objTpl->get(); }
private function userList() { global $_ARRAYLANG, $_CORELANG, $_CONFIG; // add this to a new section maybe named like "maintenance" $this->removeUselessImages(); $arrSettings = \User_Setting::getSettings(); $templateFile = 'module_access_user_list'; if (!$arrSettings['use_usernames']['status']) { $templateFile .= '_no_usernames'; } $this->_objTpl->addBlockfile('ACCESS_USER_TEMPLATE', 'module_access_user_overview', $templateFile . '.html'); $this->_pageTitle = $_ARRAYLANG['TXT_ACCESS_USERS']; $objFWUser = \FWUser::getFWUserObject(); $rowNr = 0; $groupId = !empty($_REQUEST['groupId']) ? $_REQUEST['groupId'] : 0; $accountType = !empty($_REQUEST['accountType']) ? intval($_REQUEST['accountType']) : 0; $limitOffset = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $orderDirection = !empty($_GET['sort']) ? $_GET['sort'] : 'desc'; $orderBy = !empty($_GET['by']) ? $_GET['by'] : 'regdate'; $search = isset($_REQUEST['search']) && !empty($_REQUEST['search']) ? preg_split('#\\s+#', $_REQUEST['search']) : array(); $usernameFilter = isset($_REQUEST['username_filter']) && $_REQUEST['username_filter'] != '' && in_array(ord($_REQUEST['username_filter']), array_merge(array(48), range(65, 90))) ? $_REQUEST['username_filter'] : null; $userStatusFilter = isset($_REQUEST['user_status_filter']) && $_REQUEST['user_status_filter'] != '' ? intval($_REQUEST['user_status_filter']) : null; $userRoleFilter = isset($_REQUEST['user_role_filter']) && $_REQUEST['user_role_filter'] != '' ? intval($_REQUEST['user_role_filter']) : null; $this->_objTpl->setVariable(array('TXT_ACCESS_CONFIRM_DELETE_USER' => $_ARRAYLANG['TXT_ACCESS_CONFIRM_DELETE_USER'], 'TXT_ACCESS_CONFIRM_USER_NOTIFY_ABOUT_ACCOUNT_STATUS_NAMED' => $_ARRAYLANG['TXT_ACCESS_CONFIRM_USER_NOTIFY_ABOUT_ACCOUNT_STATUS_NAMED'], 'TXT_ACCESS_OPERATION_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACCESS_OPERATION_IRREVERSIBLE'], 'TXT_ACCESS_SEARCH' => $_ARRAYLANG['TXT_ACCESS_SEARCH'], 'TXT_ACCESS_USER_LIST' => $_ARRAYLANG['TXT_ACCESS_USER_LIST'], 'TXT_ACCESS_FILTER' => $_ARRAYLANG['TXT_ACCESS_FILTER'], 'ACCESS_GROUP_MENU' => $this->getGroupMenu($groupId, 'name="access_group_id" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=\'+this.value+\'&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&accountType=' . $accountType . '\')"'), 'ACCESS_USER_ACCOUNT_MENU' => $this->getUserAccountMenu($accountType, 'name="access_user_account_type" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&accountType=\'+this.value)"'), 'ACCESS_USER_STATUS_MENU' => $this->getUserStatusMenu($userStatusFilter, 'name="user_status_filter" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&user_status_filter=\'+this.value+\'&user_role_filter=' . $userRoleFilter . '&accountType=' . $accountType . '\')"'), 'ACCESS_USER_ROLE_MENU' => $this->getUserRoleMenu($userRoleFilter, 'name="user_role_filter" onchange="window.location.replace(\'' . \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Access') . '&act=user&groupId=' . $groupId . '&sort=' . htmlspecialchars($orderDirection) . '&by=' . htmlspecialchars($orderBy) . '&user_status_filter=' . $userStatusFilter . '&user_role_filter=\'+this.value+\'&accountType=' . $accountType . '\')"'), 'ACCESS_GROUP_IP' => $groupId, 'ACCESS_ACCOUNT_TYPE' => $accountType, 'ACCESS_SEARCH_VALUE' => htmlentities(join(' ', $search), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_SORT_DIRECTION' => $orderDirection, 'ACCESS_SORT_BY' => $orderBy, 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search)), 'ACCESS_USER_USERNAME_FILTER_ESCAPED' => urlencode($usernameFilter), 'ACCESS_USER_STATUS_FILTER_ESCAPED' => urlencode($userStatusFilter), 'ACCESS_USER_ROLE_FILTER_ESCAPED' => urlencode($userRoleFilter))); $cx = \Env::get('cx'); if ($cx->getLicense()->isInLegalComponents('Crm')) { $this->_objTpl->touchBlock('access_crm_filter'); } else { $this->_objTpl->hideBlock('access_crm_filter'); } $this->parseLetterIndexList('index.php?cmd=Access&act=user&groupId=' . $groupId . '&user_status_filter=' . $userStatusFilter . '&user_role_filter=' . $userRoleFilter, 'username_filter', $usernameFilter); $objGroup = $objFWUser->objGroup->getGroup($groupId); $userCount = $objGroup->getUserCount(); $userFilter = array(); if ($groupId) { $groupId = $groupId == 'groupless' ? 'groupless' : intval($groupId); $userFilter['group_id'] = $groupId; } if ($accountType) { $userFilter['crm'] = 1; } if ($usernameFilter !== null) { $userFilter['username'] = array('REGEXP' => '^' . ($usernameFilter == '0' ? '[0-9]|-|_' : $usernameFilter)); } if ($userStatusFilter !== null) { $userFilter['active'] = $userStatusFilter; } if ($userRoleFilter !== null) { $userFilter['is_admin'] = $userRoleFilter; } if ($orderBy == 'expiration') { $arrOrder['special'] = 'field( tblU.`expiration`, 0' . ($orderDirection == 'desc' ? ', tblU.`expiration`' : null) . ')'; } $arrOrder[$orderBy] = $orderDirection; if ($userCount > 0 && ($objUser = $objFWUser->objUser->getUsers($userFilter, $search, $arrOrder, null, $_CONFIG['corePagingLimit'], $limitOffset)) && ($userCount = $objUser->getFilteredSearchUserCount())) { if ($userCount > $_CONFIG['corePagingLimit']) { $this->_objTpl->setVariable('ACCESS_USER_PAGING', getPaging($userCount, $limitOffset, "&cmd=Access&act=user&groupId=" . $groupId . "&sort=" . htmlspecialchars($orderDirection) . "&by=" . htmlspecialchars($orderBy) . "&search=" . urlencode(urlencode(implode(' ', $search))) . "&username_filter=" . $usernameFilter . "&user_status_filter=" . $userStatusFilter . "&user_role_filter=" . $userRoleFilter, "<b>" . $_ARRAYLANG['TXT_ACCESS_USER'] . "</b>")); } $this->_objTpl->setVariable(array('TXT_ACCESS_LANGUAGE' => $_ARRAYLANG['TXT_ACCESS_LANGUAGE'], 'TXT_ACCESS_ADMINISTRATOR' => $_ARRAYLANG['TXT_ACCESS_ADMINISTRATOR'], 'TXT_ACCESS_FUNCTIONS' => $_ARRAYLANG['TXT_ACCESS_FUNCTIONS'], 'TXT_ACCESS_CHANGE_SORT_DIRECTION' => $_ARRAYLANG['TXT_ACCESS_CHANGE_SORT_DIRECTION'], 'ACCESS_SORT_ID' => $orderBy == 'id' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_STATUS' => $orderBy == 'active' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_USERNAME' => $orderBy == 'username' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_COMPANY' => $orderBy == 'company' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_FIRSTNAME' => $orderBy == 'firstname' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_LASTNAME' => $orderBy == 'lastname' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_EMAIL' => $orderBy == 'email' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_REGDATE' => $orderBy == 'regdate' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_LAST_ACTIVITY' => $orderBy == 'last_activity' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_SORT_EXPIRATION' => $orderBy == 'expiration' && $orderDirection == 'asc' ? 'desc' : 'asc', 'ACCESS_ID' => $_ARRAYLANG['TXT_ACCESS_ID'] . ($orderBy == 'id' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_STATUS' => $_ARRAYLANG['TXT_ACCESS_STATUS'] . ($orderBy == 'active' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_USERNAME' => $_ARRAYLANG['TXT_ACCESS_USERNAME'] . ($orderBy == 'username' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_COMPANY' => $_CORELANG['TXT_ACCESS_COMPANY'] . ($orderBy == 'company' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_FIRSTNAME' => $_CORELANG['TXT_ACCESS_FIRSTNAME'] . ($orderBy == 'firstname' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_LASTNAME' => $_CORELANG['TXT_ACCESS_LASTNAME'] . ($orderBy == 'lastname' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_EMAIL' => $_ARRAYLANG['TXT_ACCESS_EMAIL'] . ($orderBy == 'email' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_REGISTERED_SINCE' => $_ARRAYLANG['TXT_ACCESS_REGISTERED_SINCE'] . ($orderBy == 'regdate' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_LAST_ACTIVITY' => $_ARRAYLANG['TXT_ACCESS_LAST_ACTIVITY'] . ($orderBy == 'last_activity' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_EXPIRATION' => $_ARRAYLANG['TXT_ACCESS_VALIDITY_EXPIRATION'] . ($orderBy == 'expiration' ? $orderDirection == 'asc' ? ' ↑' : ' ↓' : ''), 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search)))); $this->_objTpl->setGlobalVariable(array('TXT_ACCESS_MODIFY_USER_ACCOUNT' => $_ARRAYLANG['TXT_ACCESS_MODIFY_USER_ACCOUNT'], 'ACCESS_GROUP_ID' => $groupId, 'ACCESS_USER_USERNAME_FILTER' => $usernameFilter, 'ACCESS_USER_STATUS_FILTER' => $userStatusFilter, 'ACCESS_USER_ROLE_FILTER' => $userRoleFilter, 'ACCESS_SEARCH_VALUE' => contrexx_raw2xhtml(join(' ', $search)))); $this->_objTpl->setCurrentBlock('access_user_list'); while (!$objUser->EOF) { $firstname = $objUser->getProfileAttribute('firstname'); $lastname = $objUser->getProfileAttribute('lastname'); $company = $objUser->getProfileAttribute('company'); $this->_objTpl->setVariable(array('ACCESS_ROW_CLASS_ID' => $rowNr % 2 ? 1 : 0, 'ACCESS_USER_ID' => $objUser->getId(), 'ACCESS_USER_STATUS_IMG' => $objUser->getActiveStatus() ? 'led_green.gif' : 'led_red.gif', 'ACCESS_USER_STATUS' => $objUser->getActiveStatus() ? $_ARRAYLANG['TXT_ACCESS_ACTIVE'] : $_ARRAYLANG['TXT_ACCESS_INACTIVE'], 'ACCESS_USER_USERNAME' => htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_USER_COMPANY' => !empty($company) ? htmlentities($company, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'ACCESS_USER_FIRSTNAME' => !empty($firstname) ? htmlentities($firstname, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'ACCESS_USER_LASTNAME' => !empty($lastname) ? htmlentities($lastname, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'ACCESS_USER_EMAIL' => htmlentities($objUser->getEmail(), ENT_QUOTES, CONTREXX_CHARSET), 'ACCESS_SEND_EMAIL_TO_USER' => sprintf($_ARRAYLANG['TXT_ACCESS_SEND_EMAIL_TO_USER'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)), 'ACCESS_USER_ADMIN_IMG' => $objUser->getAdminStatus() ? 'admin.png' : 'no_admin.png', 'ACCESS_USER_ADMIN_TXT' => $objUser->getAdminStatus() ? $_ARRAYLANG['TXT_ACCESS_ADMINISTRATOR'] : $_ARRAYLANG['TXT_ACCESS_NO_ADMINISTRATOR'], 'ACCESS_DELETE_USER_ACCOUNT' => sprintf($_ARRAYLANG['TXT_ACCESS_DELETE_USER_ACCOUNT'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)), 'ACCESS_USER_REGDATE' => date(ASCMS_DATE_FORMAT_DATE, $objUser->getRegistrationDate()), 'ACCESS_USER_LAST_ACTIVITY' => $objUser->getLastActivityTime() ? date(ASCMS_DATE_FORMAT_DATE, $objUser->getLastActivityTime()) : '-', 'ACCESS_USER_EXPIRATION' => $objUser->getExpirationDate() ? date(ASCMS_DATE_FORMAT_DATE, $objUser->getExpirationDate()) : '-', 'ACCESS_USER_EXPIRATION_STYLE' => $objUser->getExpirationDate() && $objUser->getExpirationDate() < time() ? 'color:#f00; font-weight:bold;' : null, 'ACCESS_CHANGE_ACCOUNT_STATUS_MSG' => sprintf($objUser->getActiveStatus() ? $_ARRAYLANG['TXT_ACCESS_DEACTIVATE_USER'] : $_ARRAYLANG['TXT_ACCESS_ACTIVATE_USER'], htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET)))); $license = \Env::get('cx')->getLicense(); if (($crmUserId = $objUser->getCrmUserId()) && $license->isInLegalComponents('Crm')) { if ($this->_objTpl->blockExists('access_user_crm_account')) { $this->_objTpl->setVariable(array('ACCESS_USER_CRM_ACCOUNT_ID' => $crmUserId, 'TXT_ACCESS_USER_CRM_ACCOUNT' => $_ARRAYLANG['TXT_ACCESS_USER_CRM_ACCOUNT'])); $this->_objTpl->parse('access_user_crm_account'); } } $rowNr++; $this->_objTpl->parseCurrentBlock(); $objUser->next(); } $this->_objTpl->parse('access_has_users'); $this->_objTpl->hideBlock('access_no_user'); $this->_objTpl->setVariable(array('TXT_ACCESS_CHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_CHECK_ALL'], 'TXT_ACCESS_UNCHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_UNCHECK_ALL'], 'TXT_ACCESS_SELECT_ACTION' => $_ARRAYLANG['TXT_ACCESS_SELECT_ACTION'], 'TXT_ACCESS_DELETE' => $_ARRAYLANG['TXT_ACCESS_DELETE'], 'ACCESS_CONFIRM_DELETE_USERS_TXT' => preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_ACCESS_CONFIRM_DELETE_USERS'])), 'ACCESS_SEARCH_VALUE_ESCAPED' => urlencode(implode(' ', $search)))); $this->_objTpl->parse('access_user_action_dropdown'); } else { $groupName = $groupId == 'groupless' ? $_ARRAYLANG['TXT_ACCESS_GROUPLESS_USERS'] : htmlentities($objGroup->getName(), ENT_QUOTES, CONTREXX_CHARSET); $this->_objTpl->setVariable('ACCESS_STATUS_MSG', count($search) || $usernameFilter != '' ? $_ARRAYLANG['TXT_ACCESS_NO_USERS_FOUND'] : sprintf($_ARRAYLANG['TXT_ACCESS_NO_USER_IN_GROUP'], '«' . $groupName . '»')); $this->_objTpl->parse('access_no_user'); $this->_objTpl->hideBlock('access_has_users'); $this->_objTpl->hideBlock('access_user_action_dropdown'); } $this->_objTpl->parse('module_access_user_overview'); }
function showSearch() { global $_ARRAYLANG, $_CORELANG; $this->_objTpl->setTemplate($this->pageContent, true, true); //get searchform if ($this->_objTpl->blockExists($this->moduleNameLC . 'Searchform')) { $objSearch = new MediaDirectorySearch($this->moduleName); $objSearch->getSearchform($this->_objTpl); } $_GET['term'] = trim($_GET['term']); $cmd = isset($_GET['cmd']) ? contrexx_input2raw($_GET['cmd']) : ''; $intLimitEnd = intval($this->arrSettings['settingsPagingNumEntries']); if (!empty($cmd)) { $objForms = new MediaDirectoryForm(null, $this->moduleName); foreach ($objForms->arrForms as $intFormId => $arrForm) { if (!empty($arrForm['formCmd']) && $arrForm['formCmd'] === $cmd && !empty($arrForm['formEntriesPerPage'])) { $intLimitEnd = $arrForm['formEntriesPerPage']; break; } } } $intLimitStart = isset($_GET['pos']) ? intval($_GET['pos']) : 0; if (!empty($_GET['term']) || $_GET['type'] == 'exp') { $objSearch = new MediaDirectorySearch($this->moduleName); $objSearch->searchEntries($_GET); $objEntries = new MediaDirectoryEntry($this->moduleName); if (!empty($objSearch->arrFoundIds)) { $intNumEntries = count($objSearch->arrFoundIds); for ($i = $intLimitStart; $i < $intLimitStart + $intLimitEnd; $i++) { $intEntryId = isset($objSearch->arrFoundIds[$i]) ? $objSearch->arrFoundIds[$i] : 0; if (intval($intEntryId) != 0) { $objEntries->getEntries($intEntryId, null, null, null, null, null, 1, 0, 1, null, null); } } $objEntries->listEntries($this->_objTpl, 2); $urlParams = $_GET; unset($urlParams['pos']); unset($urlParams['section']); if ($intNumEntries > $intLimitEnd) { $strPaging = getPaging($intNumEntries, $intLimitStart, $urlParams, "<b>" . $_ARRAYLANG['TXT_MEDIADIR_ENTRIES'] . "</b>", true, $intLimitEnd); $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_PAGING' => $strPaging)); } } else { $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_MESSAGE' => $_ARRAYLANG['TXT_MEDIADIR_NO_ENTRIES_FOUND'])); } } else { $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_MESSAGE' => $_ARRAYLANG['TXT_MEDIADIR_NO_SEARCH_TERM'])); } }
function manageEntries() { global $_ARRAYLANG, $_CORELANG, $objDatabase, $_LANGID; $this->_objTpl->loadTemplateFile('module_' . $this->moduleNameLC . '_manage_entries.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_MEDIADIR_MANAGE_ENTRIES']; $this->initFilterSession(); if (isset($_REQUEST['cat_id'])) { $_SESSION[$this->moduleName]['searchFilter']['cat_id'] = intval($_REQUEST['cat_id']); } if (isset($_REQUEST['level_id'])) { $_SESSION[$this->moduleName]['searchFilter']['level_id'] = intval($_REQUEST['level_id']); } if (isset($_REQUEST['form_id'])) { $_SESSION[$this->moduleName]['searchFilter']['form_id'] = intval($_REQUEST['form_id']); } if (isset($_REQUEST['term'])) { $_SESSION[$this->moduleName]['searchFilter']['term'] = $_REQUEST['term'] != $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'] ? $_REQUEST['term'] : null; } //assign the searchFilter session values to corresponding variables $intCategoryId = $_SESSION[$this->moduleName]['searchFilter']['cat_id']; $intLevelId = $_SESSION[$this->moduleName]['searchFilter']['level_id']; $intFormId = $_SESSION[$this->moduleName]['searchFilter']['form_id']; $strTerm = $_SESSION[$this->moduleName]['searchFilter']['term']; $objCategories = new MediaDirectoryCategory(null, null, 1, $this->moduleName); $catDropdown = $objCategories->listCategories(null, 3, $intCategoryId); $objLevels = new MediaDirectoryLevel(null, null, 1, $this->moduleName); $levelDropdown = $objLevels->listLevels(null, 3, $intLevelId); $objForms = new MediaDirectoryForm(null, $this->moduleName); $formDropdown = $objForms->listForms(null, 4, $intFormId); //parse global variables $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_PAGE_TITLE' => $this->pageTitle, 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'], 'TXT_EDIT' => $_ARRAYLANG['TXT_MEDIADIR_EDIT'], 'TXT_SEARCH' => $_CORELANG['TXT_SEARCH'], 'TXT_MEDIADIR_STATUS' => $_CORELANG['TXT_STATUS'], 'TXT_SELECT_ALL' => $_CORELANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_CORELANG['TXT_DESELECT_ALL'], 'TXT_SELECT_ACTION' => $_CORELANG['TXT_MULTISELECT_SELECT'], 'TXT_FUNCTIONS' => $_ARRAYLANG['TXT_MEDIADIR_FUNCTIONS'], 'TXT_DELETE' => $_ARRAYLANG['TXT_MEDIADIR_DELETE'], 'TXT_DELETE_ALL' => $_CORELANG['TXT_MULTISELECT_DELETE'], 'TXT_' . $this->moduleLangVar . '_VOTING' => $_ARRAYLANG['TXT_MEDIADIR_VOTING'], 'TXT_' . $this->moduleLangVar . '_COMMENTS' => $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'], 'TXT_' . $this->moduleLangVar . '_NAME' => $_CORELANG['TXT_NAME'], 'TXT_' . $this->moduleLangVar . '_DATE' => $_CORELANG['TXT_DATE'], 'TXT_' . $this->moduleLangVar . '_AUTHOR' => $_ARRAYLANG['TXT_MEDIADIR_AUTHOR'], 'TXT_' . $this->moduleLangVar . '_HITS' => $_ARRAYLANG['TXT_MEDIADIR_HITS'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_CORELANG['TXT_HISTORY_ACTION'], $this->moduleLangVar . '_SEARCH_TERM' => $strTerm != null ? $strTerm : $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'], 'TXT_' . $this->moduleLangVar . '_ID_OR_SEARCH_TERM' => $_ARRAYLANG['TXT_MEDIADIR_ID_OR_SEARCH_TERM'], $this->moduleLangVar . '_SEARCH_CATEGORY_ID' => $intCategoryId, $this->moduleLangVar . '_SEARCH_LEVEL_ID' => $intLevelId, 'TXT_' . $this->moduleLangVar . '_MOVE_ALL' => $_ARRAYLANG['TXT_MEDIADIR_MOVE_ALL'], 'TXT_' . $this->moduleLangVar . '_RESTORE_VOTING_ALL' => $_ARRAYLANG['TXT_MEDIADIR_RESTORE_VOTING_ALL'], 'TXT_' . $this->moduleLangVar . '_RESTORE_COMMENTS_ALL' => $_ARRAYLANG['TXT_MEDIADIR_RESTORE_COMMENTS_ALL'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_MEDIADIR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_MEDIADIR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_MEDIADIR_MAKE_SELECTION'], 'TXT_SELECT_ALL' => $_CORELANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_CORELANG['TXT_DESELECT_ALL'], 'TXT_SELECT_ACTION' => $_CORELANG['TXT_MULTISELECT_SELECT'], 'TXT_DELETE_ALL' => $_CORELANG['TXT_MULTISELECT_DELETE'], 'TXT_' . $this->moduleLangVar . '_MOVE_ALL' => $_ARRAYLANG['TXT_MEDIADIR_MOVE_ALL'], 'TXT_' . $this->moduleLangVar . '_ALL_LEVELS' => $_ARRAYLANG['TXT_MEDIADIR_ALL_LEVELS'], 'TXT_' . $this->moduleLangVar . '_ALL_CATEGORIES' => $_ARRAYLANG['TXT_MEDIADIR_ALL_CATEGORIES'], 'TXT_' . $this->moduleLangVar . '_ALL_FORMS' => $_ARRAYLANG['TXT_MEDIADIR_ALL_FORMS'], $this->moduleLangVar . '_CATEGORIES_DROPDOWN_OPTIONS' => $catDropdown, $this->moduleLangVar . '_LEVELS_DROPDOWN_OPTIONS' => $levelDropdown, $this->moduleLangVar . '_FORMS_DROPDOWN_OPTIONS' => $formDropdown, 'TXT_' . $this->moduleLangVar . '_FORM' => $_ARRAYLANG['TXT_MEDIADIR_FORM'])); //get seting values parent::getSettings(); if ($this->arrSettings['settingsShowLevels'] == 1) { $this->_objTpl->touchBlock($this->moduleNameLC . 'LevelDropdown'); } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'LevelDropdown'); } if (count($objForms->arrForms) > 1) { $this->_objTpl->touchBlock($this->moduleNameLC . 'FormDropdown'); } else { $this->_objTpl->hideBlock($this->moduleNameLC . 'FormDropdown'); } $objEntries = new MediaDirectoryEntry($this->moduleName); if (isset($_POST['submitEntriesOrderForm'])) { if ($objEntries->saveOrder($_POST)) { $this->strOkMessage = $_CORELANG['TXT_SETTINGS_UPDATED']; } else { $this->strErrMessage = $_CORELANG['TXT_DATABASE_QUERY_ERROR']; } } $objSettings = new MediaDirectorySettings($this->moduleName); if ($this->_objTpl->blockExists('mediadirTableHeaderComments')) { if ($objSettings->arrSettings['settingsAllowComments']) { $this->_objTpl->touchBlock('mediadirTableHeaderComments'); } } if ($this->_objTpl->blockExists('mediadirTableHeaderVotes')) { if ($objSettings->arrSettings['settingsAllowVotes']) { $this->_objTpl->touchBlock('mediadirTableHeaderVotes'); } } switch ($_GET['act']) { case 'move_entry': $this->strErrMessage = "Diese Funktion ist zurzeit noch nicht implementiert."; break; case 'delete_entry': \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static'); if (!isset($_GET['id'])) { foreach ($_POST["entriesFormSelected"] as $intEntryId) { $strStatus = $objEntries->deleteEntry(intval($intEntryId)); } } else { $strStatus = $objEntries->deleteEntry(intval($_GET['id'])); } if ($strStatus) { $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED']; } break; case 'restore_voting': \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static'); $objVotes = new MediaDirectoryVoting($this->moduleName); if (!isset($_GET['id'])) { foreach ($_POST["entriesFormSelected"] as $intEntryId) { $strStatus = $objVotes->restoreVoting(intval($intEntryId)); } } else { $strStatus = $objVotes->restoreVoting(intval($_GET['id'])); } if ($strStatus) { $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_VOTING'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_VOTING'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED']; } break; case 'restore_comments': \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static'); $objComments = new MediaDirectoryComment($this->moduleName); if (!isset($_GET['id'])) { foreach ($_POST["entriesFormSelected"] as $intEntryId) { $strStatus = $objComments->restoreComments(intval($intEntryId)); } } else { $strStatus = $objComments->restoreComments(intval($_GET['id'])); } if ($strStatus) { $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_DELETED']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_COMMENTS'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_DELETED']; } break; break; case 'confirm_entry': \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static'); if (!isset($_GET['id'])) { foreach ($_POST["entriesFormSelected"] as $intEntryId) { $strStatus = $objEntries->confirmEntry(intval($intEntryId)); } } else { $strStatus = $objEntries->confirmEntry(intval($_GET['id'])); } if ($strStatus) { $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_CONFIRM']; } else { $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_CONFIRM']; } break; } $objEntries->getEntries(null, $intLevelId, $intCategoryId, $strTerm, null, null, null, null, 'n', null, null, $intFormId, null, $this->limit, $this->offset); $objEntries->listEntries($this->_objTpl, 1); // Paging $count = $objEntries->countEntries(); $filter = (!empty($strTerm) ? '&term=' . $strTerm : '') . (!empty($intCategoryId) ? '&cat_id=' . $intCategoryId : '') . (!empty($intFormId) ? '&form_id=' . $intFormId : '') . (!empty($intLevelId) ? '&level_id=' . $intLevelId : ''); $term = !empty($strTerm) ? '&term=' . $strTerm : ''; $paging = getPaging($count, $this->offset, '&cmd=' . $this->moduleName . '&act=entries' . $filter, '', true); $this->_objTpl->setGlobalVariable($this->moduleLangVar . '_PAGING', $paging); if (!empty($strTerm)) { $this->_objTpl->setVariable($this->moduleLangVar . '_SEARCH_TERM_PARAMETER', '&term=' . $strTerm); } if (empty($objEntries->arrEntries)) { $this->_objTpl->hideBlock($this->moduleNameLC . 'EntriesSelectAction'); } else { $this->_objTpl->touchBlock($this->moduleNameLC . 'EntriesSelectAction'); } }
private function parseDownloads($objCategory) { global $_CONFIG, $_ARRAYLANG; if (!$this->objTemplate->blockExists('downloads_file_list')) { return; } $limitOffset = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $includeDownloadsOfSubcategories = false; // set downloads filter $filter = array('expiration' => array('=' => 0, '>' => time())); if ($objCategory->getId()) { $filter['category_id'] = $objCategory->getId(); if (!empty($this->searchKeyword)) { $includeDownloadsOfSubcategories = true; } } $objDownload = new Download(); $sortOrder = $this->downloadsSortingOptions[$this->arrConfig['downloads_sorting_order']]; $objDownload->loadDownloads($filter, $this->searchKeyword, $sortOrder, null, $_CONFIG['corePagingLimit'], $limitOffset, $includeDownloadsOfSubcategories); $categoryId = $objCategory->getId(); $allowdDeleteFiles = false; if (!$objCategory->EOF) { $allowdDeleteFiles = !$objCategory->getManageFilesAccessId() || \Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) || $this->userId && $objCategory->getOwnerId() == $this->userId; } elseif (\Permission::hasAllAccess()) { $allowdDeleteFiles = true; } if ($objDownload->EOF) { $this->objTemplate->hideBlock('downloads_file_list'); } else { $row = 1; while (!$objDownload->EOF) { // select category if ($objCategory->EOF) { $arrAssociatedCategories = $objDownload->getAssociatedCategoryIds(); $categoryId = $arrAssociatedCategories[0]; } // parse download info $this->parseDownloadAttributes($objDownload, $categoryId, $allowdDeleteFiles); $this->objTemplate->setVariable('DOWNLOADS_FILE_ROW_CLASS', 'row' . ($row++ % 2 + 1)); $this->objTemplate->parse('downloads_file'); $objDownload->next(); } $downloadCount = $objDownload->getFilteredSearchDownloadCount(); if ($downloadCount > $_CONFIG['corePagingLimit']) { if (\Env::get('cx')->getPage()->getModule() != 'Downloads') { $this->objTemplate->setVariable('DOWNLOADS_FILE_PAGING', getPaging($downloadCount, $limitOffset, '', "<b>" . $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS'] . "</b>")); } else { $this->objTemplate->setVariable('DOWNLOADS_FILE_PAGING', getPaging($downloadCount, $limitOffset, '&' . substr($this->moduleParamsHtml, 1) . '&category=' . $objCategory->getId() . '&downloads_search_keyword=' . htmlspecialchars($this->searchKeyword), "<b>" . $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS'] . "</b>")); } } $this->objTemplate->setVariable(array('TXT_DOWNLOADS_FILES' => $_ARRAYLANG['TXT_DOWNLOADS_FILES'], 'TXT_DOWNLOADS_DOWNLOAD' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD'], 'TXT_DOWNLOADS_DOWNLOADS' => $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS'])); $this->objTemplate->parse('downloads_file_list'); } }
/** * search feed with fulltext * @access public * @return string $status * @global ADONewConnection * @global array */ function searchFeed() { global $objDatabase, $_ARRAYLANG; $this->_objTpl->setTemplate($this->pageContent, true, true); //get position for paging if (!isset($_GET['pos'])) { $_GET['pos'] = '0'; } $pos = intval($_GET['pos']); // TODO: Never used // $searchTermOrg = contrexx_addslashes($_GET['term']); $searchTerm = contrexx_addslashes($_GET['term']); $searchTermGoogle = $searchTerm; $array = explode(' ', $searchTerm); $tmpTerm = ''; for ($x = 0; $x < count($array); $x++) { $tmpTerm .= (empty($tmpTerm) ? '' : '%') . $array[$x]; } //set tree $tree = " » <a href='" . CONTREXX_SCRIPT_PATH . "?section=Directory&cmd=search'>" . $_ARRAYLANG['TXT_DIR_F_SEARCH'] . "</a>"; //get search $this->getSearch(); $searchTermExp = ''; $objResult = $objDatabase->Execute("SELECT id, name, title FROM " . DBPREFIX . "module_directory_inputfields WHERE exp_search='1' ORDER BY sort"); if ($objResult) { while (!$objResult->EOF) { if (!empty($_GET[$objResult->fields['name']]) && $_GET['check'] == 'exp') { $query_search .= "AND " . $objResult->fields['name'] . " LIKE ('%" . contrexx_addslashes($_GET[$objResult->fields['name']]) . "%') "; $searchTermGoogle .= "+" . contrexx_addslashes($_GET[$objResult->fields['name']]); $searchTermExp .= "&" . $objResult->fields['name'] . "=" . contrexx_addslashes($_GET[$objResult->fields['name']]); } $objResult->MoveNext(); } } if ($_GET['cid'] != "" && $_GET['check'] == 'exp') { array_push($this->searchCategories, intval($_GET['cid'])); $this->getCatIds(intval($_GET['cid'])); if (!empty($this->searchCategories)) { foreach ($this->searchCategories as $catId) { $categories .= "(rel_cat.cat_id='" . $catId . "' AND rel_cat.dir_id=files.id) OR "; } } $query_search .= " AND (" . $categories . " (rel_cat.cat_id='" . intval($_GET['cid']) . "' AND rel_cat.dir_id=files.id))"; $searchTermExp .= "&cid=" . intval($_GET['cid']); $db .= DBPREFIX . "module_directory_rel_dir_cat AS rel_cat, "; } if ($_GET['lid'] != "" && $_GET['check'] == 'exp') { array_push($this->searchLevels, intval($_GET['lid'])); $this->getLevelIds(intval($_GET['lid'])); if (!empty($this->searchLevels)) { foreach ($this->searchLevels as $levelId) { $levels .= "(rel_level.level_id='" . $levelId . "' AND rel_level.dir_id=files.id) OR "; } } $query_search .= " AND (" . $levels . " (rel_level.level_id='" . intval($_GET['lid']) . "' AND rel_level.dir_id=files.id))"; $searchTermExp .= "&lid=" . intval($_GET['lid']); $db .= DBPREFIX . "module_directory_rel_dir_level AS rel_level, "; } if ($_GET['check'] == 'norm') { $query_search = "\n OR files.date LIKE ('%{$searchTerm}%')\n OR files.relatedlinks LIKE ('%{$searchTerm}%')\n OR files.link LIKE ('%{$searchTerm}%')\n OR files.platform LIKE ('%{$searchTerm}%')\n OR files.language LIKE ('%{$searchTerm}%')\n OR files.canton LIKE ('%{$searchTerm}%')\n OR files.company_name LIKE ('%{$searchTerm}%')\n OR files.street LIKE ('%{$searchTerm}%')\n OR files.zip LIKE ('%{$searchTerm}%')\n OR files.city LIKE ('%{$searchTerm}%')\n OR files.phone LIKE ('%{$searchTerm}%')\n OR files.contact LIKE ('%{$searchTerm}%')\n OR files.information LIKE ('%{$searchTerm}%')\n OR files.fax LIKE ('%{$searchTerm}%')\n OR files.mobile LIKE ('%{$searchTerm}%')\n OR files.mail LIKE ('%{$searchTerm}%')\n OR files.homepage LIKE ('%{$searchTerm}%')\n OR files.industry LIKE ('%{$searchTerm}%')\n OR files.legalform LIKE ('%{$searchTerm}%')\n OR files.employee LIKE ('%{$searchTerm}%')\n OR files.foundation LIKE ('%{$searchTerm}%')\n OR files.mwst LIKE ('%{$searchTerm}%')\n "; } //internal search /*if ($searchTerm != "" && $_GET['check'] == 'norm') {*/ //get feeds by searchterm $query = "\n SELECT files.id, files.title, files.description, files.link,\n MATCH (files.description) AGAINST ('%{$searchTerm}%') AS score\n FROM " . $db . " " . DBPREFIX . "module_directory_dir AS files\n WHERE ((files.title LIKE ('%{$searchTerm}%') OR files.description LIKE ('%{$searchTerm}%') OR files.searchkeys LIKE ('%{$searchTerm}%'))\n {$query_search})\n AND files.status != 0\n GROUP BY files.id\n ORDER BY files.spezial DESC, score DESC\n "; ////// paging start ///////// $pagingLimit = intval($this->settings['pagingLimit']['value']); $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); $pos = intval($_GET['pos']); // TODO: $term is not defined, possibly $searchTerm? // TODO: $check is not defined // $paging = getPaging($count, $pos, "&section=Directory&cmd=search&term=".$term."&check=".$check.$searchTermExp, "<b>".$_ARRAYLANG['TXT_DIRECTORY_FEEDS']."</b>", true, $pagingLimit); $paging = getPaging($count, $pos, "§ion=Directory&cmd=search&term=" . $searchTerm . $searchTermExp . "&check=" . $_GET['check'], "<b>" . $_ARRAYLANG['TXT_DIRECTORY_FEEDS'] . "</b>", true, $pagingLimit); ////// paging end ///////// $objResult = $objDatabase->SelectLimit($query, $pagingLimit, $pos); //show Feeds if ($objResult) { $i = 0; while (!$objResult->EOF) { //get score // TODO: Never used // $score = $objResult->fields['score']; // TODO: Never used // $scorePercent = ($score >= 1 ? 100 : intval($score*100)); //get votes $this->getVotes($objResult->fields['id']); //get voting $this->getVoting($objResult->fields['id']); //get content $this->getContent($objResult->fields['id'], intval($_GET['cid']), intval($_GET['lid'])); //row class $this->_objTpl->setVariable('DIRECTORY_FEED_ROW', ++$i % 2 ? 'row1' : 'row2'); $this->_objTpl->parse('showResults'); //check paging if ($count < $pagingLimit) { $paging = ""; } $objResult->MoveNext(); } } //Google Search //Googlesearch needs to be tested again. Don't work 100%. $this->settings['google']['googleSeach'] = 0; if ($this->settings['google']['googleSeach'] == "1") { if ($count < 10) { $results = $this->settings['google']['googleResults'] - $count; $this->googleSearch($searchTermGoogle, $results); } } else { if ($count == 0) { $this->_objTpl->hideBlock('showResults'); // set variables $this->_objTpl->setVariable('DIRECTORY_NO_FEEDS_FOUND', $_ARRAYLANG['DIRECTORY_NO_FEEDS_FOUND']); $this->_objTpl->parse('noResults'); } } /* } else { $this->_objTpl->hideBlock('showResults'); // set variables $this->_objTpl->setVariable( 'DIRECTORY_NO_FEEDS_FOUND', $_ARRAYLANG['DIRECTORY_NO_FEEDS_FOUND'] ); $this->_objTpl->parse('noResults'); } */ // set variables $this->_objTpl->setVariable(array('DIRECTORY_CATEGORY_NAVI' => $tree, 'TXT_DIRECTORY_DIR' => $_ARRAYLANG['TXT_DIR_DIRECTORY'], 'TXT_DIRECTORY_SEARCHTERM' => str_replace('%', ' ', $searchTerm), 'SEARCH_PAGING' => $paging)); }
function showMedium($blockFirst = false) { global $_ARRAYLANG, $_CONFIG, $_LANGID; $categoryId = isset($_REQUEST['cid']) ? intval($_REQUEST['cid']) == 0 ? false : intval($_REQUEST['cid']) : false; $mediumId = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; if ($mediumId > 0) { $this->_updateViews($mediumId); } $this->_objTpl->setGlobalVariable(array('TXT_PODCAST_PLAY' => $_ARRAYLANG['TXT_PODCAST_PLAY'], 'TXT_PODCAST_MEDIA_VIEWS' => $_ARRAYLANG['TXT_PODCAST_MEDIA_VIEWS'])); $maxSize = $this->_arrSettings['thumb_max_size']; $tmpOnload = $blockFirst ? 'try{tmp();}catch(e){}' : ''; $embedCode = <<<EOF <script type="text/javascript"> //<![CDATA[ var thumbSizeMax = {$maxSize}; var previewSizeMax = 180; tmp = window.onload; if(tmp == null){ tmp = function(){}; } window.onload = function(){ try{ elPodcastContainer = document.getElementById("podcast_container"); elPodcastContainerLength = elPodcastContainer.childNodes.length; document.getElementById("podcast_container").innerHTML += '%s'; for (childNr = elPodcastContainerLength - 1; childNr >= 0; childNr--) { elPodcastContainer.removeChild(elPodcastContainer.childNodes[childNr]); } }catch(e){} setSize(document.getElementById("podcast_preview"), previewSizeMax); mThumbnails = document.getElementsByName("podcast_thumbnails"); for(i=0;i<mThumbnails.length;i++){ setSize(mThumbnails[i], thumbSizeMax); } {$tmpOnload} } //]]> </script> EOF; if (($arrMedium =& $this->_getMedium($mediumId, true)) !== false) { if ($this->_objTpl->blockExists('podcast_medium')) { $arrTemplate =& $this->_getTemplate($arrMedium['template_id']); $mediumCode = sprintf($embedCode, addcslashes($this->_getHtmlTag($arrMedium, $arrTemplate['template']), "\r\n'")); $this->_objTpl->setVariable(array('PODCAST_MEDIUM_ID' => $mediumId, 'PODCAST_MEDIUM_CATEGORY_ID' => $categoryId, 'PODCAST_MEDIUM_TITLE' => htmlentities($arrMedium['title'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_AUTHOR' => empty($arrMedium['author']) ? '-' : htmlentities($arrMedium['author'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_DESCRIPTION' => htmlentities($arrMedium['description'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_CODE' => $mediumCode, 'PODCAST_MEDIUM_DATE' => date(ASCMS_DATE_FORMAT, $arrMedium['date_added']), 'PODCAST_MEDIUM_SHORT_DATE' => date(ASCMS_DATE_FORMAT_DATE, $arrMedium['date_added']), 'PODCAST_MEDIUM_THUMBNAIL' => htmlentities($arrMedium['thumbnail'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_URL' => htmlentities($arrMedium['source'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIUM_PLAYLENGHT' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIUM_PLAYLENGTH' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIUM_VIEWS' => $this->_getViews($mediumId), 'PODCAST_MEDIUM_FILESIZE' => $this->_formatFileSize($arrMedium['size']))); $this->_objTpl->parse('podcast_medium'); } if ($this->_objTpl->blockExists('podcast_no_medium')) { $this->_objTpl->hideBlock('podcast_no_medium'); } } else { $podcastJavascript = sprintf($embedCode, ''); if ($this->_objTpl->blockExists('podcast_no_medium')) { $this->_objTpl->touchBlock('podcast_no_medium'); } if ($this->_objTpl->blockExists('podcast_medium')) { $this->_objTpl->hideBlock('podcast_medium'); } } $menu = $this->_getCategoriesMenu($categoryId, 'id="podcast_category_menu"', true, true); if ($menu !== false) { $this->_objTpl->setVariable('PODCAST_CATEGORY_MENU', $menu . ' <input type="button" onclick="window.location.href=\'index.php?section=Podcast&' . \Cx\Core\Csrf\Controller\Csrf::param() . '&cid=\'+document.getElementById(\'podcast_category_menu\').value" value="' . $_ARRAYLANG['TXT_PODCAST_SHOW'] . '" />'); } if (intval($categoryId) == 0) { $categories = array_keys($this->_getCategories(true, false, $_LANGID)); } else { $categories = $categoryId; } if ($this->_objTpl->blockExists('podcast_media')) { $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $arrMedia =& $this->_getMedia($categories, true, $_CONFIG['corePagingLimit'], $pos); if (count($arrMedia) > 0) { foreach ($arrMedia as $mediumId => $arrMedium) { $this->_objTpl->setVariable(array('PODCAST_MEDIUM_ROW' => $i % 2 == 0 ? 'row1' : 'row2', 'PODCAST_MEDIA_ID' => $mediumId, 'PODCAST_MEDIA_CATEGORY_ID' => $categoryId, 'PODCAST_MEDIA_TITLE' => htmlentities($arrMedium['title'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_AUTHOR' => htmlentities($arrMedium['author'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_DESCRIPTION' => empty($arrMedium['description']) ? '-' : htmlentities($arrMedium['description'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_DATE' => date(ASCMS_DATE_FORMAT, $arrMedium['date_added']), 'PODCAST_MEDIA_SHORT_DATE' => date(ASCMS_DATE_FORMAT_DATE, $arrMedium['date_added']), 'PODCAST_MEDIA_URL' => htmlentities($arrMedium['source'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_THUMBNAIL' => htmlentities($arrMedium['thumbnail'], ENT_QUOTES, CONTREXX_CHARSET), 'PODCAST_MEDIA_VIEWS' => $this->_getViews($mediumId), 'PODCAST_MEDIA_PLAYLENGHT' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_PLAYLENGTH' => $this->_getPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_SHORT_PLAYLENGHT' => $this->_getShortPlaylengthFormatOfTimestamp($arrMedium['playlength']), 'PODCAST_MEDIA_SHORT_PLAYLENGTH' => $this->_getShortPlaylengthFormatOfTimestamp($arrMedium['playlength']))); $i++; $this->_objTpl->parse('podcast_media'); } } $mediaCount =& $this->_getMediaCount($categoryId, true); if ($mediaCount > $_CONFIG['corePagingLimit']) { $paging = getPaging($mediaCount, $pos, '§ion=Podcast&cid=' . $categoryId, $_ARRAYLANG['TXT_PODCAST_MEDIA']); $this->_objTpl->setVariable('PODCAST_PAGING', $paging); } } $setSizeFunction = $this->_getSetSizeJS(); $podcastJavascript .= <<<EOF <script type="text/javascript"> //<![CDATA[ if(typeof(setSize == 'undefined')){ {$setSizeFunction} } //]]> </script> EOF; $this->_objTpl->setVariable('PODCAST_JAVASCRIPT', $podcastJavascript); }
/** * show protected link downloads * * @return void */ function _showDownloads() { global $_ARRAYLANG, $objDatabase, $_CONFIG; JS::activate('jqueryui'); //delete if $_GET['del'] is set $contactID = intval($_GET['del']); if (!empty($contactID)) { if ($objDatabase->Execute("DELETE FROM " . DBPREFIX . "module_immo_contact WHERE id = {$contactID}") !== false) { $this->_strOkMessage = $_ARRAYLANG['TXT_IMMO_SUCCESSFULLY_DELETED']; $this->_showStats(); return true; } } $this->_pageTitle = $_ARRAYLANG['TXT_IMMO_DOWNLOADS']; $this->_objTpl->loadTemplateFile('module_immo_downloads.html'); $immoID = !empty($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; $_SESSION['immo']['startDate'] = !empty($_REQUEST['inputStartDate']) ? contrexx_addslashes($_REQUEST['inputStartDate']) : $_SESSION['immo']['startDate']; $_SESSION['immo']['endDate'] = !empty($_REQUEST['inputEndDate']) ? contrexx_addslashes($_REQUEST['inputEndDate']) : $_SESSION['immo']['endDate']; //paging data $limit = !empty($_REQUEST['limit']) ? intval($_REQUEST['limit']) : $_CONFIG['corePagingLimit']; $pos = !empty($_REQUEST['pos']) ? intval($_REQUEST['pos']) : 0; $field = !empty($_REQUEST['field']) ? contrexx_addslashes($_REQUEST['field']) : 'visits'; $order = !empty($_REQUEST['order']) ? contrexx_addslashes($_REQUEST['order']) : 'asc'; $hsearchField = !empty($_REQUEST['searchField']) ? $_REQUEST['searchField'] : ''; $hsearch = !empty($_REQUEST['search']) ? contrexx_addslashes($_REQUEST['search']) : ''; $this->_objTpl->setGlobalVariable(array('TXT_IMMO_EXPORT' => $_ARRAYLANG['TXT_IMMO_EXPORT'], 'TXT_IMMO_DOWNLOADS' => $_ARRAYLANG['TXT_IMMO_DOWNLOADS'], 'TXT_IMMO_OBJECT' => $_ARRAYLANG['TXT_IMMO_OBJECT'], 'TXT_IMMO_VISITS' => $_ARRAYLANG['TXT_IMMO_VISITS'], 'TXT_IMMO_HEADER' => $_ARRAYLANG['TXT_IMMO_HEADER'], 'TXT_IMMO_LOCATION' => $_ARRAYLANG['TXT_IMMO_LOCATION'], 'TXT_IMMO_SEARCH' => $_ARRAYLANG['TXT_IMMO_SEARCH'], 'TXT_IMMO_DOWNLOAD_SEARCH' => $_ARRAYLANG['TXT_IMMO_DOWNLOAD_SEARCH'], 'TXT_IMMO_SORT' => $_ARRAYLANG['TXT_IMMO_SORT'], 'TXT_IMMO_IMMO_ID' => $_ARRAYLANG['TXT_IMMO_IMMO_ID'], 'TXT_IMMO_EMAIL' => $_ARRAYLANG['TXT_IMMO_EMAIL'], 'TXT_IMMO_NAME' => $_ARRAYLANG['TXT_IMMO_NAME'], 'TXT_IMMO_FIRSTNAME' => $_ARRAYLANG['TXT_IMMO_FIRSTNAME'], 'TXT_IMMO_COMPANY' => $_ARRAYLANG['TXT_IMMO_COMPANY'], 'TXT_IMMO_STREET' => $_ARRAYLANG['TXT_IMMO_STREET'], 'TXT_IMMO_ZIP' => $_ARRAYLANG['TXT_IMMO_ZIP'], 'TXT_IMMO_LOCATION' => $_ARRAYLANG['TXT_IMMO_LOCATION'], 'TXT_IMMO_TELEPHONE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE'], 'TXT_IMMO_TELEPHONE_OFFICE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE_OFFICE'], 'TXT_IMMO_TELEPHONE_MOBILE' => $_ARRAYLANG['TXT_IMMO_TELEPHONE_MOBILE'], 'TXT_IMMO_PURCHASE' => $_ARRAYLANG['TXT_IMMO_PURCHASE'], 'TXT_IMMO_FUNDING' => $_ARRAYLANG['TXT_IMMO_FUNDING'], 'TXT_IMMO_COMMENT' => $_ARRAYLANG['TXT_IMMO_COMMENT'], 'TXT_IMMO_TIMESTAMP' => $_ARRAYLANG['TXT_IMMO_TIMESTAMP'], 'TXT_IMMO_EXPORT' => $_ARRAYLANG['TXT_IMMO_EXPORT'], 'TXT_IMMO_FUNCTIONS' => $_ARRAYLANG['TXT_IMMO_FUNCTIONS'], 'TXT_IMMO_SEPARATOR' => $_ARRAYLANG['TXT_IMMO_SEPARATOR'], 'TXT_IMMO_EDIT' => $_ARRAYLANG['TXT_IMMO_EDIT'], 'TXT_IMMO_DELETE' => $_ARRAYLANG['TXT_IMMO_DELETE'], 'TXT_IMMO_CONFIRM_DELETE_CONTACT' => $_ARRAYLANG['TXT_IMMO_CONFIRM_DELETE_CONTACT'], 'TXT_IMMO_CANNOT_UNDO_OPERATION' => $_ARRAYLANG['TXT_IMMO_CANNOT_UNDO_OPERATION'], 'TXT_IMMO_DETAILS' => $_ARRAYLANG['TXT_IMMO_DETAILS'], 'TXT_IMMO_TIMESPAN' => $_ARRAYLANG['TXT_IMMO_TIMESPAN'], 'TXT_IMMO_FROM' => $_ARRAYLANG['TXT_IMMO_FROM'], 'TXT_IMMO_TO' => $_ARRAYLANG['TXT_IMMO_TO'], 'TXT_IMMO_INTERESTS' => $_ARRAYLANG['TXT_IMMO_INTERESTS'], 'TXT_IMMO_DOWNLOAD_LIST' => $_ARRAYLANG['TXT_IMMO_DOWNLOAD_LIST'], 'TXT_IMMO_INTEREST_SEARCH' => $_ARRAYLANG['TXT_IMMO_INTEREST_SEARCH'], 'TXT_IMMO_SHOW_TIMESPAN_DETAILS' => $_ARRAYLANG['TXT_IMMO_SHOW_TIMESPAN_DETAILS'], 'TXT_IMMO_IGNORE_TIMESPAN' => $_ARRAYLANG['TXT_IMMO_IGNORE_TIMESPAN'], 'TXT_IMMO_REFRESH' => $_ARRAYLANG['TXT_IMMO_REFRESH'], 'CALENDAR_TODAY' => !empty($_SESSION['immo']['startDate']) ? $_SESSION['immo']['startDate'] : date('Y-m-d', strtotime('-1 month')), 'CALENDAR_NEXT_MONTH' => !empty($_SESSION['immo']['endDate']) ? $_SESSION['immo']['endDate'] : date('Y-m-d'), 'PATH_OFFSET' => ASCMS_PATH_OFFSET, 'IMMO_FORM_ACTION_ID' => $immoID, 'IMMO_ID' => $immoID, 'IMMO_PAGING_LIMIT' => $limit, 'IMMO_PAGING_POS' => $pos, 'IMMO_PAGING_FIELD' => $field, 'IMMO_HSEARCH_FIELD' => $hsearchField, 'IMMO_HSEARCH' => $hsearch)); $rowclass = 2; //get contact and download stats $searchTerm = !empty($_REQUEST['search']) ? " LIKE '%" . contrexx_addslashes($_REQUEST['search']) . "%'" : ' TRUE'; $searchField = !empty($_REQUEST['searchField']) && !empty($_REQUEST['search']) ? ' WHERE ' . contrexx_addslashes($_REQUEST['searchField']) : ' WHERE '; $query = " SELECT `contact`.`id` , `email` , `name` , `firstname` , `street` , `zip` , `location` ,\n `company` , `telephone` , `telephone_office` , `telephone_mobile` , `purchase` ,\n `funding` , `comment` , `contact`.`immo_id` , `timestamp`, content1.fieldvalue AS immo_header, content2.fieldvalue AS immo_address, content3.fieldvalue AS immo_location\n FROM `" . DBPREFIX . "module_immo_contact` AS contact\n LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content1 ON content1.immo_id = contact.id\n AND content1.lang_id =1\n AND content1.field_id = (\n SELECT field_id\n FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n WHERE lower( name ) = '" . $this->_headline . "'\n AND fname.lang_id =1\n )\n LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content2 ON content2.immo_id = contact.id\n AND content2.lang_id =1\n AND content2.field_id = (\n SELECT field_id\n FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n WHERE lower( name ) = 'adresse'\n AND fname.lang_id =1\n )\n LEFT JOIN `" . DBPREFIX . "module_immo_content` AS content3 ON content3.immo_id = contact.id\n AND content3.lang_id =1\n AND content3.field_id = (\n SELECT field_id\n FROM `" . DBPREFIX . "module_immo_fieldname` AS fname\n WHERE lower( name ) = 'ort'\n AND fname.lang_id =1\n )" . $searchField . " " . $searchTerm; if ($immoID > 0) { $query .= " AND contact.immo_id = {$immoID} "; } if (empty($_REQUEST['ignore_timespan']) && !empty($_SESSION['immo']['startDate'])) { $query .= " AND `timestamp` BETWEEN " . strtotime($_SESSION['immo']['startDate']) . " AND " . strtotime($_SESSION['immo']['endDate']) . " ORDER BY timestamp DESC"; } if (($objRS = $objDatabase->Execute($query)) !== false) { $count = $objRS->RecordCount(); $objRS = $objDatabase->SelectLimit($query, $limit, $pos); while (!$objRS->EOF) { $this->_objTpl->setVariable(array('IMMO_CONTACT_ID' => intval($objRS->fields['id']), 'IMMO_IMMO_ID' => htmlspecialchars($objRS->fields['immo_id']), 'IMMO_OBJECT_HEADER' => htmlspecialchars($objRS->fields['immo_header']), 'IMMO_OBJECT_ADDRESS' => htmlspecialchars($objRS->fields['immo_address']), 'IMMO_OBJECT_LOCATION' => htmlspecialchars($objRS->fields['immo_location']), 'IMMO_EMAIL' => htmlspecialchars($objRS->fields['email']), 'IMMO_NAME' => htmlspecialchars($objRS->fields['name']), 'IMMO_FIRSTNAME' => htmlspecialchars($objRS->fields['firstname']), 'IMMO_COMPANY' => htmlspecialchars($objRS->fields['company']), 'IMMO_STREET' => htmlspecialchars($objRS->fields['street']), 'IMMO_ZIP' => htmlspecialchars($objRS->fields['zip']), 'IMMO_LOCATION' => htmlspecialchars($objRS->fields['location']), 'IMMO_TELEPHONE' => htmlspecialchars($objRS->fields['telephone']), 'IMMO_TELEPHONE_OFFICE' => htmlspecialchars($objRS->fields['telephone_office']), 'IMMO_TELEPHONE_MOBILE' => htmlspecialchars($objRS->fields['telephone_mobile']), 'IMMO_PURCHASE' => htmlspecialchars($objRS->fields['purchase']), 'IMMO_FUNDING' => htmlspecialchars($objRS->fields['funding']), 'IMMO_COMMENT' => str_replace(array("\r\n", "\n"), '<br />', htmlspecialchars($objRS->fields['comment'])), 'IMMO_COMMENT_TEXT' => str_replace(array("\r\n", "\n"), '<br />', htmlspecialchars($objRS->fields['comment'])), 'IMMO_TIMESTAMP' => date(ASCMS_DATE_FORMAT, $objRS->fields['timestamp']), 'ROW_CLASS' => $rowclass++ % 2 == 0 ? 'row1' : 'row2')); $this->_objTpl->parse('downloads'); $objRS->MoveNext(); } } $this->_objTpl->setVariable(array('IMMO_STATS_DOWNLOADS_PAGING' => getPaging($count, $pos, '&cmd=immo&act=downloads&limit=' . $limit, '', true))); }
function getFormEntries($formId, &$arrCols, $pagingPos, &$paging, $limit = true) { global $objDatabase, $_CONFIG, $_ARRAYLANG; $arrEntries = array(); $arrCols = array(); $query = "SELECT `id`, `id_lang`, `time`, `host`, `lang`, `ipaddress`\n FROM " . DBPREFIX . "module_contact_form_data\n WHERE id_form = " . $formId . "\n ORDER BY `time` DESC"; $objEntry = $objDatabase->Execute($query); $count = $objEntry->RecordCount(); if ($limit && $count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pagingPos, "&cmd=Contact&act=forms&tpl=entries&formId=" . $formId, $_ARRAYLANG['TXT_CONTACT_FORM_ENTRIES']); $objEntry = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pagingPos); } if ($objEntry !== false) { while (!$objEntry->EOF) { $arrData = array(); $objResult = $objDatabase->SelectLimit("SELECT `id_field`, `formlabel`, `formvalue`\n FROM " . DBPREFIX . "module_contact_form_submit_data\n WHERE id_entry=" . $objEntry->fields['id'] . "\n ORDER BY id"); while (!$objResult->EOF) { $field_id = $objResult->fields['id_field']; $arrData[$field_id] = $objResult->fields['formvalue']; // TODO: What is this good for? // if($field_id == 'unique_id') //skip unique id of each entry, we do not want to display this. // continue; if (!in_array($field_id, $arrCols)) { array_push($arrCols, $field_id); } $objResult->MoveNext(); } $arrEntries[$objEntry->fields['id']] = array('langId' => $objEntry->fields['id_lang'], 'time' => $objEntry->fields['time'], 'host' => $objEntry->fields['host'], 'lang' => $objEntry->fields['lang'], 'ipaddress' => $objEntry->fields['ipaddress'], 'data' => $arrData); $objEntry->MoveNext(); } } return $arrEntries; }
private function members($groupId = null) { global $_ARRAYLANG, $_CONFIG; $groupId = !empty($groupId) ? $groupId : (isset($_REQUEST['groupId']) ? intval($_REQUEST['groupId']) : 0); $search = isset($_REQUEST['search']) && !empty($_REQUEST['search']) ? preg_split('#\\s+#', $_REQUEST['search']) : array(); $limitOffset = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $usernameFilter = isset($_REQUEST['username_filter']) && $_REQUEST['username_filter'] != '' && in_array(ord($_REQUEST['username_filter']), array_merge(array(48), range(65, 90))) ? $_REQUEST['username_filter'] : null; $userFilter = array('active' => true); $this->parseLetterIndexList('index.php?section=Access&cmd=members&groupId=' . $groupId, 'username_filter', $usernameFilter); $this->_objTpl->setVariable('ACCESS_SEARCH_VALUE', htmlentities(join(' ', $search), ENT_QUOTES, CONTREXX_CHARSET)); if ($groupId) { $userFilter['group_id'] = $groupId; } if ($usernameFilter !== null) { $userFilter['username'] = array('REGEXP' => '^' . ($usernameFilter == '0' ? '[0-9]|-|_' : $usernameFilter)); } $objFWUser = \FWUser::getFWUserObject(); $objGroup = $objFWUser->objGroup->getGroup($groupId); if ($objGroup->getType() == 'frontend' && $objGroup->getUserCount() > 0 && ($objUser = $objFWUser->objUser->getUsers($userFilter, $search, array('username' => 'asc'), null, $_CONFIG['corePagingLimit'], $limitOffset)) && ($userCount = $objUser->getFilteredSearchUserCount())) { if ($userCount > $_CONFIG['corePagingLimit']) { $this->_objTpl->setVariable('ACCESS_USER_PAGING', getPaging($userCount, $limitOffset, "§ion=Access&cmd=members&groupId=" . $groupId . "&search=" . htmlspecialchars(implode(' ', $search), ENT_QUOTES, CONTREXX_CHARSET) . "&username_filter=" . $usernameFilter, "<strong>" . $_ARRAYLANG['TXT_ACCESS_MEMBERS'] . "</strong>")); } $this->_objTpl->setVariable('ACCESS_GROUP_NAME', ($objGroup = $objFWUser->objGroup->getGroup($groupId)) && $objGroup->getId() ? htmlentities($objGroup->getName(), ENT_QUOTES, CONTREXX_CHARSET) : $_ARRAYLANG['TXT_ACCESS_MEMBERS']); $arrBuddyIds = \Cx\Modules\U2u\Controller\U2uLibrary::getIdsOfBuddies(); $nr = 0; while (!$objUser->EOF) { $this->parseAccountAttributes($objUser); $this->_objTpl->setVariable('ACCESS_USER_ID', $objUser->getId()); $this->_objTpl->setVariable('ACCESS_USER_CLASS', $nr++ % 2 + 1); if ($objUser->getProfileAccess() == 'everyone' || $objFWUser->objUser->login() && ($objUser->getId() == $objFWUser->objUser->getId() || $objUser->getProfileAccess() == 'members_only' || $objFWUser->objUser->getAdminStatus())) { $objUser->objAttribute->first(); while (!$objUser->objAttribute->EOF) { $objAttribute = $objUser->objAttribute->getById($objUser->objAttribute->getId()); $this->parseAttribute($objUser, $objAttribute->getId(), 0, false, false, false, false, false); $objUser->objAttribute->next(); } } else { $this->parseAttribute($objUser, 'picture', 0, false, false, false, false, false); $this->parseAttribute($objUser, 'gender', 0, false, false, false, false, false); } if ($this->_objTpl->blockExists('u2u_addaddress')) { if ($objUser->getId() == $objFWUser->objUser->getId() || in_array($objUser->getId(), $arrBuddyIds)) { $this->_objTpl->hideBlock('u2u_addaddress'); } else { $this->_objTpl->touchBlock('u2u_addaddress'); } } $this->_objTpl->parse('access_user'); $objUser->next(); } $this->_objTpl->parse('access_members'); } else { $this->_objTpl->hideBlock('access_members'); } }
public function getPage($pos, $page_content) { global $_CONFIG, $_ARRAYLANG; $objTpl = new \Cx\Core\Html\Sigma('.'); \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTpl); $objTpl->setErrorHandling(PEAR_ERROR_DIE); $objTpl->setTemplate($page_content); $objTpl->setGlobalVariable($_ARRAYLANG); // Load main template even if we have a cmd set if ($objTpl->placeholderExists('APPLICATION_DATA')) { $page = new \Cx\Core\ContentManager\Model\Entity\Page(); $page->setVirtual(true); $page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION); $page->setModule('Search'); // load source code $applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page); \LinkGenerator::parseTemplate($applicationTemplate); $objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate); } $term = isset($_REQUEST['term']) ? trim(contrexx_input2raw($_REQUEST['term'])) : ''; if (strlen($term) >= 3) { $term = trim(contrexx_input2raw($_REQUEST['term'])); $this->setTerm($term); $eventHandlerInstance = \Env::get('cx')->getEvents(); $eventHandlerInstance->triggerEvent('SearchFindContent', array($this)); if ($this->result->size() == 1) { $arraySearchResults[] = $this->result->toArray(); } else { $arraySearchResults = $this->result->toArray(); } usort($arraySearchResults, function ($a, $b) { if ($a['Score'] == $b['Score']) { if (isset($a['Date'])) { if ($a['Date'] == $b['Date']) { return 0; } if ($a['Date'] > $b['Date']) { return -1; } return 1; } return 0; } if ($a['Score'] > $b['Score']) { return -1; } return 1; }); $countResults = sizeof($arraySearchResults); if (!is_numeric($pos)) { $pos = 0; } $paging = getPaging($countResults, $pos, '&section=Search&term=' . contrexx_raw2encodedUrl($term), '<b>' . $_ARRAYLANG['TXT_SEARCH_RESULTS'] . '</b>', true); $objTpl->setVariable('SEARCH_PAGING', $paging); $objTpl->setVariable('SEARCH_TERM', contrexx_raw2xhtml($term)); if ($countResults > 0) { $searchComment = sprintf($_ARRAYLANG['TXT_SEARCH_RESULTS_ORDER_BY_RELEVANCE'], contrexx_raw2xhtml($term), $countResults); $objTpl->setVariable('SEARCH_TITLE', $searchComment); $arraySearchOut = array_slice($arraySearchResults, $pos, $_CONFIG['corePagingLimit']); foreach ($arraySearchOut as $details) { // append search term to result link $link = $details['Link']; if (strpos($link, '?') === false) { $link .= '?'; } else { $link .= '&'; } $link .= 'searchTerm=' . urlencode($term); // parse result into template $objTpl->setVariable(array('COUNT_MATCH' => $_ARRAYLANG['TXT_RELEVANCE'] . ' ' . $details['Score'] . '%', 'LINK' => '<b><a href="' . $link . '" title="' . contrexx_raw2xhtml($details['Title']) . '">' . contrexx_raw2xhtml($details['Title']) . '</a></b>', 'SHORT_CONTENT' => contrexx_raw2xhtml($details['Content']))); $objTpl->parse('search_result'); } return $objTpl->get(); } } $noresult = $term != '' ? sprintf($_ARRAYLANG['TXT_NO_SEARCH_RESULTS'], $term) : $_ARRAYLANG['TXT_PLEASE_ENTER_SEARCHTERM']; $objTpl->setVariable('SEARCH_TITLE', $noresult); return $objTpl->get(); }
/** * * creates the Array of messages for the users whom they sent... * @global $objDatabase */ function createEntryDetailsOutbox($userID, $pos) { global $objDatabase, $_CONFIG, $_ARRAYLANG; $userID = intval($userID); $selMessage = 'SELECT Log.message_text, Log.message_title, Log.message_id, User.username, sentMsg.userid, sentMsg.date_time FROM ' . DBPREFIX . 'module_u2u_sent_messages sentMsg, ' . DBPREFIX . 'module_u2u_message_log Log, ' . DBPREFIX . 'access_users User WHERE sentMsg.userid=' . $userID . ' AND User.id=sentMsg.receiver_id AND User.active!=0 AND Log.message_id=sentMsg.message_id AND sentMsg.mesage_open_status="0" ORDER BY sentMsg.date_time DESC'; //$pos = intval($_GET['pos']); $objResult = $objDatabase->Execute($selMessage); $count = $objResult->RecordCount(); $this->counter = $count; $paging = getPaging($count, $pos, "§ion=U2u&cmd=outbox", "<b>" . $_ARRAYLANG['TXT_OUTBOX_PAGING'] . "</b>", true); $selMessage = 'SELECT Log.message_text, Log.message_title, Log.message_id, User.username, sentMsg.userid, sentMsg.date_time FROM ' . DBPREFIX . 'module_u2u_sent_messages sentMsg, ' . DBPREFIX . 'module_u2u_message_log Log, ' . DBPREFIX . 'access_users User WHERE sentMsg.userid=' . $userID . ' AND User.id=sentMsg.receiver_id AND User.active!=0 AND Log.message_id=sentMsg.message_id AND sentMsg.mesage_open_status="0" ORDER BY sentMsg.date_time DESC'; $objResult = $objDatabase->SelectLimit($selMessage, $_CONFIG['corePagingLimit'], $pos); $this->paginationCount = $paging; //$objResult = $objDatabase->Execute($selMessage); while (!$objResult->EOF) { $messageID = $objResult->fields['message_id']; $arrMessage[$messageID]["message"] = $objResult->fields['message_text']; $arrMessage[$messageID]["message_title"] = $objResult->fields['message_title']; $arrMessage[$messageID]["username"] = $objResult->fields['username']; $arrMessage[$messageID]["date_time"] = $objResult->fields['date_time']; $objResult->MoveNext(); } return $arrMessage; }
/** * List the jobs * @global object $objDatabase * @param integer $newsid * @param string $what * @return string $output */ function overview() { global $objDatabase, $_ARRAYLANG, $_CONFIG; // initialize variables $i = 0; $jobslocationform = ''; $location = ''; $docFilter = ''; $locationFilter = ' WHERE '; $this->pageTitle = $_ARRAYLANG['TXT_JOBS_MANAGER']; $this->_objTpl->loadTemplateFile('module_jobs_list.html', true, true); $this->_objTpl->setVariable(array('TXT_EDIT_JOBS_MESSAGE' => $_ARRAYLANG['TXT_EDIT_DOCUMENTS'], 'TXT_EDIT_JOBS_ID' => $_ARRAYLANG['TXT_DOCUMENT_ID'], 'TXT_ARCHIVE' => $_ARRAYLANG['TXT_ARCHIVE'], 'TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_USER' => $_ARRAYLANG['TXT_USER'], 'TXT_LAST_EDIT' => $_ARRAYLANG['TXT_LAST_EDIT'], 'TXT_ACTION' => $_ARRAYLANG['TXT_ACTION'], 'TXT_CATEGORY' => $_ARRAYLANG['TXT_CATEGORY'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_DOCUMENT_DELETE_CONFIRM'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL'], 'TXT_REMOVE_SELECTION' => $_ARRAYLANG['TXT_REMOVE_SELECTION'], 'TXT_EDIT' => $_ARRAYLANG['TXT_EDIT'], 'TXT_TEMPLATE' => $_ARRAYLANG['TXT_TEMPLATE'], 'TXT_MARKED' => $_ARRAYLANG['TXT_MARKED'], 'TXT_ACTIVATE' => $_ARRAYLANG['TXT_ACTIVATE'], 'TXT_DEACTIVATE' => $_ARRAYLANG['TXT_DEACTIVATE'], 'TXT_STATUS' => $_ARRAYLANG['TXT_STATUS'], 'TXT_AUTHOR' => $_ARRAYLANG['TXT_AUTHOR'], 'TXT_JOBS_SEARCH' => $_ARRAYLANG['TXT_JOBS_SEARCH'])); /* check if locations are activated */ $query = "\n SELECT `value`\n FROM `" . DBPREFIX . "module_jobs_settings`\n WHERE name='show_location_fe'"; $objResult = $objDatabase->Execute($query); //return if location fields are not activated in the backend if (!$objResult->EOF) { if (intval($objResult->fields['value']) == 1) { if (isset($_REQUEST['location']) && is_numeric($_REQUEST['location'])) { $location = $_REQUEST['location']; $locationFilter = ", `" . DBPREFIX . "module_jobs_rel_loc_jobs` AS rel WHERE rel.job = n.id AND rel.location = '" . $location . "' AND "; } $jobslocationform = '<select name="location">' . '<option selected="selected" value="">' . $_ARRAYLANG['TXT_LOCATION'] . '</option>' . $this->getLocationMenu($location) . '</select>'; } } if (isset($_REQUEST['category']) && is_numeric($_REQUEST['category'])) { $category = $_REQUEST['category']; $docFilter = " n.catid='{$category}' AND "; } $jobscategoryform = '<select name="category">' . '<option selected="selected" value="">' . $_ARRAYLANG['TXT_CATEGORY'] . '</option>' . $this->getCategoryMenu($this->langId, $category) . '</select>'; $this->_objTpl->setVariable(array('JOBS_CATEGORY_FORM' => $jobscategoryform, 'JOBS_LOCATION_FORM' => $jobslocationform, 'TXT_SUBMIT' => $_ARRAYLANG['TXT_SUBMIT'])); $this->_objTpl->setGlobalVariable(array('TXT_DELETE' => $_ARRAYLANG['TXT_DELETE'])); $query = "SELECT n.id AS jobsId, n.date, n.changelog,\n n.title, n.status, n.author,\n l.name,\n nc.name AS catname,\n n.userid\n FROM " . DBPREFIX . "module_jobs_categories AS nc,\n " . DBPREFIX . "module_jobs AS n,\n " . DBPREFIX . "languages AS l\n {$locationFilter}\n n.lang=l.id\n AND n.lang={$this->langId}\n AND {$docFilter} nc.catid=n.catid\n ORDER BY n.id DESC"; $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $paging = $count > intval($_CONFIG['corePagingLimit']) ? getPaging($count, $pos, "&cmd=Jobs&location=" . $location . "&category=" . $category . "&", $_ARRAYLANG['TXT_DOCUMENTS '], true) : ""; $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); if (!$objResult || $objResult->EOF) { $this->_objTpl->hideBlock('row'); return; } while ($objResult !== false && !$objResult->EOF) { $statusPicture = $objResult->fields['status'] == 1 ? "status_green.gif" : "status_red.gif"; $jobUser = \FWUser::getFWUserObject()->objUser->getUser($objResult->fields['userid']); $username = $_ARRAYLANG['TXT_ACCESS_UNKNOWN']; if ($jobUser) { $username = $jobUser->getUsername(); } $this->_objTpl->setVariable(array('JOBS_ID' => $objResult->fields['jobsId'], 'JOBS_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['date']), 'JOBS_TITLE' => stripslashes($objResult->fields['title']), 'JOBS_AUTHOR' => stripslashes($objResult->fields['author']), 'JOBS_USER' => $username, 'JOBS_CHANGELOG' => date(ASCMS_DATE_FORMAT, $objResult->fields['changelog']), 'JOBS_PAGING' => $paging, 'JOBS_CLASS' => ++$i % 2 ? "row2" : "row1", 'JOBS_CATEGORY' => $objResult->fields['catname'], 'JOBS_STATUS' => $objResult->fields['status'], 'JOBS_STATUS_PICTURE' => $statusPicture, 'TXT_TEMPLATE' => $_ARRAYLANG['TXT_TEMPLATE'], 'TXT_EDIT' => $_ARRAYLANG['TXT_EDIT'])); $this->_objTpl->parse('row'); $objResult->MoveNext(); } }
/** * Shows an overview of all socializing networks which are currently existing in the database. In the second tab * an "add network"-form is shown. * * @global array * @global array */ function showNetworks() { global $_CORELANG, $_ARRAYLANG; $this->_strPageTitle = $_CORELANG['TXT_BLOG_NETWORKS_TITLE']; $this->_objTpl->loadTemplateFile('module_blog_networks.html', true, true); //Show existing networks $this->_objTpl->setVariable(array('TXT_OVERVIEW_TITLE' => $_CORELANG['TXT_BLOG_NETWORKS_TITLE'], 'TXT_OVERVIEW_SUBTITLE_NAME' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_NAME'], 'TXT_OVERVIEW_SUBTITLE_URL' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_SUBMIT'], 'TXT_OVERVIEW_SUBTITLE_LANGUAGES' => $_ARRAYLANG['TXT_BLOG_CATEGORY_ADD_LANGUAGES'], 'TXT_OVERVIEW_SUBTITLE_ACTIONS' => $_ARRAYLANG['TXT_BLOG_CATEGORY_MANAGE_ACTIONS'], 'TXT_OVERVIEW_DELETE_NETWORK_JS' => $_ARRAYLANG['TXT_BLOG_NETWORKS_DELETE_JS'], 'TXT_OVERVIEW_MARKED' => $_ARRAYLANG['TXT_BLOG_CATEGORY_MANAGE_SUBMIT_MARKED'], 'TXT_OVERVIEW_SELECT_ALL' => $_ARRAYLANG['TXT_BLOG_CATEGORY_MANAGE_SUBMIT_SELECT'], 'TXT_OVERVIEW_DESELECT_ALL' => $_ARRAYLANG['TXT_BLOG_CATEGORY_MANAGE_SUBMIT_DESELECT'], 'TXT_OVERVIEW_SUBMIT_SELECT' => $_ARRAYLANG['TXT_BLOG_CATEGORY_MANAGE_SUBMIT_ACTION'], 'TXT_OVERVIEW_SUBMIT_DELETE' => $_ARRAYLANG['TXT_BLOG_NETWORKS_OVERVIEW_SUBMIT_DELETE'], 'TXT_OVERVIEW_SUBMIT_DELETE_JS' => $_ARRAYLANG['TXT_BLOG_NETWORKS_OVERVIEW_SUBMIT_DELETE_JS'])); $intPagingPosition = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $arrNetworks = $this->createNetworkArray($intPagingPosition, $this->getPagingLimit()); if (count($arrNetworks) > 0) { $intEntryCounter = 0; foreach ($arrNetworks as $intNetworkId => $arrNetworkValues) { $this->_objTpl->setVariable(array('TXT_OVERVIEW_IMGALT_EDIT' => $_ARRAYLANG['TXT_BLOG_NETWORKS_EDIT_TITLE'], 'TXT_OVERVIEW_IMGALT_DELETE' => $_ARRAYLANG['TXT_BLOG_NETWORKS_DELETE_TITLE'])); $strActivatedLanguages = ''; foreach ($arrNetworkValues['status'] as $intLanguageId => $intStatus) { if ($intStatus == 1 && array_key_exists($intLanguageId, $this->_arrLanguages)) { $strActivatedLanguages .= $this->_arrLanguages[$intLanguageId]['long'] . ' [' . $this->_arrLanguages[$intLanguageId]['short'] . '], '; } } $strActivatedLanguages = substr($strActivatedLanguages, 0, -2); $this->_objTpl->setVariable(array('OVERVIEW_NETWORK_ROWCLASS' => $intEntryCounter % 2 == 1 ? 'row1' : 'row2', 'OVERVIEW_NETWORK_ID' => $intNetworkId, 'OVERVIEW_NETWORK_ICON' => '<img src="../' . $arrNetworkValues['icon'] . '" title="' . $arrNetworkValues['name'] . '" alt="' . $arrNetworkValues['name'] . '" />', 'OVERVIEW_NETWORK_NAME' => $arrNetworkValues['name'], 'OVERVIEW_NETWORK_URL' => $arrNetworkValues['submit'], 'OVERVIEW_NETWORK_LANGUAGES' => $strActivatedLanguages)); ++$intEntryCounter; $this->_objTpl->parse('showNetworks'); } //Show paging if needed if ($this->countNetworks() > $this->getPagingLimit()) { $strPaging = getPaging($this->countNetworks(), $intPagingPosition, '&cmd=Blog&act=networks', '<strong>' . $_ARRAYLANG['TXT_BLOG_NETWORKS'] . '</strong>', true, $this->getPagingLimit()); $this->_objTpl->setVariable('OVERVIEW_PAGING', $strPaging); } } else { $this->_objTpl->setVariable('TXT_OVERVIEW_NO_NETWORKS_FOUND', $_ARRAYLANG['TXT_BLOG_NETWORKS_OVERVIEW_NONE']); $this->_objTpl->parse('noNetworks'); } //Show ADD form //Get media browser code. $options = array('type' => 'button', 'id' => 'mediabrowser_button', 'data-cx-mb-views' => 'filebrowser', 'data-cx-mb-startmediatype' => 'blog'); $mediaBrowser = self::getMediaBrowserButton($_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_BROWSE'], $options, 'blogSetUrl'); $this->_objTpl->setVariable(array('TXT_ADD_TITLE' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_TITLE'], 'TXT_ADD_NAME' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_NAME'], 'TXT_ADD_WWW' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_WWW'], 'TXT_ADD_SUBMIT_URL' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_SUBMIT'], 'TXT_ADD_ICON' => $_ARRAYLANG['TXT_BLOG_NETWORKS_ADD_ICON'], 'TXT_ADD_LANGUAGES' => $_ARRAYLANG['TXT_BLOG_CATEGORY_ADD_LANGUAGES'], 'TXT_ADD_SUBMIT' => $_ARRAYLANG['TXT_BLOG_SAVE'], 'BLOG_MEDIABROWSER_BUTTON' => $mediaBrowser)); if (count($this->_arrLanguages) > 0) { $intCounter = 0; $arrLanguages = array(0 => '', 1 => '', 2 => ''); foreach ($this->_arrLanguages as $intLanguageId => $arrTranslations) { $arrLanguages[$intCounter % 3] .= '<input checked="checked" type="checkbox" name="frmAddNetwork_Languages[]" value="' . $intLanguageId . '" />' . $arrTranslations['long'] . ' [' . $arrTranslations['short'] . ']<br />'; ++$intCounter; } $this->_objTpl->setVariable(array('ADD_LANGUAGES_1' => $arrLanguages[0], 'ADD_LANGUAGES_2' => $arrLanguages[1], 'ADD_LANGUAGES_3' => $arrLanguages[2])); } }
/** * Gets the list with the headlines * * @global object $objDatabase * @return string parsed content */ function getTitles() { global $_CONFIG, $objDatabase, $_ARRAYLANG; $selectedId = ""; $location = ""; $docFilter = ""; $locationFilter = " WHERE "; $paging = ""; $pos = intval($_GET['pos']); $i = 1; $class = 'row1'; $jobscategoryform = ""; $jobslocationform = ""; $category = null; $this->_objTpl->setTemplate($this->pageContent); if (isset($_REQUEST['catid'])) { $category = intval($_REQUEST['catid']); } /** * This overwrites $_REQUEST['catid'] but it shouldnt be set parallel anyway */ if (isset($_REQUEST['cmd']) && is_numeric($_REQUEST['cmd'])) { $category = $_REQUEST['cmd']; } if (!empty($category)) { $selectedId = intval($category); $query = " SELECT `sort_style` FROM `" . DBPREFIX . "module_jobs_categories`\n WHERE `catid` = " . $selectedId; $objRS = $objDatabase->SelectLimit($query, 1); if ($objRS !== false) { $sortType = $objRS->fields['sort_style']; } else { die('database error. ' . $objDatabase->ErrorMsg()); } $docFilter = " n.catid='{$selectedId}' AND "; } $objRS = $objDatabase->Execute("SELECT id,value FROM `" . DBPREFIX . "module_jobs_settings` WHERE name = 'show_location_fe'"); if ($objRS !== false) { if (intval($objRS->fields['value']) == 1) { if (!empty($_REQUEST['locid'])) { $location = intval($_REQUEST['locid']); $locationFilter = ", `" . DBPREFIX . "module_jobs_rel_loc_jobs` AS rel WHERE rel.job = n.id AND rel.location = '" . $location . "' AND "; } $jobslocationform = "\n <select name=\"locid\" onchange=\"javascript:this.form.submit();\">\n <option selected=\"selected\" value=''>" . $_ARRAYLANG['TXT_JOBS_LOCATION_ALL'] . "</option>\n " . $this->getLocationMenu($location) . "\n </select>"; } } $jobscategoryform = "\n <select name=\"catid\" onchange=\"javascript:this.form.submit();\">\n <option selected=\"selected\" value=''>" . $_ARRAYLANG['TXT_CATEGORY_ALL'] . "</option>\n " . $this->getCategoryMenu($this->langId, $selectedId) . "\n </select>"; $this->_objTpl->setVariable("JOBS_CATEGORY_FORM", $jobscategoryform); $this->_objTpl->setVariable("JOBS_LOCATION_FORM", $jobslocationform); $this->_objTpl->setVariable("TXT_PERFORM", $_ARRAYLANG['TXT_PERFORM']); $query = "SELECT n.date AS date,\n n.id AS docid,\n n.title AS title,\n n.workload AS workload,\n n.author AS author,\n nc.name AS name\n FROM " . DBPREFIX . "module_jobs AS n,\n " . DBPREFIX . "module_jobs_categories AS nc\n " . $locationFilter . "\n status = 1\n AND n.lang=" . $this->langId . "\n AND {$docFilter} n.catid=nc.catid\n AND (startdate<='" . date('Y-m-d') . "' OR startdate='0000-00-00 00:00:00')\n AND (enddate>='" . date('Y-m-d') . "' OR enddate='0000-00-00 00:00:00') "; if (!empty($docFilter)) { switch ($sortType) { case 'alpha': $query .= " ORDER BY `title`"; break; case 'date': $query .= " ORDER BY `date` DESC"; break; case 'date_alpha': $query .= " ORDER BY DATE_FORMAT( FROM_UNIXTIME( `date` ) , '%Y%j' ) DESC, `title`"; break; default: $query .= " ORDER BY n.date DESC"; } } else { $query .= " ORDER BY n.date DESC"; } /* Fill table header */ $this->_objTpl->setVariable(array('JOBS_ID_TXT' => $_ARRAYLANG['TXT_JOBS_ID'], 'JOBS_LINK_TXT' => $_ARRAYLANG['TXT_JOBS_NAME'], 'JOBS_WORKLOAD_TXT' => $_ARRAYLANG['TXT_JOBS_WORKLOAD'])); /***start paging ****/ $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, "§ion=Jobs&catid=" . $selectedId . "&locid=" . $location, $_ARRAYLANG['TXT_DOCUMENTS'], true); } $this->_objTpl->setVariable("JOBS_PAGING", $paging); $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); /*** end paging ***/ if ($count >= 1) { while (!$objResult->EOF) { $i % 2 ? $class = 'row1' : ($class = 'row2'); $this->_objTpl->setVariable(array('JOBS_STYLE' => $class, 'JOBS_ID' => $objResult->fields['docid'], 'JOBS_LONG_DATE' => date($this->dateLongFormat, $objResult->fields['date']), 'JOBS_DATE' => date($this->dateFormat, $objResult->fields['date']), 'JOBS_LINK' => "<a href=\"?section=Jobs&cmd=details&id=" . $objResult->fields['docid'] . "\" title=\"" . stripslashes($objResult->fields['title']) . "\">" . stripslashes($objResult->fields['title']) . "</a>", 'JOBS_AUTHOR' => stripslashes($objResult->fields['author']), 'JOBS_WORKLOAD' => stripslashes($objResult->fields['workload']))); $this->_objTpl->parse("row"); $i++; $objResult->MoveNext(); } } else { $this->_objTpl->setVariable('TXT_NO_DOCUMENTS_FOUND', $_ARRAYLANG['TXT_NO_DOCUMENTS_FOUND']); $this->_objTpl->parse("alternate_row"); $this->_objTpl->hideblock("row"); } return $this->_objTpl->get(); }
/** * Memberlist * * @access private * @global ADONewConnection * @global array * @global array */ function _memberList() { global $objDatabase, $_ARRAYLANG, $_CONFIG; $this->setDirs(0, true); $this->_objTpl->setTemplate($this->pageContent, true, true); $dirid = intval($_GET['id']); $this->_objTpl->setGlobalVariable(array("TXT_OVERVIEW" => $_ARRAYLANG['TXT_OVERVIEW'])); $treeid = $dirid; $tree = array(); while ($treeid > 0) { $temp = array('id' => $treeid, 'name' => $this->directories[$treeid]['name']); $tree[] = $temp; $treeid = $this->directories[$treeid]['parentdir']; } $tree = array_reverse($tree); foreach ($tree as $branch) { $this->_objTpl->setVariable(array("MEMBERDIR_DIRID" => $branch['id'], "MEMBERDIR_DIRNAME" => $branch['name'])); $this->_objTpl->parse("tree-element"); } $this->_objTpl->parse("tree"); if ($this->directories[$dirid]['displaymode'] == 0 || $this->directories[$dirid]['displaymode'] == 1) { $lastlevel = 0; if ($this->directories[$dirid]['has_children']) { $this->_objTpl->setVariable(array("TXT_CATEGORY_TREE_DESC" => "<div style=\"margin-bottom: 5px;\">" . $_ARRAYLANG['TXT_SUBDIRECTORIES'] . "</div>", 'TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD' => $_ARRAYLANG['TXT_MEMBERDIR_EXPORT_CONTACT_AS_VCARD'])); } foreach ($this->directories as $dirkey => $directory) { // check language if ($directory['lang'] != 0 && $directory['lang'] != $this->langId) { continue; } if ($directory['active'] && $directory['parentdir'] == $dirid && $dirkey != 0) { $this->_objTpl->setVariable(array("MEMBERDIR_DIR_ID" => $dirkey, "MEMBERDIR_DIR_NAME" => $directory['name'], "MEMBERDIR_IMAGE_SRC" => "pixel.gif")); $this->_objTpl->parse("category"); } } $this->_objTpl->parse("category_list"); $this->_objTpl->hideBlock("category_show"); } if ($this->directories[$dirid]['displaymode'] == 0 || $this->directories[$dirid]['displaymode'] == 2) { if (empty($_GET['sort'])) { $_GET['sort'] = ""; } if (empty($_GET['search'])) { $_GET['search'] = ""; } $keyword = isset($_GET['keyword']) ? contrexx_addslashes($_GET['keyword']) : ""; $sort = contrexx_addslashes($_GET['sort']); $this->_objTpl->setGlobalVariable(array("MEMBERDIR_DIRID" => $dirid, "MEMBERDIR_CHAR_LIST" => $this->_getCharList(CONTREXX_DIRECTORY_INDEX . "?section=MemberDir&cmd=" . htmlentities($_GET['cmd'], ENT_QUOTES, CONTREXX_CHARSET) . "&id=" . $dirid . "&sort={$sort}"), "MEMBERDIR_DESCRIPTION" => nl2br($this->directories[$dirid]['description']))); $sortField = $this->directories[$dirid]['sort']; if ($sort == "sc") { /* Special Chars */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^[^a-zA-Z]' AND\n `dirid` = '{$dirid}'"; } elseif (preg_match("%^[a-z]\$%i", $sort)) { /* Sort by char */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `1` REGEXP '^" . $sort . "' AND\n `dirid` = '{$dirid}'"; } elseif ($_GET['search'] == "search") { /* Search */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE (\n `1` LIKE '%{$keyword}%' OR\n `2` LIKE '%{$keyword}%' OR\n `3` LIKE '%{$keyword}%' OR\n `4` LIKE '%{$keyword}%' OR\n `5` LIKE '%{$keyword}%' OR\n `6` LIKE '%{$keyword}%' OR\n `7` LIKE '%{$keyword}%' OR\n `8` LIKE '%{$keyword}%' OR\n `9` LIKE '%{$keyword}%' OR\n `10` LIKE '%{$keyword}%' OR\n `11` LIKE '%{$keyword}%' OR\n `12` LIKE '%{$keyword}%' OR\n `13` LIKE '%{$keyword}%' OR\n `14` LIKE '%{$keyword}%' OR\n `15` LIKE '%{$keyword}%' OR\n `16` LIKE '%{$keyword}%' OR\n `17` LIKE '%{$keyword}%' OR\n `18` LIKE '%{$keyword}%'\n ) "; if ($dirid != 0) { $query .= " AND `dirid` = '{$dirid}'"; } $objResult = $objDatabase->Execute($query); } elseif ($sort == "all") { /* All */ $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `dirid` = '{$dirid}'"; } else { if ($this->options['default_listing']) { $query = "SELECT *\n FROM " . DBPREFIX . "module_memberdir_values\n WHERE `dirid` = '{$dirid}'"; } } if ($this->options['default_listing']) { $query .= " ORDER BY `" . $sortField . "` ASC"; $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $objResult = $objDatabase->Execute($query); } if ($objResult) { $count = $objResult->RecordCount(); $paging = getPaging($count, $pos, "&section=MemberDir&cmd=" . htmlentities($_GET['cmd'], ENT_QUOTES, CONTREXX_CHARSET) . "&id={$dirid}&sort={$sort}&search=" . htmlentities(contrexx_stripslashes($_GET['search']), ENT_QUOTES, CONTREXX_CHARSET) . "&keyword={$keyword}", "<b>" . $_ARRAYLANG['TXT_MEMBERDIR_ENTRIES'] . "</b>", true, $_CONFIG['corePagingLimit']); $this->_objTpl->setVariable("MEMBERDIR_PAGING", $paging); $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); if ($objResult) { $rowid = 1; while (!$objResult->EOF) { $fieldnames = $this->getFieldData($dirid); for ($i = 1; $i < 17; $i++) { $placeholder = $this->getPlaceholderName($fieldnames[$i]['name']); $replace[$placeholder] = $objResult->fields["{$i}"]; } if ($dirid == 0) { $replace["FIELD_CATEGORY"] = $_ARRAYLANG['TXT_DIRECTORY'] . ": <strong>" . $this->directories[$objResult->fields['dirid']]['name'] . "</strong><br />"; } if ($this->directories[$objResult->fields['dirid']] && $objResult->fields['pic1'] != "none") { $src = $objResult->fields['pic1']; $size = getimagesize(ASCMS_PATH . $src); $width = $this->options['max_width'] < $size[0] ? $this->options['max_width'] : $size[0]; $height = $this->options['max_height'] < $size[1] ? $this->options['max_height'] : $size[1]; $this->_objTpl->setVariable(array("FIELD_PIC1" => "<img src=\"{$src}\" alt=\"\" style=\"width: " . $width . "px; height: " . $height . "px;\" /><br />")); } if ($this->directories[$objResult->fields['dirid']] && $objResult->fields['pic2'] != "none") { $src = $objResult->fields['pic2']; $size = getimagesize(ASCMS_PATH . $src); $width = $this->options['max_width'] < $size[0] ? $this->options['max_width'] : $size[0]; $height = $this->options['max_height'] < $size[1] ? $this->options['max_height'] : $size[1]; $this->_objTpl->setVariable(array("FIELD_PIC2" => "<img src=\"{$src}\" alt=\"\" style=\"width: " . $width . "px; height: " . $height . "px;\" /><br />")); } $name = $key <= 12 ? strtoupper($field['name']) : $key; $this->_objTpl->setVariable(array("MEMBERDIR_FIELD_" . $name => $key > 12 ? nl2br($objResult->fields[$key]) : $this->checkStr($objResult->fields[$key]))); $this->_objTpl->setVariable($replace); $this->_objTpl->setVariable(array("MEMBERDIR_ROW" => $rowid, "MEMBERDIR_ID" => $objResult->fields['id'], "FIELD_DIRECTORY" => $this->directories[$dirid]['name'])); $this->_objTpl->parse("memberdir_row"); $rowid = $rowid == 2 ? 1 : 2; $objResult->MoveNext(); } } } $this->_objTpl->touchBlock("category_show"); $this->_objTpl->parse("category_show"); } }
function searchEntry() { global $objDatabase, $_ARRAYLANG, $_CORELANG, $_CONFIG; $this->_objTpl->setTemplate($this->pageContent, true, true); //get search $this->getSearch(); //get navigatin $this->getNavigation(''); //spez fields $objResult = $objDatabase->Execute("SELECT id, value FROM " . DBPREFIX . "module_market_spez_fields WHERE lang_id = '1'"); if ($objResult !== false) { while (!$objResult->EOF) { $spezFields[$objResult->fields['id']] = $objResult->fields['value']; $objResult->MoveNext(); } } // set variables $this->_objTpl->setVariable(array('MARKET_SEARCH_PAGING' => $paging, 'TXT_MARKET_ENDDATE' => $_CORELANG['TXT_END_DATE'], 'TXT_MARKET_TITLE' => $_ARRAYLANG['TXT_MARKET_TITLE'], 'TXT_MARKET_PRICE' => $_ARRAYLANG['TXT_MARKET_PRICE'], 'TXT_MARKET_CITY' => $_ARRAYLANG['TXT_MARKET_CITY'], 'TXT_MARKET_SPEZ_FIELD_1' => $spezFields[1], 'TXT_MARKET_SPEZ_FIELD_2' => $spezFields[2], 'TXT_MARKET_SPEZ_FIELD_3' => $spezFields[3], 'TXT_MARKET_SPEZ_FIELD_4' => $spezFields[4], 'TXT_MARKET_SPEZ_FIELD_5' => $spezFields[5])); $today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $searchTermOrg = contrexx_addslashes($_GET['term']); $searchTerm = contrexx_addslashes($_GET['term']); $array = explode(' ', $searchTerm); for ($x = 0; $x < count($array); $x++) { $tmpTerm .= $array[$x] . '%'; } $searchTerm = substr($tmpTerm, 0, -1); $searchTermExp = "&check=norm&term=" . $searchTermOrg; if ($_GET['check'] == 'exp') { $searchTermExp = "&check=exp&term=" . $searchTermOrg; if ($_GET['catid'] != '') { $query_search .= "AND catid LIKE ('%" . $_GET['catid'] . "%') "; $searchTermExp .= "&catid=" . $_GET['catid']; } if ($_GET['type'] != '') { $query_search .= "AND type LIKE ('%" . $_GET['type'] . "%') "; $searchTermExp .= "&type=" . $_GET['type']; } if ($_GET['price'] != '') { $query_search .= "AND price <= " . $_GET['price'] . " "; $searchTermExp .= "&price=" . $_GET['price']; } } switch ($_GET['sort']) { case 'title': $sort = "title"; $sortPaging = "&sort=title"; break; case 'enddate': $sort = "enddate"; $sortPaging = "&sort=enddate"; break; case 'price': $sort = "price"; $sortPaging = "&sort=price"; break; default: $sort = "sort_id, enddate"; $sortPaging = ""; break; } if (isset($_GET['way'])) { $way = $_GET['way'] == 'ASC' ? 'DESC' : 'ASC'; $wayPaging = '&way=' . $_GET['way']; } else { $way = 'ASC'; $wayPaging = ''; } $this->_objTpl->setVariable(array('MARKET_ENDDATE_SORT' => "index.php?section=Market&cmd=search&id=" . $catId . $searchTermExp . "&sort=enddate&way=" . $way, 'MARKET_TITLE_SORT' => "index.php?section=Market&cmd=search&id=" . $catId . $searchTermExp . "&sort=title&way=" . $way, 'MARKET_PRICE_SORT' => "index.php?section=Market&cmd=search&id=" . $catId . $searchTermExp . "&sort=price&way=" . $way)); if ($_GET['term'] != '') { $query = "SELECT id,\n title,\n description,\n price,\n picture,\n userid,\n enddate,\n premium,\n spez_field_1,\n spez_field_2,\n spez_field_3,\n spez_field_4,\n spez_field_5,\n MATCH (title,description) AGAINST ('%{$searchTerm}%') AS score\n FROM " . DBPREFIX . "module_market\n WHERE (title LIKE ('%{$searchTerm}%')\n OR description LIKE ('%{$searchTerm}%')\n OR spez_field_1 LIKE ('%{$searchTerm}%')\n OR spez_field_2 LIKE ('%{$searchTerm}%')\n OR spez_field_3 LIKE ('%{$searchTerm}%')\n OR spez_field_4 LIKE ('%{$searchTerm}%')\n OR spez_field_5 LIKE ('%{$searchTerm}%'))\n " . $query_search . "\n AND status = '1'\n ORDER BY score DESC, " . $sort . " " . $way . ""; /////// START PAGING /////// $pos = intval($_GET['pos']); $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); if ($count > $this->settings['paging']) { $paging = getPaging($count, $pos, "§ion=Market&cmd=search" . $searchTermExp . "&sort=" . $sort . "&way=" . $way, "<b>Inserate</b>", true, $this->settings['paging']); } $this->_objTpl->setVariable('SEARCH_PAGING', $paging); $objResult = $objDatabase->SelectLimit($query, $this->settings['paging'], $pos); /////// END PAGING /////// if ($objResult !== false) { $i = 0; while (!$objResult->EOF) { if (empty($objResult->fields['picture'])) { $objResult->fields['picture'] = 'no_picture.gif'; } $info = getimagesize($this->mediaPath . 'pictures/' . $objResult->fields['picture']); $height = ''; $width = ''; if ($info[0] <= $info[1]) { if ($info[1] > 50) { $faktor = $info[1] / 50; $height = 50; $width = $info[0] / $faktor; } else { $height = $info[1]; $width = $info[0]; } } else { $faktor = $info[0] / 80; $result = $info[1] / $faktor; if ($result > 50) { if ($info[1] > 50) { $faktor = $info[1] / 50; $height = 50; $width = $info[0] / $faktor; } else { $height = $info[1]; $width = $info[0]; } } else { if ($info[0] > 80) { $width = 80; $height = $info[1] / $faktor; } else { $width = $info[0]; $height = $info[1]; } } } $width != '' ? $width = 'width="' . round($width, 0) . '"' : ($width = ''); $height != '' ? $height = 'height="' . round($height, 0) . '"' : ($height = ''); $image = '<img src="' . $this->mediaWebPath . 'pictures/' . $objResult->fields['picture'] . '" ' . $width . '" ' . $height . '" border="0" alt="' . $objResult->fields['title'] . '" />'; $objFWUser = \FWUser::getFWUserObject(); $objUser = $objFWUser->objUser->getUser($objResult->fields['userid']); if ($objUser) { $city = $objUser->getProfileAttribute('city'); } if ($objResult->fields['premium'] == 1) { $row = "marketRow1"; } else { $row = $i % 2 == 0 ? "marketRow2" : "marketRow3"; } $enddate = date("d.m.Y", $objResult->fields['enddate']); if ($objResult->fields['price'] == 'forfree') { $price = $_ARRAYLANG['TXT_MARKET_FREE']; } elseif ($objResult->fields['price'] == 'agreement') { $price = $_ARRAYLANG['TXT_MARKET_ARRANGEMENT']; } else { $price = $objResult->fields['price'] . ' ' . $this->settings['currency']; } $this->_objTpl->setVariable(array('MARKET_ENDDATE' => $enddate, 'MARKET_TITLE' => $objResult->fields['title'], 'MARKET_DESCRIPTION' => substr($objResult->fields['description'], 0, 110) . "<a href='index.php?section=Market&cmd=detail&id=" . $objResult->fields['id'] . "' target='_self'>[...]</a>", 'MARKET_PRICE' => $price, 'MARKET_PICTURE' => $image, 'MARKET_ROW' => $row, 'MARKET_DETAIL' => "index.php?section=Market&cmd=detail&id=" . $objResult->fields['id'], 'MARKET_ID' => $objResult->fields['id'], 'MARKET_CITY' => $city, 'MARKET_SPEZ_FIELD_1' => $objResult->fields['spez_field_1'], 'MARKET_SPEZ_FIELD_2' => $objResult->fields['spez_field_2'], 'MARKET_SPEZ_FIELD_3' => $objResult->fields['spez_field_3'], 'MARKET_SPEZ_FIELD_4' => $objResult->fields['spez_field_4'], 'MARKET_SPEZ_FIELD_5' => $objResult->fields['spez_field_5'])); $this->_objTpl->parse('showEntries'); $objResult->MoveNext(); $i++; } } if ($count <= 0) { $this->_objTpl->setVariable(array('MARKET_NO_ENTRIES_FOUND' => $_ARRAYLANG['TXT_MARKET_NO_ENTRIES_FOUND'])); $this->_objTpl->parse('noEntries'); $this->_objTpl->hideBlock('showEntries'); } } else { $this->_objTpl->setVariable(array('MARKET_NO_ENTRIES_FOUND' => $_ARRAYLANG['TXT_MARKET_SEARCH_INSERT'])); $this->_objTpl->parse('noEntries'); $this->_objTpl->hideBlock('showEntries'); $this->_objTpl->hideBlock('showEntriesHeader'); } $this->_objTpl->setVariable(array('TXT_MARKET_SEARCHTERM' => $searchTermOrg)); $this->_objTpl->parse('showEntriesHeader'); }
/** * show category * * @param integer $intCatId * @return void */ function showCategory($intCatId) { global $objDatabase, $_ARRAYLANG; $this->_communityLogin(); $intCatId = intval($intCatId); $pos = !empty($_REQUEST['pos']) ? intval($_REQUEST['pos']) : 0; $this->_objTpl->setVariable(array('FORUM_NAME' => $this->_shortenString($this->_arrTranslations[$intCatId][$this->_intLangId]['name'], $this->_maxStringlength), 'FORUM_TREE' => $this->_createNavTree($intCatId), 'FORUM_DROPDOWN' => $this->createForumDD('forum_quickaccess', $intCatId, 'onchange="gotoForum(this);"', ''), 'FORUM_JAVASCRIPT' => $this->getJavascript(), 'FORUM_JAVASCRIPT_GOTO' => $this->getJavascript('goto'))); if ($intCatId != 0) { $arrForums = $this->createForumArray($this->_intLangId, $intCatId, 1); if (count($arrForums) > 0) { $this->_objTpl->setGlobalVariable(array('TXT_FORUM' => $_ARRAYLANG['TXT_FORUM_OVERVIEW_FORUM'], 'TXT_LASTPOST' => $_ARRAYLANG['TXT_FORUM_OVERVIEW_LASTPOST'], 'TXT_THREADS' => $_ARRAYLANG['TXT_FORUM_OVERVIEW_THREADS'], 'TXT_POSTINGS' => $_ARRAYLANG['TXT_FORUM_OVERVIEW_POSTINGS'], 'TXT_FORUM_QUICKACCESS' => $_ARRAYLANG['TXT_FORUM_QUICKACCESS'])); $intCounter = 0; foreach ($arrForums as $intKey => $arrValues) { if ($arrValues['status'] == 1) { $this->_objTpl->setVariable(array('FORUM_SUBCATEGORY_ROWCLASS' => $intCounter++ % 2 + 1, 'FORUM_SUBCATEGORY_SPACER' => (intval($arrValues['level']) - 1) * 25, 'FORUM_SUBCATEGORY_ICON' => '<img src="modules/Forum/View/Media/comment.gif" alt="comment.gif" border="0" />', 'FORUM_SUBCATEGORY_ID' => $arrValues['id'], 'FORUM_SUBCATEGORY_NAME' => $arrValues['name'], 'FORUM_SUBCATEGORY_DESC' => $arrValues['description'], 'FORUM_SUBCATEGORY_LASTPOST_ID' => $arrValues['last_post_id'], 'FORUM_SUBCATEGORY_LASTPOST_TITLE' => $arrValues['last_post_str'], 'FORUM_SUBCATEGORY_LASTPOST_DATE' => $arrValues['last_post_date'], 'FORUM_SUBCATEGORY_THREADS' => $arrValues['thread_count'], 'FORUM_SUBCATEGORY_POSTINGS' => $arrValues['post_count'])); $this->_objTpl->parse('forumSubCategory'); } } $this->_objTpl->setVariable(array('FORUM_THREADS_PAGING' => getPaging($this->_threadCount, $pos, '§ion=Forum&cmd=board&id=' . $intCatId, $_ARRAYLANG['TXT_FORUM_OVERVIEW_THREADS'], true, $this->_arrSettings['thread_paging']))); } else { $this->_objTpl->setVariable('TXT_THREADS_NONE', $_ARRAYLANG['TXT_FORUM_THREADS_NONE']); } } else { \Cx\Core\Csrf\Controller\Csrf::header('location: index.php?section=Forum'); die; } }
/** * show confirm form * @access public * @global array * @global ADONewConnection * @global array */ function showConfirm() { global $_CONFIG, $objDatabase, $_ARRAYLANG; //check paging position if (!isset($_GET['pos'])) { $_GET['pos'] = ''; } // initialize variables $this->_objTpl->loadTemplateFile('module_directory_entry_confirm.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_DIR_CONFIRM_ENTREE']; $this->_objTpl->setVariable(array('TXT_CONFIRMLIST' => $_ARRAYLANG['TXT_DIR_CONFIRM_LIST'], 'TXT_CONFIRMFILE' => $_ARRAYLANG['TXT_DIR_CONFIRM'], 'TXT_NAME' => $_ARRAYLANG['TXT_DIRECTORY_NAME'], 'TXT_DESCRIPTION' => $_ARRAYLANG['TXT_DIR_DESCRIPTION'], 'TXT_DATE' => $_ARRAYLANG['TXT_DIR_DATE'], 'TXT_OPTIONS' => $_ARRAYLANG['TXT_DIR_OPTIONS'], 'TXT_PLATFORM' => $_ARRAYLANG['TXT_DIR_PLATFORM'], 'TXT_LANGUAGE' => $_ARRAYLANG['TXT_DIR_LANG'], 'TXT_EDIT' => $_ARRAYLANG['TXT_DIR_EDIT'], 'TXT_DELETE' => $_ARRAYLANG['TXT_DIR_DEL'], 'TXT_FILE_SEARCH' => $_ARRAYLANG['TXT_DIR_FILE_SEARCH'], 'TXT_SEARCH' => $_ARRAYLANG['TXT_DIR_SEARCH'], 'TXT_ACTION' => $_ARRAYLANG['TXT_DIR_ACTION'], 'TXT_ADDEDBY' => $_ARRAYLANG['TXT_DIRECTORY_AUTHOR'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_DIR_CONFIRM_DEL'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_DIR_ACTION_IS_IRREVERSIBLE'], 'CATID_SORT' => $catIdSort, 'TXT_IMPORT_MAKE_SELECTION' => $_ARRAYLANG['TXT_DIR_MAKE_SELECTION'])); // Sort if (isset($_GET['sort']) || empty($_SESSION['order'])) { switch ($_GET['sort']) { case 'date': $_SESSION['order'] = $_SESSION['order'] == "files.date desc" ? "files.date asc" : "files.date desc"; break; case 'name': $_SESSION['order'] = $_SESSION['order'] == "files.title desc" ? "files.title asc" : "files.title desc"; break; case 'addedby': $_SESSION['order'] = $_SESSION['order'] == "files.addedby desc" ? "files.addedby asc" : "files.addedby desc"; break; default: $_SESSION['order'] = "files.id desc"; break; } } $pos = intval($_GET['pos']); if (isset($catId)) { $where = " AND catid=" . $catId; } elseif ($_POST['term']) { //check search term $term = htmlspecialchars($_POST['term'], ENT_QUOTES, CONTREXX_CHARSET); $where .= " AND (title LIKE '%" . $term . "%' OR filename LIKE '%" . $term . "%' OR description LIKE '%" . $term . "%') "; } else { $where = $term = ''; } //create query $query = "SELECT * FROM " . DBPREFIX . "module_directory_dir AS files WHERE status='0' " . $where . " ORDER BY " . $_SESSION['order']; ////// paging start ///////// $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); if (!is_numeric($pos)) { $pos = 0; } if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, "&cmd=Directory&act=confirm", "<b>" . $_ARRAYLANG['TXT_DIRECTORY_FEEDS'] . "</b>", true); } ////// paging end ///////// $pagingLimit = intval($_CONFIG['corePagingLimit']); $objResult = $objDatabase->SelectLimit($query, $pagingLimit, $pos); $count = $objResult->RecordCount(); //get files $i = 0; if ($objResult !== false) { while (!$objResult->EOF) { $file_array[$i]['title'] = $objResult->fields['title']; $file_array[$i]['id'] = $objResult->fields['id']; $file_array[$i]['description'] = $objResult->fields['description']; $file_array[$i]['catid'] = $objResult->fields['catid']; $file_array[$i]['addedby'] = $objResult->fields['addedby']; $file_array[$i]['language'] = $objResult->fields['language']; $file_array[$i]['platform'] = $objResult->fields['platform']; $file_array[$i]['date'] = $objResult->fields['date']; $i++; $objResult->MoveNext(); } } //show files $i = 0; $this->_objTpl->setCurrentBlock('filesRow'); if (!empty($file_array)) { foreach ($file_array as $file) { //check paging if (!$count > intval($_CONFIG['corePagingLimit'])) { $paging = ""; } //get author $addedBy = $this->getAuthor($file['addedby']); $i % 2 ? $class = "row2" : ($class = "row1"); // initialize variables $this->_objTpl->setVariable(array('FILES_ROW' => $class, 'FILES_ID' => $file['id'], 'FILES_NAME' => stripslashes($file['title']), 'FILES_DESCRIPTION' => substr(stripslashes($file['description']), 0, 200), 'FILES_LANGUAGE' => $file['language'], 'FILES_PLATFORM' => $file['platform'], 'FILES_DATE' => date("d.m.Y H:i:s", $file['date']), 'FILES_ADDEDBY' => $addedBy, 'FILES_PAGING' => $paging, 'FILES_CHECKBOX' => "<input type=\"checkbox\" title=\"Select " . $file['filename'] . "\" name=\"formSelected[]\" value=\"" . $file['id'] . "\" />")); $this->_objTpl->parseCurrentBlock('filesRow'); $i++; } $this->_objTpl->setVariable(array('TXT_IMPORT' => $_ARRAYLANG['TXT_DIR_CONFIRM'], 'TXT_SELECT_ACTION' => $_ARRAYLANG['TXT_DIR_CHOOSE_ACTION'], 'TXT_DELETE' => $_ARRAYLANG['TXT_DIR_DEL'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_DIRECTORY_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_DIRECTORY_DESELECT_ALL'])); $this->_objTpl->parse('importSelectAction'); } else { // initialize variables $this->_objTpl->setVariable(array('NO_FILES_FOUND' => $_ARRAYLANG['TXT_DIRECTORY_EMPTY_CONFIRMLIST'])); $this->_objTpl->hideBlock('filesRow'); $this->_objTpl->parseCurrentBlock('nofilesRow'); } }
/** * performs the my events page * * @return null */ function myEvents() { global $_ARRAYLANG, $_CORELANG; $this->_objTpl->setTemplate($this->pageContent, true, true); $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true); $objCategoryManager->getCategoryList(); $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_EDIT' => $_ARRAYLANG['TXT_CALENDAR_EDIT'])); if ($this->objEventManager->countEvents > $this->arrSettings['numPaging']) { $pagingCmd = !empty($_GET['cmd']) ? '&cmd=' . $_GET['cmd'] : ''; $this->_objTpl->setVariable(array($this->moduleLangVar . '_PAGING' => getPaging($this->objEventManager->countEvents, $this->startPos, "§ion=" . $this->moduleName . $pagingCmd, "<b>" . $_ARRAYLANG['TXT_CALENDAR_EVENTS'] . "</b>", true, $this->arrSettings['numPaging']))); } $this->objEventManager->showEventList($this->_objTpl); }
/** * Gets the list with the top news * * @global array * @global ADONewConnection * @global array * @return string parsed content */ private function getTopNews() { global $_CONFIG, $objDatabase, $_ARRAYLANG; $newsfilter = ''; $paging = ''; $pos = 0; $i = 0; if (isset($_GET['pos'])) { $pos = intval($_GET['pos']); } $this->_objTpl->setVariable(array('TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_NEWS_MESSAGE' => $_ARRAYLANG['TXT_NEWS_MESSAGE'])); $query = ' SELECT n.id AS newsid, n.userid AS newsuid, n.date AS newsdate, n.teaser_image_path, n.teaser_image_thumbnail_path, n.redirect, n.publisher, n.publisher_id, n.author, n.author_id, nl.title AS newstitle, nl.text NOT REGEXP \'^(<br type="_moz" />)?$\' AS newscontent, nl.teaser_text FROM ' . DBPREFIX . 'module_news AS n INNER JOIN ' . DBPREFIX . 'module_news_locale AS nl ON nl.news_id = n.id WHERE status = 1 AND nl.is_active=1 AND nl.lang_id=' . FRONTEND_LANG_ID . ' AND (n.startdate<=\'' . date('Y-m-d H:i:s') . '\' OR n.startdate="0000-00-00 00:00:00") AND (n.enddate>=\'' . date('Y-m-d H:i:s') . '\' OR n.enddate="0000-00-00 00:00:00") ' . $newsfilter . ($this->arrSettings['news_message_protection'] == '1' && !\Permission::hasAllAccess() ? ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() ? " AND (frontend_access_id IN (" . implode(',', array_merge(array(0), $objFWUser->objUser->getDynamicPermissionIds())) . ") OR userid = " . $objFWUser->objUser->getId() . ") " : " AND frontend_access_id=0 " : '') . 'ORDER BY (SELECT COUNT(*) FROM ' . DBPREFIX . 'module_news_stats_view WHERE news_id=n.id AND time>"' . date_format(date_sub(date_create('now'), date_interval_create_from_date_string(intval($this->arrSettings['news_top_days']) . ' day')), 'Y-m-d H:i:s') . '") DESC'; /***start paging ****/ $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); if ($count > intval($_CONFIG['corePagingLimit'])) { $paging = getPaging($count, $pos, '§ion=News&cmd=topnews', $_ARRAYLANG['TXT_NEWS_MESSAGES'], true); } $this->_objTpl->setVariable('NEWS_PAGING', $paging); $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); /*** end paging ***/ if ($count >= 1) { while (!$objResult->EOF) { $newsid = $objResult->fields['newsid']; $newstitle = $objResult->fields['newstitle']; $newsCategories = $this->getCategoriesByNewsId($newsid); $newsUrl = empty($objResult->fields['redirect']) ? empty($objResult->fields['newscontent']) ? '' : \Cx\Core\Routing\Url::fromModuleAndCmd('News', $this->findCmdById('details', array_keys($newsCategories)), FRONTEND_LANG_ID, array('newsid' => $newsid)) : $objResult->fields['redirect']; $htmlLink = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml('[' . $_ARRAYLANG['TXT_NEWS_MORE'] . '...]')); $htmlLinkTitle = self::parseLink($newsUrl, $newstitle, contrexx_raw2xhtml($newstitle)); // in case that the message is a stub, we shall just display the news title instead of a html-a-tag with no href target if (empty($htmlLinkTitle)) { $htmlLinkTitle = contrexx_raw2xhtml($newstitle); } list($image, $htmlLinkImage, $imageSource) = self::parseImageThumbnail($objResult->fields['teaser_image_path'], $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl); $author = \FWUser::getParsedUserTitle($objResult->fields['author_id'], $objResult->fields['author']); $publisher = \FWUser::getParsedUserTitle($objResult->fields['publisher_id'], $objResult->fields['publisher']); $this->_objTpl->setVariable(array('NEWS_ID' => $newsid, 'NEWS_CSS' => 'row' . ($i % 2 + 1), 'NEWS_TEASER' => nl2br($objResult->fields['teaser_text']), 'NEWS_TITLE' => contrexx_raw2xhtml($newstitle), 'NEWS_LONG_DATE' => date(ASCMS_DATE_FORMAT, $objResult->fields['newsdate']), 'NEWS_DATE' => date(ASCMS_DATE_FORMAT_DATE, $objResult->fields['newsdate']), 'NEWS_TIME' => date(ASCMS_DATE_FORMAT_TIME, $objResult->fields['newsdate']), 'NEWS_LINK_TITLE' => $htmlLinkTitle, 'NEWS_LINK' => $htmlLink, 'NEWS_LINK_URL' => contrexx_raw2xhtml($newsUrl), 'NEWS_CATEGORY' => implode(', ', contrexx_raw2xhtml($newsCategories)), 'NEWS_PUBLISHER' => contrexx_raw2xhtml($publisher), 'NEWS_AUTHOR' => contrexx_raw2xhtml($author))); if (!empty($image)) { $this->_objTpl->setVariable(array('NEWS_IMAGE' => $image, 'NEWS_IMAGE_SRC' => contrexx_raw2xhtml($imageSource), 'NEWS_IMAGE_ALT' => contrexx_raw2xhtml($newstitle), 'NEWS_IMAGE_LINK' => $htmlLinkImage)); if ($this->_objTpl->blockExists('news_image')) { $this->_objTpl->parse('news_image'); } } else { if ($this->_objTpl->blockExists('news_image')) { $this->_objTpl->hideBlock('news_image'); } } self::parseImageBlock($this->_objTpl, $objResult->fields['teaser_image_thumbnail_path'], $newstitle, $newsUrl, 'image_thumbnail'); self::parseImageBlock($this->_objTpl, $objResult->fields['teaser_image_path'], $newstitle, $newsUrl, 'image_detail'); $this->_objTpl->parse('newsrow'); $i++; $objResult->MoveNext(); } if ($this->_objTpl->blockExists('news_list')) { $this->_objTpl->parse('news_list'); } if ($this->_objTpl->blockExists('news_menu')) { $this->_objTpl->parse('news_menu'); } if ($this->_objTpl->blockExists('news_status_message')) { $this->_objTpl->hideBlock('news_status_message'); } } else { $this->_objTpl->setVariable('TXT_NEWS_NO_NEWS_FOUND', $_ARRAYLANG['TXT_NEWS_NO_NEWS_FOUND']); if ($this->_objTpl->blockExists('news_status_message')) { $this->_objTpl->parse('news_status_message'); } if ($this->_objTpl->blockExists('news_menu')) { $this->_objTpl->parse('news_menu'); } if ($this->_objTpl->blockExists('news_list')) { $this->_objTpl->hideBlock('news_list'); } } return $this->_objTpl->get(); }
function _showRecipientFeedbackAnalysis() { global $objDatabase, $_ARRAYLANG, $_CONFIG; if (empty($_REQUEST['id']) || empty($_REQUEST['recipient_type']) || !in_array($_REQUEST['recipient_type'], array(self::USER_TYPE_NEWSLETTER, self::USER_TYPE_ACCESS))) { return $this->_userList(); } $recipientId = intval($_REQUEST['id']); $recipientType = $_REQUEST['recipient_type']; $linkCount = 0; if ($recipientType == self::USER_TYPE_NEWSLETTER) { $objRecipient = $objDatabase->SelectLimit('SELECT `lastname`, `firstname` FROM `' . DBPREFIX . 'module_newsletter_user` WHERE `id`=' . $recipientId, 1); if ($objRecipient !== false && $objRecipient->RecordCount() == 1) { $recipientLastname = $objRecipient->fields['lastname']; $recipientFirstname = $objRecipient->fields['firstname']; } else { return $this->_userList(); } } else { $objRecipient = \FWUser::getFWUserObject()->objUser->getUser($recipientId); if ($objRecipient) { $recipientLastname = $objRecipient->getProfileAttribute('lastname'); $recipientFirstname = $objRecipient->getProfileAttribute('firstname'); } else { return $this->_userList(); } } $this->_pageTitle = $_ARRAYLANG['TXT_NEWSLETTER_USER_ADMINISTRATION']; $this->_objTpl->addBlockfile('NEWSLETTER_USER_FILE', 'module_newsletter_user_feedback', 'module_newsletter_user_feedback.html'); $this->_objTpl->setVariable('TXT_NEWSLETTER_USER_FEEDBACK_TITLE', sprintf($_ARRAYLANG['TXT_NEWSLETTER_RECIPIENT_FEEDBACK'], contrexx_raw2xhtml(trim($recipientLastname . " " . $recipientFirstname)))); $this->_objTpl->setVariable(array('TXT_NEWSLETTER_LINK_TITLE' => $_ARRAYLANG['TXT_NEWSLETTER_LINK_TITLE'], 'TXT_NEWSLETTER_EMAIL' => $_ARRAYLANG['TXT_NEWSLETTER_EMAIL'], 'TXT_NEWSLETTER_LINK_SOURCE' => $_ARRAYLANG['TXT_NEWSLETTER_LINK_SOURCE'], 'TXT_NEWSLETTER_FUNCTIONS' => $_ARRAYLANG['TXT_NEWSLETTER_FUNCTIONS'], 'TXT_NEWSLETTER_BACK' => $_ARRAYLANG['TXT_NEWSLETTER_BACK'])); $this->_objTpl->setGlobalVariable(array('TXT_NEWSLETTER_OPEN_LINK_IN_NEW_TAB' => $_ARRAYLANG['TXT_NEWSLETTER_OPEN_LINK_IN_NEW_TAB'])); $objResultCount = $objDatabase->SelectLimit(' SELECT COUNT(1) AS `link_count` FROM `' . DBPREFIX . 'module_newsletter_email_link_feedback` WHERE `recipient_id` = ' . $recipientId . ' AND `recipient_type` = \'' . $recipientType . '\'', 1); if ($objResultCount !== false) { $linkCount = $objResultCount->fields['link_count']; } $rowNr = 0; $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; $objResult = $objDatabase->SelectLimit("SELECT\n tblLink.id,\n tblLink.title,\n tblLink.url,\n tblMail.subject\n FROM " . DBPREFIX . "module_newsletter_email_link_feedback AS tblMailLinkFB\n INNER JOIN " . DBPREFIX . "module_newsletter AS tblMail ON tblMail.id = tblMailLinkFB.email_id\n INNER JOIN " . DBPREFIX . "module_newsletter_email_link AS tblLink ON tblMailLinkFB.link_id = tblLink.id\n WHERE tblMailLinkFB.recipient_id = " . $recipientId . " AND tblMailLinkFB.recipient_type = '" . $recipientType . "'\n ORDER BY tblLink.title ASC", $_CONFIG['corePagingLimit'], $pos); if ($objResult !== false) { while (!$objResult->EOF) { $this->_objTpl->setVariable(array('NEWSLETTER_LINK_ROW_CLASS' => $rowNr % 2 == 1 ? 'row1' : 'row2', 'NEWSLETTER_LINK_TITLE' => contrexx_raw2xhtml($objResult->fields['title']), 'NEWSLETTER_LINK_URL' => $objResult->fields['url'], 'NEWSLETTER_EMAIL' => $objResult->fields['subject'])); $this->_objTpl->setGlobalVariable('NEWSLETTER_LINK_ID', $objResult->fields['id']); $this->_objTpl->parse("link_list"); $objResult->MoveNext(); $rowNr++; } if ($rowNr > 0) { $paging = getPaging($linkCount, $pos, "&cmd=Newsletter&act=users&tpl=feedback&id=" . $recipientId, "", false, $_CONFIG['corePagingLimit']); $this->_objTpl->setVariable('NEWSLETTER_LINKS_PAGING', "<br />" . $paging . "<br />"); } else { $this->_objTpl->setVariable('NEWSLETTER_USER_NO_FEEDBACK', $_ARRAYLANG['TXT_NEWSLETTER_USER_NO_FEEDBACK']); $this->_objTpl->touchBlock('link_list_empty'); $this->_objTpl->hideBlock('link_list'); } } return true; }
/** * default guestbook entries list * * @global ADONewConnection * @global array * @global array */ function _overview() { global $objDatabase, $_CONFIG, $_ARRAYLANG; $this->_objTpl->loadTemplateFile('module_guestbook_show.html', true, true); $this->pageTitle = $_ARRAYLANG['TXT_GUESTBOOK']; $this->_objTpl->setVariable(array('TXT_MANAGE_ENTRIES' => $_ARRAYLANG['TXT_MANAGE_ENTRIES'], 'TXT_NAME' => $_ARRAYLANG['TXT_NAME'], 'TXT_COMMENT' => $_ARRAYLANG['TXT_COMMENT'], 'TXT_LOCATION' => $_ARRAYLANG['TXT_LOCATION'], 'TXT_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CONFIRM_DELETE_DATA'], 'TXT_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_ACTION_IS_IRREVERSIBLE'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_DESELECT_ALL'], 'TXT_SUBMIT_SELECT' => $_ARRAYLANG['TXT_SUBMIT_SELECT'], 'TXT_SUBMIT_DELETE' => $_ARRAYLANG['TXT_SUBMIT_DELETE'], 'TXT_SUBMIT_ACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_ACTIVATE'], 'TXT_SUBMIT_DEACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_DEACTIVATE'], 'TXT_ACTION' => $_ARRAYLANG['TXT_GUESTBOOK_ACTION'], 'TXT_DELETE_CATEGORY_ALL' => $_ARRAYLANG['TXT_DELETE_CATEGORY_ALL'])); $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0; /** start paging **/ $query = "SELECT *\n FROM " . DBPREFIX . "module_guestbook " . ($this->arrSettings['guestbook_only_lang_entries'] ? "WHERE lang_id='{$this->langId}' " : ''); $objResult = $objDatabase->Execute($query); $count = $objResult->RecordCount(); // TODO: $_ARRAYLANG['TXT_GUESTBOOK_ENTRIES'] does not exist // $paging = getPaging($count, $pos, "&cmd=GuestBook", "<b>".$_ARRAYLANG['TXT_GUESTBOOK_ENTRIES']."</b>", true); $paging = getPaging($count, $pos, "&cmd=GuestBook", '', true); $this->_objTpl->setVariable("GUESTBOOK_PAGING", $paging); /** end paging **/ $query = "\n SELECT id, status, forename, name, gender,\n url, email, comment, ip, location,\n datetime\n FROM " . DBPREFIX . "module_guestbook" . ($this->arrSettings['guestbook_only_lang_entries'] ? " WHERE lang_id='{$this->langId}'" : '') . " ORDER BY id DESC"; $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos); $i = 0; while (!$objResult->EOF) { // TODO: $_ARRAYLANG['guestbookGenderMale'] and // $_ARRAYLANG['guestbookGenderFemale'] do not exist // $gender = ($objResult->fields["gender"] == "M") ? $_ARRAYLANG['guestbookGenderMale'] : $_ARRAYLANG['guestbookGenderFemale']; $gender = ''; $url = ''; $mail = ''; if ($objResult->fields['url'] != '') { $url = "<a href='" . $objResult->fields['url'] . "' target='_blank'><img alt=\"" . $objResult->fields['url'] . "\" title=\"" . $objResult->fields['url'] . "\" src=\".." . $this->imagePath . "/GuestBook/View/Media/www.gif\" border=\"0\" /></a>"; } if ($objResult->fields['email'] != '') { $mail = "<a href=\"mailto:" . $objResult->fields["email"] . "\"><img alt=\"" . $objResult->fields["email"] . "\" title=\"" . $objResult->fields["email"] . "\" src=\".." . $this->imagePath . "/GuestBook/View/Media/email.gif\" border=\"0\" /></a>"; } $statusIcon = $objResult->fields['status'] == 0 ? 'led_red' : 'led_green'; if ($objResult->fields['status'] == 0) { $rowclass = 'rowWarn'; } else { $rowclass = $i % 2 ? 'row1' : 'row2'; } $this->_objTpl->setVariable(array('GUESTBOOK_ROWCLASS' => $rowclass, 'GUESTBOOK_STATUS' => $statusIcon, 'GUESTBOOK_FORENAME' => htmlentities($objResult->fields["forename"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_NAME' => htmlentities($objResult->fields["name"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_GENDER' => $gender, 'GUESTBOOK_URL' => $url, 'GUESTBOOK_LOCATION' => htmlentities($objResult->fields["location"], ENT_QUOTES, CONTREXX_CHARSET), 'GUESTBOOK_DATE' => date(ASCMS_DATE_FORMAT, strtotime($objResult->fields['datetime'])), 'GUESTBOOK_MAIL' => $mail, 'GUESTBOOK_COMMENT' => nl2br($objResult->fields["comment"]), 'GUESTBOOK_ID' => $objResult->fields["id"], 'GUESTBOOK_IP' => "<a href='?cmd=NetTools&tpl=whois&address=" . htmlentities($objResult->fields["ip"], ENT_QUOTES, CONTREXX_CHARSET) . "' alt='" . $_ARRAYLANG['TXT_SHOW_DETAILS'] . "' title='" . $_ARRAYLANG['TXT_SHOW_DETAILS'] . "'>" . htmlentities($objResult->fields["ip"], ENT_QUOTES, CONTREXX_CHARSET) . "</a>")); $this->_objTpl->parse('guestbook_row'); $i++; $objResult->MoveNext(); } if ($i == 0) { $this->_objTpl->hideBlock('guestbook_row'); } }
function _tickerOverview() { global $_ARRAYLANG, $_CONFIG; $this->pageTitle = $_ARRAYLANG['TXT_NEWS_TICKERS']; $paging = ''; $pos = isset($_REQUEST['pos']) ? intval($_REQUEST['pos']) : 0; $count = $this->_tickerCount(); $this->_objTpl->addBlockfile('NEWS_TICKER_TEMPLATE', 'module_news_ticker_list', 'module_news_ticker_list.html'); $this->_objTpl->setVariable(array('TXT_NEWS_TICKERS' => $_ARRAYLANG['TXT_NEWS_TICKERS'], 'TXT_NEWS_TICKER' => $_ARRAYLANG['TXT_NEWS_TICKER'], 'TXT_NEWS_CONTENT' => $_ARRAYLANG['TXT_NEWS_CONTENT'], 'TXT_NEWS_CHARSET' => $_ARRAYLANG['TXT_NEWS_CHARSET'], 'TXT_NEWS_FUNCTIONS' => $_ARRAYLANG['TXT_NEWS_FUNCTIONS'], 'TXT_NEWS_CONFIRM_DELETE_TICKER' => $_ARRAYLANG['TXT_NEWS_CONFIRM_DELETE_TICKER'], 'TXT_NEWS_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_NEWS_ACTION_IS_IRREVERSIBLE'])); $this->_objTpl->setGlobalVariable(array('TXT_NEWS_SHOW_TICKER_FILE' => $_ARRAYLANG['TXT_NEWS_SHOW_TICKER_FILE'], 'TXT_NEWS_MODIFY_TICKER' => $_ARRAYLANG['TXT_NEWS_MODIFY_TICKER'], 'NEWS_TICKER_POS' => $pos)); if ($count > $_CONFIG['corePagingLimit']) { $paging = getPaging($count, $pos, '&cmd=News&act=ticker', 'Ticker'); } $displayCharset = CONTREXX_CHARSET; $arrTickers = $this->_getTickers($pos); if (count($arrTickers) > 0) { $nr = 0; foreach ($arrTickers as $tickerId => $arrTicker) { if (!file_exists(\Env::get('cx')->getWebsiteFeedPath() . '/' . $arrTicker['name']) && !@touch(\Env::get('cx')->getWebsiteFeedPath() . '/' . $arrTicker['name'])) { $this->strErrMessage .= sprintf($_ARRAYLANG['TXT_NEWS_COULD_NOT_ATTACH_FILE'], htmlentities($arrTicker['name'], ENT_QUOTES, CONTREXX_CHARSET), \Env::get('cx')->getWebsiteFeedPath() . '/') . '<br />'; $this->strErrMessage .= sprintf($_ARRAYLANG['TXT_NEWS_SET_CHMOD'], \Env::get('cx')->getWebsiteFeedPath() . '/'); } else { $content = file_get_contents(\Env::get('cx')->getWebsiteFeedPath() . '/' . $arrTicker['name']); if (!empty($arrTicker['prefix']) && strpos($content, $arrTicker['prefix']) === 0) { $content = substr($content, strlen($arrTicker['prefix'])); } if ($arrTicker['urlencode']) { $content = rawurldecode($content); } $content = iconv($arrTicker['charset'], $displayCharset, $content); if (strlen($content) > 100) { $content = substr($content, 0, 100) . '...'; } } $this->_objTpl->setVariable(array('NEWS_TICKER_ID' => $tickerId, 'NEWS_TICKER_NAME' => htmlentities($arrTicker['name'], ENT_QUOTES, CONTREXX_CHARSET), 'NEWS_TICKER_ADDRESS' => ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . ASCMS_FEED_WEB_PATH . '/' . htmlentities($arrTicker['name'], ENT_QUOTES, CONTREXX_CHARSET), 'NEWS_TICKER_CONTENT' => !empty($content) ? htmlentities($content, ENT_QUOTES, CONTREXX_CHARSET) : ' ', 'NEWS_TICKER_CHARSET' => $arrTicker['charset'], 'NEWS_TICKER_ROW_CLASS' => $nr % 2 ? 1 : 2, 'NEWS_DELETE_TICKER_TXT' => sprintf($_ARRAYLANG['TXT_NEWS_DELETE_TICKER'], htmlentities($arrTicker['name'], ENT_QUOTES, CONTREXX_CHARSET)))); $nr++; $this->_objTpl->parse('news_ticker_list'); } $this->_objTpl->setVariable(array('TXT_NEWS_CHECK_ALL' => $_ARRAYLANG['TXT_NEWS_CHECK_ALL'], 'TXT_NEWS_UNCHECK_ALL' => $_ARRAYLANG['TXT_NEWS_UNCHECK_ALL'], 'TXT_NEWS_WITH_SELECTED' => $_ARRAYLANG['TXT_NEWS_WITH_SELECTED'], 'TXT_NEWS_DELETE' => $_ARRAYLANG['TXT_NEWS_DELETE'], 'TXT_NEWS_CREATE_TICKER' => $_ARRAYLANG['TXT_NEWS_CREATE_TICKER'], 'TXT_NEWS_CONFIRM_DELETE_TICKERS_MSG' => $_ARRAYLANG['TXT_NEWS_CONFIRM_DELETE_TICKERS_MSG'])); $this->_objTpl->parse('news_ticker_data'); $this->_objTpl->hideBlock('news_ticker_no_data'); $this->_objTpl->touchBlock('news_ticker_multi_select_action'); if (!empty($paging)) { $this->_objTpl->setVariable('PAGING', "<br />\n" . $paging); } } else { $this->_objTpl->setVariable('TXT_NEWS_NO_TICKER_AVAILABLE', $_ARRAYLANG['TXT_NEWS_NO_TICKER_AVAILABLE']); $this->_objTpl->parse('news_ticker_no_data'); $this->_objTpl->hideBlock('news_ticker_data'); $this->_objTpl->hideBlock('news_ticker_multi_select_action'); } $this->_objTpl->parse('module_news_ticker_list'); }