Beispiel #1
0
// Nachschauen ob RSS ueberhaupt aktiviert ist bzw. das Modul oeffentlich zugaenglich ist
if ($gPreferences['enable_announcements_module'] != 1) {
    // das Modul ist deaktiviert
    $gMessage->show($gL10n->get('SYS_MODULE_DISABLED'));
}
//Objekt anlegen
$announcements = new ModuleAnnouncements();
/*** ab hier wird der RSS-Feed zusammengestellt**/
// create RSS feed object with channel information
$rss = new RSSfeed($gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline, $gCurrentOrganization->getValue('org_homepage'), $gL10n->get('ANN_RECENT_ANNOUNCEMENTS_OF_ORGA', $gCurrentOrganization->getValue('org_longname')), $gCurrentOrganization->getValue('org_longname'));
//Wenn Ankündigungen vorhanden laden
if ($announcements->getDataSetCount() > 0) {
    $announcement = new TableAnnouncement($gDb);
    $rows = $announcements->getDataset(0, 10);
    // Dem RSSfeed-Objekt jetzt die RSSitems zusammenstellen und hinzufuegen
    foreach ($rows['recordset'] as $row) {
        // ausgelesene Ankuendigungsdaten in Announcement-Objekt schieben
        $announcement->clear();
        $announcement->setArray($row);
        // set data for attributes of this entry
        $title = $announcement->getValue('ann_headline');
        $description = $announcement->getValue('ann_description');
        $link = $g_root_path . '/adm_program/modules/announcements/announcements.php?id=' . $announcement->getValue('ann_id') . '&headline=' . $getHeadline;
        $author = $row['create_name'];
        $pubDate = date('r', strtotime($announcement->getValue('ann_timestamp_create')));
        // add entry to RSS feed
        $rss->addItem($title, $description, $link, $author, $pubDate);
    }
}
// jetzt nur noch den Feed generieren lassen
$rss->buildFeed();
          hist_description text CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
          PRIMARY KEY (hist_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
        $result = $gDb->query($sql);
    }
    // show link to edit history
    $historyMenu->addItem('menu_item_edit_history', $g_root_path . '/adm_plugins/history_plugin/history_edit.php?hist_id=' . $getId . '&amp;?headline=' . $getHeadline, '<i class="fa fa-pencil" alt="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '" title="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '"></i><div class="iconDescription">Text bearbeiten</div>', '');
}
// Output Database Entry if available
if (check_db() == true) {
    // get all recordsets
    $historysArray = $historys->getDataSet();
    $history = new TableAnnouncement($gDb);
    if ($historysArray['numResults'] != 0) {
        /// show all history
        foreach ($historysArray['recordset'] as $row) {
            $history->clear();
            $history->setArray($row);
            $page->addHtml('
            <div class="panel panel-primary" id="hist_' . $history->getValue('hist_id') . '">
                <div class="panel-body">' . $history->getValue('hist_description') . '</div>
            </div>');
        }
        // Ende foreach
    } else {
        if (!$gCurrentUser->isWebmaster()) {
            $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
        }
    }
} else {
    $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
}
Beispiel #3
0
          sts_description text CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
          PRIMARY KEY (sts_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
        $result = $gDb->query($sql);
    }
    // show link to edit Startseite
    $stsMenu->addItem('menu_item_edit_sts', $g_root_path . '/adm_plugins/sts_plugin/sts_edit.php?sts_id=' . $getId . '&amp;?headline=' . $getHeadline, '<i class="fa fa-pencil" alt="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '" title="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '"></i><div class="iconDescription">Text bearbeiten</div>', '');
}
// Output Database Entry if available
if (check_db() == true) {
    // get all recordsets
    $stssArray = $stss->getDataSet();
    $sts = new TableAnnouncement($gDb);
    if ($stssArray['numResults'] != 0) {
        /// show all sts
        foreach ($stssArray['recordset'] as $row) {
            $sts->clear();
            $sts->setArray($row);
            $page->addHtml('
            <div class="panel panel-primary" id="sts_' . $sts->getValue('sts_id') . '">
                <div class="panel-body">' . $sts->getValue('sts_description') . '</div>
            </div>');
        }
        // Ende foreach
    } else {
        if (!$gCurrentUser->isWebmaster()) {
            $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
        }
    }
} else {
    $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
}
// Sprachdatei des Plugins einbinden
$gL10n->addLanguagePath(PLUGIN_PATH . '/' . $plugin_folder . '/languages');
// Objekt anlegen
$plg_announcements = new ModuleAnnouncements();
echo '<div id="plugin_' . $plugin_folder . '" class="admidio-plugin-content">';
if ($plg_show_headline == 1) {
    echo '<h3>' . $gL10n->get('PLG_SIDEBAR_ANNOUNCEMENTS_HEADLINE') . '</h3>';
}
if ($plg_announcements->getDataSetCount() == 0) {
    echo $gL10n->get('SYS_NO_ENTRIES');
} else {
    // Daten holen
    $plg_getAnnouncements = $plg_announcements->getDataSet(0, $plg_announcements_count);
    $plg_announcement = new TableAnnouncement($gDb);
    foreach ($plg_getAnnouncements['recordset'] as $plg_row) {
        $plg_announcement->clear();
        $plg_announcement->setArray($plg_row);
        echo '<div><a class="' . $plg_link_class . '" href="' . $g_root_path . '/adm_program/modules/announcements/announcements.php?id=' . $plg_announcement->getValue("ann_id") . '&amp;headline=' . $gL10n->get('PLG_ANNOUNCEMENTS_HEADLINE') . '" target="' . $plg_link_target . '">';
        if ($plg_max_char_per_word > 0) {
            $plg_new_headline = "";
            unset($plg_words);
            // Woerter unterbrechen, wenn sie zu lang sind
            $plg_words = explode(" ", $plg_announcement->getValue('ann_headline'));
            foreach ($plg_words as $plg_key => $plg_value) {
                if (strlen($plg_value) > $plg_max_char_per_word) {
                    $plg_new_headline = $plg_new_headline . ' ' . substr($plg_value, 0, $plg_max_char_per_word) . '-<br />' . substr($plg_value, $plg_max_char_per_word);
                } else {
                    $plg_new_headline = $plg_new_headline . ' ' . $plg_value;
                }
            }
            echo $plg_new_headline . '</a></div>';
          support_description text CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
          PRIMARY KEY (support_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
        $result = $gDb->query($sql);
    }
    // show link to edit Support
    $supportMenu->addItem('menu_item_edit_support', $g_root_path . '/adm_plugins/support_plugin/support_edit.php?support_id=' . $getId . '&amp;?headline=' . $getHeadline, '<i class="fa fa-pencil" alt="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '" title="' . $gL10n->get('SYS_EDIT_VAR', $getHeadline) . '"></i><div class="iconDescription">Text bearbeiten</div>', '');
}
// Output Database Entry if available
if (check_db() == true) {
    // get all recordsets
    $supportsArray = $supports->getDataSet();
    $support = new TableAnnouncement($gDb);
    if ($supportsArray['numResults'] != 0) {
        /// show all support
        foreach ($supportsArray['recordset'] as $row) {
            $support->clear();
            $support->setArray($row);
            $page->addHtml('
            <div class="panel panel-primary" id="support_' . $support->getValue('support_id') . '">
                <div class="panel-body">' . $support->getValue('support_description') . '</div>
            </div>');
        }
        // Ende foreach
    } else {
        if (!$gCurrentUser->isWebmaster()) {
            $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
        }
    }
} else {
    $gMessage->show($gL10n->get('SYS_NO_DATA_FOUND'));
}