Ejemplo n.º 1
0
$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
$page = new HtmlPage($headline);
// add back link to module menu
$linksCreateMenu = $page->getMenu();
$linksCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
Ejemplo n.º 2
0
                                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
$rss->buildFeed();