1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-24 16:52:43 +01:00
2006-12-02 04:36:16 +00:00

92 lines
3.1 KiB
Python

global $tp;
$ret = "";
$custom_query = explode('+', $parm);
switch($custom_query[0])
{
case "login":
case "login noprofile":
@include_once(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
@include_once(e_PLUGIN."login_menu/languages/English.php");
if (USER == TRUE){
$ret .= "<span class='mediumtext'>".LOGIN_MENU_L5." ".USERNAME."&nbsp;&nbsp;&nbsp;.:. ";
if(ADMIN == TRUE){
$ret .= "<a href='".e_ADMIN."admin.php'>".LOGIN_MENU_L11."</a> .:. ";
}
$ret .= ($custom_query[0] != "login noprofile") ? "<a href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n.:. ":"";
$ret .= "<a href='" . e_BASE . "usersettings.php'>".LOGIN_MENU_L12."</a> .:. <a href='".e_BASE."index.php?logout'>".LOGIN_MENU_L8."</a> .:.</span>";
} else {
$ret .= "<form method='post' action='".e_SELF."'>\n<div class='loginc_div'>\n".LOGIN_MENU_L1."<input class='tbox loginc user' type='text' name='username' size='15' value='$username' maxlength='20' />&nbsp;&nbsp;\n".LOGIN_MENU_L2."<input class='tbox loginc pass' type='password' name='userpass' size='15' value='' maxlength='20' />&nbsp;&nbsp;\n<input type='checkbox' name='autologin' value='1' />".LOGIN_MENU_L6."&nbsp;&nbsp;\n<input class='button loginc' type='submit' name='userlogin' value='".LOGIN_MENU_L28."' />";
if($pref['user_reg'])
{
$ret .= "&nbsp;&nbsp;<a href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
}
$ret .= "</div>\n</form>";
}
return $ret;
break;
case "search":
if(!USER && $pref['search_restrict'] == 1)
{
return "";
}
$searchflat = TRUE;
include_once(e_PLUGIN."search_menu/search_menu.php");
return "";
break;
case "quote":
$qotd_file = e_BASE."quote.txt";
if(!file_exists($qotd_file))
{
$quote = "Quote file not found ($qotd_file)";
}
else
{
$quotes = file(e_BASE."quote.txt");
$quote = $tp->toHTML($quotes[rand(0, count($quotes) -1 )], TRUE);
}
return $quote;
break;
case "language":
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$reject = array('.','..','/','CVS','thumbs.db','*._$');
$lanlist = $fl->get_dirs(e_LANGUAGEDIR);
sort($lanlist);
$action = (e_QUERY && !$_GET['elan']) ? e_SELF."?".e_QUERY : e_SELF;
$lantext = "<form method='post' action='".$action."' id='langchange'>
<div><select name='sitelanguage' class='tbox' onchange=\"document.getElementById('langchange').submit()\">\n";
foreach($lanlist as $langval) {
$langname = $langval;
$langval = ($langval == $pref['sitelanguage']) ? "" : $langval;
$selected = ($langval == USERLAN) ? "selected='selected'" : "";
$lantext .= "<option value='".$langval."' $selected>".$langname."</option>\n ";
}
$lantext .= "</select>\n";
$lantext .= "<input type='hidden' name='setlanguage' value='1' />";
$lantext .= "</div></form>";
return $lantext;
break;
case "clock":
$clock_flat = TRUE;
include_once(e_PLUGIN."clock_menu/clock_menu.php");
return "";
break;
case "welcomemessage":
return $tp->parseTemplate("{WMESSAGE}");
break;
}