Example #1
0
function show_langs()
{
    global $currentlang, $cpgtpl;
    $langsel = array('afrikaans' => 'Afrikaans', 'albanian' => 'Shqip', 'arabic' => 'عربي', 'basque' => 'Basque', 'bosanski' => 'Bosanski', 'brazilian' => 'Brazilian Português', 'bulgarian' => 'Български', 'castellano' => 'Castellano', 'czech' => 'Český', 'danish' => 'Dansk', 'desi' => 'Desi', 'dutch' => 'Nederlands', 'english' => 'English', 'estonian' => 'Eesti', 'farsi' => 'پارسى', 'finnish' => 'Suomi', 'french' => 'Français', 'galego' => 'Galego', 'german' => 'Deutsch', 'greek' => 'Ελληνικά', 'hindi' => 'हिंदी', 'hungarian' => 'Magyarul', 'icelandic' => 'Íslenska', 'indonesian' => 'Bahasa Indonesia', 'italian' => 'Italiano', 'japanese' => '日本語', 'korean' => '한국어', 'kurdish' => 'Kurdî', 'latvian' => 'Latvisks', 'lithuanian' => 'Lietuvių', 'macedonian' => 'македонски', 'melayu' => 'Melay', 'norwegian' => 'Norsk', 'polish' => 'Polski', 'portuguese' => 'Português', 'romanian' => 'Româneste', 'russian' => 'РУССКИЙ', 'serbian' => 'Srpski', 'slovak' => 'Slovenský', 'slovenian' => 'Slovenščina', 'spanish' => 'Espanõl', 'swahili' => 'Kiswahili', 'swedish' => 'Svensk', 'thai' => 'ไทย', 'turkish' => 'Türkçe', 'uighur' => 'Uyghurche', 'ukrainian' => 'Українська', 'vietnamese' => 'Tiếng Việt');
    $langlist = lang_selectbox('', '', false, true);
    require_once 'url_from_varval.php';
    for ($i = 0; $i < sizeof($langlist); $i++) {
        if ($langlist[$i] != '') {
            $lang_name = isset($langsel[$langlist[$i]]) ? $langsel[$langlist[$i]] : $langlist[$i];
            $cpgtpl->assign_block_vars('sitelanguage', array('B_CURRENTLANG' => $langlist[$i] == $currentlang, 'U_SITELANGUAGE' => url_from_varval('newlang', $langlist[$i]), 'S_SITELANGUAGE' => $lang_name));
        }
    }
    unset($langsel);
}
Example #2
0
                $act_alt = _ACTIVE;
            } else {
                $act_img = 'unchecked.gif';
                $act_alt = _INACTIVE;
            }
            echo '<tr' . $bgcolor . '>
		<td align="center"><strong>' . $mid . '</strong></td>
		<td align="left" style="width:100%;">' . $title . '</td>
		<td align="center">' . $mlanguage . '</td>
		<td align="center" style="white-space:nowrap;">' . $mview . '</td>
		<td align="center"><a href="' . URL::admin('&amp;status=' . $mid) . '"><img src="images/' . $act_img . '" alt="' . $act_alt . '" title="' . $act_alt . '" /></a></td>
		<td align="right" style="white-space:nowrap;"><a href="' . URL::admin('&amp;edit=' . $mid) . '">' . _EDIT . '</a> / <a href="' . URL::admin('&amp;del=' . $mid) . '">' . _DELETE . '</a>
		</td></tr>';
        }
        echo '</table><br />';
        CloseTable();
        echo '<br />';
        OpenTable();
        echo '<div style="text-align:center;" class="option">' . _ADDMSG . '</div><br />
	<form name="message" action="' . URL::admin('messages&amp;save=0') . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . '<strong>' . _MESSAGETITLE . '</strong><br />' . '<input type="text" name="title" value="" size="50" maxlength="100" /><br /><br />' . '<strong>' . _MESSAGECONTENT . '</strong><br />' . bbcode_table('content', 'message', 1) . '<div style="float:left;">
	<textarea name="content" rows="15" wrap="virtual" cols="63" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea></div>
	<div style="float: left; margin-left: 5px">' . smilies_table('inline', 'content', 'message') . '</div><br /><br />';
        if ($MAIN_CFG['global']['multilingual']) {
            echo '<strong>' . _LANGUAGE . '</strong> ' . lang_selectbox($MAIN_CFG['global']['language'], 'language') . '<br /><br />';
        } else {
            echo '<input type="hidden" name="language" value="" />';
        }
        echo '<strong>' . _EXPIRATION . '</strong> ' . select_box('expire', 0, array(86400 => '1 ' . _DAY, 172800 => '2 ' . _DAYS, 432000 => '5 ' . _DAYS, 1296000 => '15 ' . _DAYS, 2592000 => '30 ' . _DAYS, 0 => _UNLIMITED)) . '<br /><br />' . '<strong>' . _ACTIVATE2 . '</strong> ' . yesno_option('active', 1) . '<br /><br /><strong>' . _VIEWPRIV . '</strong> ' . group_selectbox('view', 0, true) . '<br /><br /><input type="submit" value="' . _ADDMSG . '" /></form>';
    }
}
CloseTable();
Example #3
0
// both exist in php 4.1.0+ so $_SERVER['PHP_SELF'] is used
$self = $_SERVER['PHP_SELF'];
$self = str_replace('/', '', $self);
if ($self = '') {
    $self = 'index.php';
}
global $useflags, $currentlang, $mainindex, $adminindex;
$langsel = array('afrikaans' => 'Afrikaans', 'albanian' => 'Shqip', 'arabic' => 'عربي', 'basque' => 'Basque', 'bosanski' => 'Bosanski', 'brazilian' => 'Brazilian', 'bulgarian' => 'Български', 'czech' => 'Český', 'danish' => 'Dansk', 'desi' => 'Desi', 'dutch' => 'Nederlands', 'english' => 'English', 'estonian' => 'Eesti', 'farsi' => 'پارسى', 'finnish' => 'Suomi', 'french' => 'Français', 'galego' => 'galego', 'german' => 'German', 'greek' => 'Ελληνικά', 'hindi' => 'हिंदी', 'hungarian' => 'Magyarul', 'icelandic' => 'Icelandic', 'indonesian' => 'Indonesian', 'italian' => 'Italiano', 'japanese' => '日本語', 'korean' => '한국어', 'kurdish' => 'Kurdi', 'latvian' => 'Latvisks', 'lithuanian' => 'Lietuvių', 'macedonian' => 'македонски', 'melayu' => 'Melay', 'norwegian' => 'Norsk', 'polish' => 'Polski', 'portuguese' => 'Português', 'romanian' => 'Româneste', 'russian' => 'РУССКИЙ', 'serbian' => 'Srpski', 'slovak' => 'Slovenský', 'slovenian' => 'Slovenščina', 'spanish' => 'Espanõl', 'swahili' => 'Kiswahili', 'swedish' => 'Svensk', 'thai' => 'ไทย', 'turkish' => 'Türkçe', 'uighur' => 'Uyghurche', 'ukrainian' => 'Українська', 'vietnamese' => 'Vietnamese');
$self = defined('ADMIN_PAGES') ? $adminindex : $mainindex;
$qs = '?';
foreach ($_GET as $var => $value) {
    if ($var != 'newlang') {
        $qs .= $var . '=' . ($value .= '&amp;');
    }
}
$langlist = lang_selectbox('', '', false, true);
$menulist = '';
$content = '<fieldset style="background-color:#FFFFFF;border:thin outset; border-color: #999999;-moz-border-radius:10px;">
<legend style="border: thin outset; border-color: #999999;background-color:#FFFFFF;padding:3px;-moz-border-radius:15px;border-radius:15px;">' . _SELECTLANGUAGE . '</legend>
<div style="text-align:center;"><br />';
if ($useflags) {
    for ($i = 0; $i < sizeof($langlist); $i++) {
        if ($langlist[$i] != "") {
            $tl = $langlist[$i];
            $altlang = isset($langsel[$langlist[$i]]) ? $langsel[$langlist[$i]] : $langlist[$i];
            $content .= "<a href=\"{$self}{$qs}newlang={$tl}\">";
            $imge = "images/language/flag-{$tl}.png";
            // akamu fix for broken images if lang doesn't have flag
            if (file_exists($imge)) {
                $content .= "<img src=\"{$imge}\" align=\"middle\" alt=\"{$altlang}\" title=\"{$altlang}\" style=\"margin:3px 0 0 3px;\" />";
            } else {
Example #4
0
    echo '<span class="genmed"><strong>' . _EPHEMADMIN . '</strong></span><br /><br />' . open_form(URL::admin(), false, _ADDEPHEM);
    $nmonth = array(1 => _JANUARY, _FEBRUARY, _MARCH, _APRIL, _MAY, _JUNE, _JULY, _AUGUST, _SEPTEMBER, _OCTOBER, _NOVEMBER, _DECEMBER);
    echo _UMONTH . ': <select name="month">';
    while (list($nmonth_key, $nmonth_name) = each($nmonth)) {
        echo '<option value="' . $nmonth_key . '">' . $nmonth_name . '</option>';
    }
    echo '</select> &nbsp;';
    $nday = 1;
    echo _DAY . ': <select name="day">';
    while ($nday <= 31) {
        echo '<option value="' . $nday . '">' . $nday . '</option>';
        $nday++;
    }
    echo '</select> &nbsp;' . _YEAR . ': <input type="text" name="year" size="5" maxlength="4" /><br /><br />';
    if ($MAIN_CFG['global']['multilingual']) {
        echo _LANGUAGE . ': ' . lang_selectbox($MAIN_CFG['global']['language'], 'language') . '<br /><br />';
    } else {
        echo '<input type="hidden" name="language" value="' . $MAIN_CFG['global']['language'] . '" />';
    }
    echo _EPHEMDESC . ':<br />
	<textarea name="content" cols="60" rows="10"></textarea><br /><br />
	<input type="submit" name="createEntry" value="' . _ADD . '" />' . close_form() . '<br />' . open_form(URL::admin(), false, _EPHEMMAINT);
    $nmonth = array(1 => _JANUARY, _FEBRUARY, _MARCH, _APRIL, _MAY, _JUNE, _JULY, _AUGUST, _SEPTEMBER, _OCTOBER, _NOVEMBER, _DECEMBER);
    echo _UMONTH . ': <select name="month">';
    while (list($nmonth_key, $nmonth_name) = each($nmonth)) {
        echo '<option value="' . $nmonth_key . '">' . $nmonth_name . '</option>';
    }
    echo '</select> &nbsp;';
    $nday = 1;
    echo _DAY . ': <select name="day">';
    while ($nday <= 31) {
Example #5
0
                         natcasesort($themelist);
                         echo '<select name="' . $row['field'] . '">';
                         for ($i = 0; $i < count($themelist); $i++) {
                             if ($themelist[$i] != '') {
                                 echo "<option value=\"{$themelist[$i]}\" ";
                                 if ($userinfo['theme'] == '' && $themelist[$i] == $MAIN_CFG['global']['Default_Theme'] || $userinfo['theme'] == $themelist[$i]) {
                                     echo 'selected="selected"';
                                 }
                                 echo ">{$themelist[$i]}</option>\n";
                             }
                         }
                         echo '</select>';
                     } else {
                         if ($row['type'] == 8) {
                             if ($row['field'] == 'user_lang') {
                                 echo lang_selectbox($MAIN_CFG['global']['language'], $row['field'], false);
                             }
                             /* possible integration of array list custom fields
                             			else {
                             				get_lang('custom');
                             				global $fieldlist;
                             				echo select_box($row['field'], $fieldlist[$row['field']]['default'], $fieldlist[$row['field']]['values']);
                             			}
                             			*/
                         }
                     }
                 }
             }
         }
     }
 }
Example #6
0
function ma_formfield($type, $field, $size, $userinfo)
{
    global $MAIN_CFG, $CPG_SESS, $l10n_dst_regions, $l10n_gmt_regions;
    if ($type == 0) {
        return '<input type="text" name="' . ($field == 'name' ? 'realname' : $field) . '" value="' . htmlprepare($userinfo[$field]) . '" class="post" style="width: 200px" size="25" maxlength="' . $size . '" />';
    } else {
        if ($type == 1) {
            return yesno_option($field, is_user() ? $userinfo[$field] : $size);
        } else {
            if ($type == 2) {
                return '<textarea name="' . $field . '" style="width: 300px" rows="6" cols="30" class="post">' . htmlprepare($userinfo[$field]) . '</textarea>';
            } else {
                if ($type == 3) {
                    $ret = select_box($field, $userinfo[$field], $l10n_gmt_regions);
                    if ($field == 'user_timezone') {
                        $ret .= '<br /><select name="user_dst">';
                        foreach ($l10n_dst_regions as $region => $data) {
                            $sel = $userinfo['user_dst'] == $region ? 'selected="selected"' : '';
                            $ret .= "<option value=\"{$region}\" {$sel}>{$data['0']}</option>\n";
                        }
                        $ret .= '</select>';
                    }
                    return $ret;
                } else {
                    if ($type == 4) {
                        return '<input type="text" name="' . $field . '" value="' . htmlprepare(is_user() ? $userinfo[$field] : '') . '" class="post" style="width: 100px" size="15" maxlength="' . $size . '" />';
                    } else {
                        if ($type == 5) {
                            return select_box($field, is_user() ? $userinfo[$field] : 'm', array('m' => _MALE, 'f' => _FEMALE));
                        } else {
                            if ($type == 6) {
                                return '<input type="text" name="' . $field . '" value="' . (is_user() ? date_short($userinfo[$field]) : '') . '" class="post" style="width: 100px" size="15" maxlength="10" /> 10/24/1980';
                            } else {
                                if ($type == 7) {
                                    $themelist = array();
                                    $handle = opendir('themes');
                                    while ($file = readdir($handle)) {
                                        if (false === strpos($file, '.') && $file != 'CVS' && file_exists("themes/{$file}/theme.php")) {
                                            $themelist[] = "{$file}";
                                        }
                                    }
                                    closedir($handle);
                                    natcasesort($themelist);
                                    return select_option($field, is_user() && !empty($userinfo['theme']) && is_dir('themes/' . $userinfo['theme']) ? $userinfo['theme'] : $CPG_SESS['theme'], $themelist);
                                } else {
                                    if ($type == 8) {
                                        if ($field == 'user_lang') {
                                            return lang_selectbox($userinfo['user_lang'], $field, false);
                                        }
                                        return '';
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return '';
}
Example #7
0
function mod_review()
{
    global $prefix, $db, $MAIN_CFG, $module_name;
    $id = intval($_GET['id']);
    if ($id == 0 || !can_admin(strtolower($module_name))) {
        cpg_error('This function must be passed argument id, or you are not admin.');
    }
    if (!($myrow = $db->sql_ufetchrow("SELECT * FROM " . $prefix . "_reviews WHERE id = {$id}"))) {
        cpg_error('Review with id "' . $id . '" doesn\'t exist');
    }
    $bb = $MAIN_CFG['Reviews']['allow_bbcode'] || can_admin(strtolower($module_name)) ? bbcode_table('text', 'reviewmod', 1) : '';
    require_once 'header.php';
    OpenTable();
    echo '<div style="text-align:center;"><b>' . _REVIEWMOD . '</b></div><br /><br />
    <form method="post" name="reviewmod" action="' . URL::index('&amp;rop=preview_review') . '">
    <table border="0" width="100%">
    <tr>
        <td style="width:12%;"><b>' . _RDATE . '</b><input type="hidden" name="id" value="' . $myrow['id'] . '" /></td>
        <td><input type="text" name="date" size="15" value="' . $myrow['date'] . '" maxlength="10" /></td>
    </tr><tr>
        <td><b>' . _RTITLE . '</b></td>
        <td><input type="text" name="title" size="50" maxlength="150" value="' . htmlprepare($myrow['title']) . '" /></td>
    </tr><tr>
        <td><b>' . _LANGUAGE . '</b></td><td>' . lang_selectbox($myrow['language'], 'language') . '</td>
    </tr><tr>
        <td><b>' . _RTEXT . '</b></td>
        <td>' . $bb . '<br /><textarea class="textbox" name="text" rows="20" wrap="virtual" cols="60">' . $myrow['text'] . '</textarea></td>
    </tr><tr>
        <td><b>' . _REVIEWER . '</b></td>
        <td><input type="text" name="reviewer" size="41" maxlength="40" value="' . $myrow['reviewer'] . '" /></td>
    </tr><tr>
        <td><b>' . _REVEMAIL . '</b></td>
        <td><input type="text" name="email" value="' . $myrow['email'] . '" size="30" maxlength="80" /></td>
    </tr><tr>
        <td><b>' . _SCORE . '</b></td>
        <td><input type="text" name="score" value="' . $myrow['score'] . '" size="3" maxlength="2" /></td>
    </tr><tr>
        <td><b>' . _RLINK . '</b></td>
        <td><input type="text" name="url" value="' . $myrow['url'] . '" size="30" maxlength="100" /></td>
    </tr><tr>
        <td><b>' . _RLINKTITLE . '</b></td>
        <td><input type="text" name="url_title" value="' . htmlprepare($myrow['url_title']) . '" size="30" maxlength="50" /></td>
    </tr><tr>
        <td><b>' . _COVERIMAGE . '</b></td>
        <td><input type="text" name="cover" value="' . $myrow['cover'] . '" size="30" maxlength="100" /></td>
    </tr><tr>
        <td><b>' . _HITS . ':</b></td>
        <td><input type="text" name="hits" value="' . $myrow['hits'] . '" size="5" maxlength="5" /></td>
    </tr><tr>
		<td colspan="2"><input type="submit" value="' . _PREMODS . '" />&nbsp;&nbsp;<input type="button" onclick="history.go(-1)" value="' . _CANCEL . '" /></td>
    </tr>
    </table>
    </form>';
    CloseTable();
}
Example #8
0
function BlocksEdit($bid)
{
    global $prefix, $db, $MAIN_CFG, $pagetitle, $cpgtpl;
    $pagetitle .= ' ' . _BC_DELIM . ' ' . _EDITBLOCK;
    require 'header.php';
    GraphicAdmin('_AMENU1');
    list($title, $bkey, $content, $url, $bposition, $weight, $active, $refresh, $blanguage, $blockfile, $view) = $db->sql_ufetchrow("SELECT title, bkey, content, url, bposition, weight, active, refresh, blanguage, blockfile, view FROM " . $prefix . "_blocks WHERE bid='" . $bid . "'", SQL_NUM);
    $typebb = $typerss = $typefile = false;
    $blocks_edit_vars = array('S_NAME' => $title, 'S_BID' => $bid, 'S_WEIGHT' => $weight, 'S_NAME_DEF' => (defined($title) ? constant($title) : str_replace('_', ' ', $title)) . ":", 'U_BLOCKS' => URL::admin('blocks'), 'MULTILANG' => $MAIN_CFG['global']['multilingual'], 'BPOSITION' => $bposition, 'SEL_POSITION' => select_box('bposition', $bposition, array('l' => _LEFT, 'c' => _CENTERUP, 'd' => _CENTERDOWN, 'r' => _RIGHT)), 'SEL_ACTIVATE' => yesno_option('active', $active), 'SEL_GROUP' => group_selectbox('view', $view, true), 'S_VIEW_COMMENT' => 'Default ' . _ACTIVE);
    if ($MAIN_CFG['global']['multilingual']) {
        $blocks_edit_vars += array('SEL_LANG' => lang_selectbox($blanguage, 'blanguage'));
    }
    switch ($bkey) {
        case 'file':
            $typefile = true;
            $blocksdir = dir('blocks');
            while ($func = $blocksdir->read()) {
                if (substr($func, 0, 6) == 'block-') {
                    $bl = str_replace('_', ' ', substr($func, 6, -4));
                    $blockslist[$func] = $bl;
                }
            }
            closedir($blocksdir->handle);
            ksort($blockslist);
            $blocks_edit_vars += array('S_BLOCK_OP' => select_box('blockfile', $blockfile, $blockslist), 'S_BLOCK_INFO' => _FILEINCLUDE);
            break;
        case 'rss':
            $typerss = true;
            $blocks_edit_vars += array('S_BLOCK_OP' => $url, 'SEL_REFRESH' => select_box('refresh', $refresh, array('1800' => '1/2 ' . _HOUR, '3600' => '1 ' . _HOUR, '18000' => '5 ' . _HOURS, '36000' => '10 ' . _HOURS, '86400' => '24 ' . _HOURS)));
            break;
        case 'admin':
        case 'custom':
            $typebb = true;
            $blocks_edit_vars += array('S_BLOCK_OP' => bbcode_table('content', 'blocksedit', 1), 'S_BLOCK_INFO' => $content);
            break;
        default:
            break;
    }
    $blocks_list = blocks_list();
    foreach ($blocks_list as $module => $data) {
        $cpgtpl->assign_block_vars($data['mid'] == -1 ? 'admin' : (is_active($module) ? 'active' : 'inactive'), array('S_MOD_VALUE' => $data['mid'], 'S_MOD_TITLE' => defined($data['title']) ? constant($data['title']) : $data['title'], 'S_MOD_SELECTED' => isset($data[$bid]) ? ' selected="selected"' : ''));
    }
    $blocks_edit_vars += array('TYPEFILE' => $typefile, 'TYPERSS' => $typerss, 'TYPEBB' => $typebb);
    $cpgtpl->assign_vars($blocks_edit_vars);
    $cpgtpl->set_handle('body', 'admin/blocks_edit.html');
    $cpgtpl->display('body');
}
Example #9
0
        echo open_form(URL::index('&amp;file=submit'), 'submitnews', _Submit_NewsLANG) . '
	<label class="ulog" for="subject">' . _SUBTITLE . '</label>
	  <input type="text" name="subject" id="subject" size="65" maxlength="80" value="' . $subject . '" /><br /><br />
	<label class="ulog" for="topic">' . _TOPIC . '</label>
	  <select name="topic" id="topic">';
        $result = $db->sql_query('SELECT topicid, topictext FROM ' . $prefix . '_topics ORDER BY topictext');
        echo '<option value="">' . _SELECTTOPIC . "</option>\n";
        while ($row = $db->sql_fetchrow($result)) {
            $sel = $row['topicid'] == $topic ? 'selected="selected" ' : '';
            echo "<option {$sel} value=\"{$row['topicid']}\">{$row['topictext']}</option>\n";
        }
        echo '</select><br /><br />';
        if ($MAIN_CFG['global']['multilingual']) {
            echo '
		<label class="ulog" for="alanguage">' . _LANGUAGE . '</label>
		  ' . lang_selectbox($alanguage) . '<br /><br />';
        }
        echo '
	<label class="ulog">' . _EDITOR_STYLE . '</label>
		' . $story_editor->getSelect() . '<br /><br />
	' . _STORYTEXT . '<br />
		' . $story_editor->getHTML() . '<br />
	' . _EXTENDEDTEXT . '<br />
		' . $storyext_editor->getHTML() . '<br /><br />
	<div style="text-align:center;"><input type="submit" value="' . _PREVIEW . '" />';
        if ($story != '') {
            echo '&nbsp;&nbsp;<input type="submit" name="submit" value="' . _OK . '" />';
        }
        echo '</div>' . close_form();
        CloseTable();
    }