Exemplo n.º 1
0
// This program is distributed in the hope that it will be useful,          //
// but WITHOUT ANY WARRANTY; without even the implied warranty of           //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
// GNU General Public License for more details.                             //
// 																			//
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //
include_once '../../../include/cp_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopstopic.php';
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
include_once XOOPS_ROOT_PATH . '/modules/news/admin/functions.php';
xoops_cp_header();
news_adminmenu(2);
echo '<br /><br /><br />';
$permtoset = isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1;
$selected = array('', '', '');
$selected[$permtoset - 1] = ' selected';
echo "<form method='post' name='fselperm' action='groupperms.php'><select name='permtoset' onChange='javascript: document.fselperm.submit()'><option value='1'" . $selected[0] . ">" . _AM_APPROVEFORM . "</option><option value='2'" . $selected[1] . ">" . _AM_SUBMITFORM . "</option><option value='3'" . $selected[2] . ">" . _AM_VIEWFORM . "</option></select> <input type='submit' name='go'></form>";
$module_id = $xoopsModule->getVar('mid');
switch ($permtoset) {
    case 1:
        $title_of_form = _AM_APPROVEFORM;
        $perm_name = 'news_approve';
        $perm_desc = _AM_APPROVEFORM_DESC;
        break;
    case 2:
        $title_of_form = _AM_SUBMITFORM;
        $perm_name = 'news_submit';
Exemplo n.º 2
0
/**
 * Metagen
 *
 * Metagen is a system that can help you to have your page best indexed by search engines.
 * Except if you type meta keywords and meta descriptions yourself, the module will automatically create them.
 * From here you can also manage some other options like the maximum number of meta keywords to create and
 * the keywords apparition's order.
 */
function Metagen()
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $cfg;
    xoops_cp_header();
    $myts =& MyTextSanitizer::getInstance();
    if (file_exists(XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php')) {
        include_once XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php';
    } else {
        include_once XOOPS_ROOT_PATH . '/modules/news/language/english/main.php';
    }
    news_adminmenu(8);
    echo "<h1>" . _AM_NEWS_METAGEN . "</h1>";
    echo _AM_NEWS_METAGEN_DESC . "<br /><br />";
    // Metagen Options
    $registry = new news_registryfile('news_metagen_options.txt');
    $content = '';
    $content = $registry->getfile();
    if (xoops_trim($content) != '') {
        list($keywordscount, $keywordsorder) = explode(',', $content);
    } else {
        $keywordscount = $cfg['meta_keywords_count'];
        $keywordsorder = $cfg['meta_keywords_order'];
    }
    $sform = new XoopsThemeForm(_OPTIONS, 'metagenoptions', XOOPS_URL . '/modules/news/admin/index.php', 'post');
    $sform->addElement(new XoopsFormHidden('op', 'metagenoptions'), false);
    $sform->addElement(new XoopsFormText(_AM_NEWS_META_KEYWORDS_CNT, 'keywordscount', 4, 6, $keywordscount), true);
    $keywordsorder = new XoopsFormRadio(_AM_NEWS_META_KEYWORDS_ORDER, 'keywordsorder', $keywordsorder);
    $keywordsorder->addOption(0, _AM_NEWS_META_KEYWORDS_INTEXT);
    $keywordsorder->addOption(1, _AM_NEWS_META_KEYWORDS_FREQ1);
    $keywordsorder->addOption(2, _AM_NEWS_META_KEYWORDS_FREQ2);
    $sform->addElement($keywordsorder, false);
    $button_tray = new XoopsFormElementTray('', '');
    $submit_btn = new XoopsFormButton('', 'post', _AM_MODIFY, 'submit');
    $button_tray->addElement($submit_btn);
    $sform->addElement($button_tray);
    $sform->display();
    // Blacklist
    $sform = new XoopsThemeForm(_AM_NEWS_BLACKLIST, 'metagenblacklist', XOOPS_URL . '/modules/news/admin/index.php', 'post');
    $sform->addElement(new XoopsFormHidden('op', 'metagenblacklist'), false);
    // Remove words
    $remove_tray = new XoopsFormElementTray(_AM_NEWS_BLACKLIST);
    $remove_tray->setDescription(_AM_NEWS_BLACKLIST_DESC);
    $blacklist = new XoopsFormSelect('', 'blacklist', '', 5, true);
    $words = array();
    $metablack = new news_blacklist();
    $words = $metablack->getAllKeywords();
    if (is_array($words) && count($words) > 0) {
        foreach ($words as $key => $value) {
            $blacklist->addOption($key, $value);
        }
    }
    $blacklist->setDescription(_AM_NEWS_BLACKLIST_DESC);
    $remove_tray->addElement($blacklist, false);
    $remove_btn = new XoopsFormButton('', 'go', _AM_DELETE, 'submit');
    $remove_tray->addElement($remove_btn, false);
    $sform->addElement($remove_tray);
    // Add some words
    $add_tray = new XoopsFormElementTray(_AM_NEWS_BLACKLIST_ADD);
    $add_tray->setDescription(_AM_NEWS_BLACKLIST_ADD_DSC);
    $add_field = new XoopsFormTextArea('', 'keywords', '', 5, 70);
    $add_tray->addElement($add_field, false);
    $add_btn = new XoopsFormButton('', 'go', _AM_ADD, 'submit');
    $add_tray->addElement($add_btn, false);
    $sform->addElement($add_tray);
    $sform->display();
}