<span style="float:left; height:25px;">' . _NICKNAME . '</span><span style="float:right; height:25px;"><input type="text" name="ulogin" size="10" maxlength="25" /></span><br /> <span style="float:left; height:25px;">' . _PASSWORD . '</span><span style="float:right; height:25px;"><input type="password" name="user_password" size="10" maxlength="20" /></span><br /> '; if ($MAIN_CFG['debug']['sec_code'] & 2) { $content .= '<span style="float:left; height:25px;">' . _SECURITYCODE . '</span><span style="float:right; height:25px;">' . generate_secimg() . '</span><br style="clear:left;" /> <span style="float:left; height:25px;">' . _TYPESECCODE . '</span><span style="float:right; height:25px;"><input type="text" name="gfx_check" size="8" maxlength="8" /></span><br />'; } // don't show register link unless allowuserreg is yes $content .= '<span style="float:left; height:25px;">' . ($MAIN_CFG['member']['allowuserreg'] ? '<input type="button" value="' . _BREG . '" onclick="window.location=\'' . URL::index('Your_Account&file=register', 1, 1) . '\'" />' : '') . '</span> <span style="float:right; height:25px;"><input type="submit" value="' . _LOGIN . '" /> </span></div></form>'; } if (is_admin()) { $content .= '<br style="clear:left;"/><a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '"><img src="images/blocks/login.gif" alt="" /></a> <a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '">' . _ADMIN . ' ' . _LOGOUT . "</a><br />\n"; } $day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']); list($last[0]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate>='" . $day . "'", SQL_NUM); list($last[1]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate<'" . $day . "' AND user_regdate>='" . ($day - 86400) . "'", SQL_NUM); list($lastuser) = $db->sql_ufetchrow("SELECT username FROM " . $user_prefix . "_users \n\tWHERE user_active = 1 AND user_level > 0 \n\tORDER BY user_id DESC", SQL_NUM); list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \nWHERE user_id > 1 AND user_level > 0", SQL_NUM); $content .= '<hr /><span style="font-weight:bold; text-decoration:underline;">' . _BMEMP . ":</span><br />\n"; $content .= '<img src="images/blocks/ur-moderator.gif" alt="" /> ' . _BLATEST . ': <a href="' . URL::index("Your_Account&profile={$lastuser}") . '"><b>' . $lastuser . '</b></a><br /> <img src="images/blocks/ur-author.gif" alt="" /> ' . _BTD . ': <b>' . $last[0] . '</b><br /> <img src="images/blocks/ur-admin.gif" alt="" /> ' . _BYD . ': <b>' . $last[1] . '</b><br /> <img src="images/blocks/ur-guest.gif" alt="" /> ' . _BOVER . ': <b>' . $numusers . '</b><br /> <hr /> <img src="images/blocks/group-1.gif" alt="" /> <span style="font-weight:bold; text-decoration:underline;">' . _BVISIT . ':</span><br /> <img src="images/blocks/ur-member.gif" alt="" /> ' . _BMEM . ': <b>' . $online_num[0] . '</b><br /> <img src="images/blocks/ur-anony.gif" alt="" /> ' . _BVIS . ': <b>' . $online_num[1] . '</b><br /> <img src="images/blocks/ur-registered.gif" alt="" /> ' . _BTT . ': <b>' . $online_num[2] . '</b> <hr />
function init_userprefs($userdata) { global $board_config, $theme, $images; global $template, $lang, $phpbb_root_path; global $nav_links, $currentlang; $board_config['default_lang'] = $currentlang; if (is_user()) { if (!empty($userdata['user_dateformat'])) { $board_config['default_dateformat'] = $userdata['user_dateformat']; } if (isset($userdata['user_timezone'])) { $board_config['board_timezone'] = $userdata['user_timezone']; if ($userdata['user_dst']) { $localtime = L10NTime::tolocal(time(), 0, $board_config['board_timezone']); if (L10NTime::in_dst($localtime, $userdata['user_dst'])) { $board_config['board_timezone'] += 1; } } } } if (file_exists('language/' . $board_config['default_lang'] . '/forums.php')) { include 'language/' . $board_config['default_lang'] . '/forums.php'; } elseif (file_exists('language/' . $board_config['default_lang'] . '/Forums/lang_main.php')) { include 'language/' . $board_config['default_lang'] . '/Forums/lang_main.php'; } else { include 'language/english/forums.php'; } /* moved to main lang if (defined('IN_ADMIN')) { if( !file_exists('language/'.$board_config['default_lang'].'/Forums/lang_admin.php') ) { $board_config['default_lang'] = 'english'; } include('language/'.$board_config['default_lang'].'/Forums/lang_admin.php'); }*/ // // Mozilla navigation bar // Default items that should be valid on all pages. // Defined here to correctly assign the Language Variables // and be able to change the variables within code. // $nav_links['top'] = array('url' => URL::index(), 'title' => sprintf($lang['Forum_Index'], $board_config['sitename'])); $nav_links['search'] = array('url' => URL::index('&file=search'), 'title' => $lang['Search']); $nav_links['help'] = array('url' => URL::index('&file=faq'), 'title' => $lang['FAQ']); // // Set up style // if (!$board_config['override_user_style'] && is_user() && $userdata['user_style'] > 0) { if ($theme = setup_style($userdata['user_style'])) { return; } } $theme = setup_style($board_config['default_style']); return; }
public static function date($format, $time, $region = 0, $gmt = 0) { global $LNG; # check if we already have a unix timestamp else convert if (!is_numeric($time)) { # 'YEAR-MONTH-DAY HOUR:MIN:SEC' aka MySQL DATETIME if (preg_match('#([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $time, $datetime)) { $time = mktime($datetime[4], $datetime[5], $datetime[6], $datetime[2], $datetime[3], $datetime[1]); } } # Convert the GMT time to local time $time = L10NTime::tolocal($time, $region, $gmt); # date() is affected by DST so we avoid that if (date('I') == 1 && date('I', $time) == 0) { $time += 3600; } # return correct formatted time $format = preg_replace('#([Dl])#', '_\\\\\\1w', $format); $format = preg_replace('#([FM])#', '_\\\\\\1n', $format); $time = date($format, $time); return preg_replace('#_([DlFM])([0-9]{1,2})#e', '$LNG[\'_time\'][\'\\1\'][intval(\\2)]', $time); }
unlink($tmpfile); cpg_die(_ERROR, GD_FILE_TYPE_ERR, __FILE__, __LINE__, true); } // Check image type is among those allowed for ImageMagick if ($CONFIG['thumb_method'] == 'im' && !stristr($CONFIG['allowed_img_types'], $IMG_TYPES[$imginfo[2]])) { unlink($tmpfile); cpg_die(_ERROR, sprintf(ALLOWED_IMG_TYPES, $CONFIG['allowed_img_types']), __FILE__, __LINE__); } // Check that picture size (in pixels) is lower than the maximum allowed $max = max($imginfo[0], $imginfo[1]); if ($max > $CONFIG['max_upl_width_height']) { $max = $CONFIG['max_upl_width_height']; } // Setup a textual watermark ? if ($CONFIG['watermark']) { $tolocal = L10NTime::tolocal(time(), $userinfo['user_dst'], $userinfo['user_timezone']); $watermark = '(c)' . date('Y', $tolocal) . ' ' . CPG_USERNAME . ' & ' . (!empty($MAIN_CFG['server']['domain']) ? $MAIN_CFG['server']['domain'] : $MAIN_CFG['global']['sitename']); } else { $watermark = false; } // Create the "big" image if (!resize_image($tmpfile, $imginfo, $uploaded_pic, $max, $CONFIG['thumb_method'], '', $watermark)) { unlink($tmpfile); cpg_die(_ERROR, $ERROR, __FILE__, __LINE__); } // Create thumbnail and intermediate image and add the image into the DB if (!add_picture($album, $dest_dir, basename($uploaded_pic), $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $watermark, $tmpfile)) { unlink($uploaded_pic); unlink($tmpfile); cpg_die(_CRITICAL_ERROR, sprintf(ERR_INSERT_PIC, $uploaded_pic) . '<br /><br />' . $ERROR, __FILE__, __LINE__, true); }
function monthlist() { global $db, $prefix, $userinfo; list($time) = $db->sql_ufetchrow('SELECT time FROM ' . $prefix . '_stories ORDER BY time ASC', SQL_NUM); if ($time < 1) { return ''; } $time = L10NTime::tolocal($time, $userinfo['user_dst'], $userinfo['user_timezone']); $firstyear = L10NTime::date('Y', $time); $firstmonth = intval(L10NTime::date('m', $time)); $time = L10NTime::tolocal(time(), $userinfo['user_dst'], $userinfo['user_timezone']); $year = L10NTime::date('Y', $time); $month = intval(L10NTime::date('m', $time)); $months = array(_JANUARY, _FEBRUARY, _MARCH, _APRIL, _MAY, _JUNE, _JULY, _AUGUST, _SEPTEMBER, _OCTOBER, _NOVEMBER, _DECEMBER); $return = '<ul>'; while ($year >= $firstyear) { if ($year <= $firstyear && $month < $firstmonth) { break; } $return .= '<li><a href="' . URL::index("&sa=show_month&year={$year}&month={$month}") . '">' . $months[$month - 1] . " {$year}</a></li>"; $month--; if ($month < 1) { $month = 12; $year--; } } return $return . '</ul>'; }