Esempio n. 1
0
function admin_main_article()
{
    $bgcolor1 = $GLOBALS["bgcolor1"];
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    $admart = pnConfigGetVar('admart');
    if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_EDIT)) {
        OpenTable();
        echo '<center><b><font class=\\"pn-normal\\">' . _LAST . ' ' . pnVarPrepForDisplay($admart) . ' ' . _ARTICLES . '</font></b></center>' . "\n" . '<br>' . "\n" . '<table border="1" width="100%" bgcolor="' . $bgcolor1 . '">';
        $storiescolumn =& $pntable['stories_column'];
        $topicscolumn =& $pntable['topics_column'];
        if (strcmp(pnConfigGetVar('dbtype'), 'oci8') == 0) {
            $myquery = "SELECT {$storiescolumn['sid']},\n                               {$storiescolumn['cid']},\n                               {$storiescolumn['aid']},\n                               {$storiescolumn['title']},\n                               {$storiescolumn['time']},\n                               {$storiescolumn['topic']},\n                               {$storiescolumn['informant']},\n                               {$storiescolumn['alanguage']},\n                               {$topicscolumn['topicname']}\n                        FROM {$pntable['stories']}, {$pntable['topics']}\n                        WHERE  {$storiescolumn['topic']}={$topicscolumn['topicid']}(+)\n                        ORDER BY  {$storiescolumn['time']} DESC LIMIT {$admart}";
        } else {
            $myquery = "SELECT {$storiescolumn['sid']},\n                               {$storiescolumn['cid']},\n                               {$storiescolumn['aid']},\n                               {$storiescolumn['title']},\n                               {$storiescolumn['time']},\n                               {$storiescolumn['topic']},\n                               {$storiescolumn['informant']},\n                               {$storiescolumn['alanguage']},\n                               {$topicscolumn['topicname']}\n                        FROM {$pntable['stories']}\n                        LEFT JOIN {$pntable['topics']} ON {$storiescolumn['topic']}={$topicscolumn['topicid']}\n                        ORDER BY  {$storiescolumn['time']} DESC LIMIT {$admart}";
        }
        $result = $dbconn->Execute($myquery);
        while (list($sid, $cid, $said, $title, $time, $topic, $informant, $alanguage, $topicname) = $result->fields) {
            if ($alanguage == '') {
                $alanguage = 'x_all';
            }
            formatTimestamp($time);
            if ($title == "") {
                $title = '- No title -';
            }
            echo '<tr>' . "\n" . '<td align="right"><b>' . pnVarPrepForDisplay($sid) . '</b></td>' . '<td align="left" width="100%"><a href="modules.php?op=modload&amp;name=News&amp;file=article&amp;sid=' . $sid . '">' . pnVarPrepForDisplay($title) . '</a></td>' . "\n" . '<td align="center">' . language_name($alanguage) . '</td>' . "\n" . '<td align="right" nowrap>' . pnVarPrepForDisplay($topicname) . '</td>' . "\n";
            if ($cid == 0) {
                // Default category
                $cattitle = "" . _ARTICLES . "";
            } else {
                $catcolumn =& $pntable['stories_cat_column'];
                $catquery = buildSimpleQuery('stories_cat', array('title'), "{$catcolumn['catid']} = {$cid}");
                $catresult = $dbconn->Execute($catquery);
                list($cattitle) = $catresult->fields;
            }
            if (pnSecAuthAction(0, 'Stories::Story', "{$said}:{$cattitle}:", ACCESS_EDIT)) {
                echo '<td align="right" nowrap>(<a href="admin.php?module=NS-AddStory&amp;op=EditStory&amp;sid=' . $sid . '">' . _EDIT . '</a>';
                if (pnSecAuthAction(0, 'Stories::Story', "{$said}:{$cattitle}:", ACCESS_DELETE)) {
                    echo '-<a href="admin.php?module=NS-AddStory&amp;op=RemoveStory&amp;sid=' . $sid . '">' . _DELETE . '</a>' . "\n";
                }
                echo ')</td>';
            } else {
                echo '<td>&nbsp;</td>';
            }
            echo '</tr>' . "\n";
            $result->MoveNext();
        }
        echo '</table>' . "\n";
        if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_EDIT)) {
            echo '<center>' . "\n" . '<form action="admin.php" method="post">' . "\n" . '<input type="hidden" name="module" value="NS-AddStory">' . "\n" . _STORYID . ': <input type="text" NAME="sid" SIZE="10">' . "\n" . '<select name="op">' . "\n" . '<option value="EditStory" SELECTED>' . _EDIT . '</option>' . "\n";
            if (pnSecAuthAction(0, 'Stories::Story', '::', ACCESS_DELETE)) {
                echo '<option value="RemoveStory">' . _DELETE . '</option>' . "\n";
            }
            echo '</select>' . "\n" . '<input type="hidden" name="authid" value="' . pnSecGenAuthKey() . '">' . '<input type="submit" value="' . _GO . '">' . "\n" . '</form>' . "\n" . '</center>' . "\n";
        }
        CloseTable();
    }
}
Esempio n. 2
0
?>
                        </div>
                    </div>

                </div>
                <div class="col-xs-1 pull-right">     
                    <?php 
AZ::block('account/profile-menu');
?>
                </div>
                <div class="col-xs-2 pull-right">
                        <ul class="language-switcher navbar-right">
                            <a href="javascript:void(0);" class="dropdown-toggle text-center" data-toggle="dropdown">
                                <span class="glyphicon glyphicon-globe"></span>
                                <small class="hidden-xs"><?php 
__(language_name());
?>
</small>
                                <b class="caret"></b></a>
                            <ul class="dropdown-menu dropdown-menu-right ">
                                <?php 
echo language_flags();
?>
                            </ul>
                        </ul>
                </div>
                
            </div>
        </div>
    </div>
Esempio n. 3
0
{
    if ($code == 'en') {
        return "<em>en</em> (English)";
    } else {
        $lname = tr_specific("LANG_NAME_NATIVE", $code);
        if ($lname == 'English' || $lname == '') {
            return "<b>{$code}</b>";
        } else {
            return "<b>{$code}</b> (" . tr_specific("LANG_NAME_INTERNATIONAL", $code) . "/{$lname})";
        }
    }
}
if (count($languages_in_use)) {
    $cur_lang_name = language_name($languages_in_use[0]);
} else {
    $cur_lang_name = language_name('en');
}
echo "<p>", tra("This web site is available in several languages. The currently selected language is %1.", $cur_lang_name), "</p><p>", tra("Normally the choice of language is determined by your browser's language setting, which is: %1.  You can change this setting using:", "<b>{$prefs}</b>"), "</p><ul>", "<li>", tra("Firefox: Tools/Options/General"), "<li>", tra("Microsoft IE: Tools/Internet Options/Languages"), "</ul>", "<p>", tra("Or you can select a language by clicking on one of the links.  This will send your browser a cookie; make sure your browser accepts cookies from our domain."), "</p>";
start_table();
row1(tra("Language name (click to select)"));
row1("<a href=language_select.php?set_lang=auto>" . tra("Use browser language setting") . "</a>", 1, "row1");
sort($languages);
$i = 0;
foreach ($languages as $language) {
    $name = language_name($language);
    row1("<a href=\"language_select.php?set_lang={$language}\">{$name}</a>", 1, "row{$i}");
    $i = 1 - $i;
}
end_table();
echo "<p>", tra("Translations are done by volunteers.  If your native language is not here, %1you can provide a translation%2.", '<a href="http://boinc.berkeley.edu/trac/wiki/TranslateIntro">', '</a>'), "</p>";
page_tail();