require_once '../../system/common.php'; require_once '../../system/login_valid.php'; // Initialize and check the parameters $getLinkId = admFuncVariableIsValid($_GET, 'lnk_id', 'numeric'); $getHeadline = admFuncVariableIsValid($_GET, 'headline', 'string', array('defaultValue' => $gL10n->get('LNK_WEBLINKS'))); // check if the module is enabled for use if ($gPreferences['enable_weblinks_module'] == 0) { // module is disabled $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } // Ist ueberhaupt das Recht vorhanden? if (!$gCurrentUser->editWeblinksRight()) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // Weblinkobjekt anlegen $link = new TableWeblink($gDb, $getLinkId); if (isset($_SESSION['links_request'])) { // durch fehlerhafte Eingabe ist der User zu diesem Formular zurueckgekehrt // nun die vorher eingegebenen Inhalte ins Objekt schreiben $link->setArray($_SESSION['links_request']); unset($_SESSION['links_request']); } // Html-Kopf ausgeben if ($getLinkId > 0) { $headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline); } else { $headline = $gL10n->get('SYS_CREATE_VAR', $getHeadline); } // add current url to navigation stack $gNavigation->addUrl(CURRENT_URL, $headline); // create html page object
LEFT JOIN ' . TBL_USERS . ' cre_username ON cre_username.usr_id = lnk_usr_id_create '; } // read weblinks from database $sql = 'SELECT cat.*, lnk.*, ' . $additionalFields . ' FROM ' . TBL_CATEGORIES . ' cat, ' . TBL_LINKS . ' lnk ' . $additionalTables . ' WHERE lnk_cat_id = cat_id AND cat_org_id = ' . $gCurrentOrganization->getValue('org_id') . ' AND cat_type = \'LNK\' ORDER BY lnk_timestamp_create DESC'; $statement = $gDb->query($sql); // start defining the RSS Feed // create RSS feed object with channel information $rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('LNK_LINKS_FROM', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname')); $weblink = new TableWeblink($gDb); // Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen while ($row = $statement->fetch()) { // submit links to object $weblink->clear(); $weblink->setArray($row); // set data for attributes of this entry $title = $weblink->getValue('lnk_name'); $description = '<a href="' . $weblink->getValue('lnk_url') . '" target="_blank">' . $weblink->getValue('lnk_url') . '</a>' . '<br /><br />' . $weblink->getValue('lnk_description'); $link = $g_root_path . '/adm_program/modules/links/links.php?id=' . $weblink->getValue('lnk_id'); $author = $row['create_name']; $pubDate = date('r', strtotime($weblink->getValue('lnk_timestamp_create'))); // add entry to RSS feed $rss->addItem($title, $description, $link, $author, $pubDate); } // jetzt nur noch den Feed generieren lassen
* *****************************************************************************/ require_once '../../system/common.php'; // Initialize and check the parameters $getLinkId = admFuncVariableIsValid($_GET, 'lnk_id', 'numeric', array('requireValue' => true)); // check if the module is enabled for use if ($gPreferences['enable_weblinks_module'] == 0) { // module is disabled $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } if ($gPreferences['enable_weblinks_module'] == 2) { // avaiable only with valid login require '../../system/login_valid.php'; } // read link from id $weblink = new TableWeblink($gDb, $getLinkId); // Wenn kein Link gefunden wurde Fehler ausgeben if (strlen($weblink->getValue('lnk_url')) === 0 || !$gValidLogin && $weblink->getValue('cat_hidden') == 1) { $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW')); } // Wenn Link gültig ist, Counter um eine Position erhöhen $weblink->setValue('lnk_counter', $weblink->getValue('lnk_counter') + 1); $weblink->save(); // MR: Neue Prüfung für direkte Weiterleitung oder mit Anzeige if ($gPreferences['weblinks_redirect_seconds'] > 0) { // create html page object $page = new HtmlPage($gL10n->get('LNK_REDIRECT')); // add special header for automatic redirection after x seconds $page->addHeader('<meta http-equiv="refresh" content="' . $gPreferences['weblinks_redirect_seconds'] . '; url=' . $weblink->getValue('lnk_url') . '">'); // Counter zählt die sekunden bis zur Weiterleitung runter $page->addJavascript('
$page->addJavascript('$("#cat_id").change(function () { $("#navbar_cat_id_form").submit(); });', true); $navbarForm = new HtmlForm('navbar_cat_id_form', $g_root_path . '/adm_program/modules/links/links.php?headline=' . $getHeadline, $page, array('type' => 'navbar', 'setFocus' => false)); $navbarForm->addSelectBoxForCategories('cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'LNK', 'FILTER_CATEGORIES', array('defaultValue' => $getCatId)); $LinksMenu->addForm($navbarForm->show(false)); } if ($weblinksCount == 0) { // no weblink found if ($weblinks->getId() > 0) { $page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRY') . '</p>'); } else { $page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRIES') . '</p>'); } } else { $getStart = $weblinks->getStartElement(); $weblinksDataSet = $weblinks->getDataSet($getStart); $weblink = new TableWeblink($gDb); $j = 0; // counter for fetchObject $i = 0; // counter for links in category $previous_cat_id = -1; // previous Cat Id $new_category = true; // maybe new category if ($weblinksDataSet['numResults'] > 0) { // show all weblinks foreach ($weblinksDataSet['recordset'] as $row) { // initialize weblink object and read new recordset into this object $weblink->clear(); $weblink->setArray($row); if ($weblink->getValue('lnk_cat_id') != $previous_cat_id) {
require_once '../../system/common.php'; require_once '../../system/login_valid.php'; // Initialize and check the parameters $getLinkId = admFuncVariableIsValid($_GET, 'lnk_id', 'numeric'); $getMode = admFuncVariableIsValid($_GET, 'mode', 'numeric', array('requireValue' => true)); // check if the module is enabled for use if ($gPreferences['enable_weblinks_module'] == 0) { // module is disabled $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } // erst pruefen, ob der User auch die entsprechenden Rechte hat if (!$gCurrentUser->editWeblinksRight()) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // Linkobjekt anlegen $link = new TableWeblink($gDb, $getLinkId); $_SESSION['links_request'] = $_POST; if ($getMode == 1 || $getMode == 3 && $getLinkId > 0) { if (strlen(strStripTags($_POST['lnk_name'])) == 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('LNK_LINK_NAME'))); } if (strlen(strStripTags($_POST['lnk_url'])) == 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('LNK_LINK_ADDRESS'))); } if (strlen($_POST['lnk_cat_id']) == 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_CATEGORY'))); } // make html in description secure $_POST['lnk_description'] = admFuncVariableIsValid($_POST, 'lnk_description', 'html'); // POST Variablen in das Ankuendigungs-Objekt schreiben foreach ($_POST as $key => $value) {
require_once '../../system/common.php'; require_once '../../system/login_valid.php'; // Initialize and check the parameters $getLinkId = admFuncVariableIsValid($_GET, 'lnk_id', 'int'); $getMode = admFuncVariableIsValid($_GET, 'mode', 'int', array('requireValue' => true)); // check if the module is enabled for use if ($gPreferences['enable_weblinks_module'] == 0) { // module is disabled $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } // erst pruefen, ob der User auch die entsprechenden Rechte hat if (!$gCurrentUser->editWeblinksRight()) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // Linkobjekt anlegen $link = new TableWeblink($gDb, $getLinkId); $_SESSION['links_request'] = $_POST; if ($getMode === 1 || $getMode === 3 && $getLinkId > 0) { if (strlen(strStripTags($_POST['lnk_name'])) === 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('LNK_LINK_NAME'))); } if (strlen(strStripTags($_POST['lnk_url'])) === 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('LNK_LINK_ADDRESS'))); } if (strlen($_POST['lnk_cat_id']) === 0) { $gMessage->show($gL10n->get('SYS_FIELD_EMPTY', $gL10n->get('SYS_CATEGORY'))); } // make html in description secure $_POST['lnk_description'] = admFuncVariableIsValid($_POST, 'lnk_description', 'html'); // POST Variablen in das Ankuendigungs-Objekt schreiben foreach ($_POST as $key => $value) {