$rounded_corners_tabs_options['tabs'][] = array('href' => $paths_prefix . '?action=theme_select', 'label' => 'Byt tema', 'current' => TRUE); $rounded_corners_tabs_options['tabs'][] = array('href' => $paths_prefix . '?action=flags_select', 'label' => 'Välj flaggor'); $rounded_corners_tabs_options['tabs'][] = array('href' => $paths_prefix . '/traffa/profile.php', 'label' => 'Till min presentation'); $output .= rounded_corners_tabs_top($rounded_corners_tabs_options); $query = 'SHOW COLUMNS FROM userinfo'; $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); while ($data = mysql_fetch_assoc($result)) { if ($data['Field'] == 'profile_theme' && substr($data['Type'], 0, 5) == 'enum(') { $types = substr($data['Type'], 6, -2); $profile_themes = explode("','", $types); } } //$out .= '<h2>Byt profiltema</h2>' . "\n"; $profile = profile_fetch(array('user_id' => $_SESSION['login']['id'])); $profile['profile_top_id'] = 'theme_preview'; $out .= profile_mini_page($profile); $out .= '<form method="post" class="settings_theme">' . "\n"; $out .= '<input type="hidden" name="action" value="profile_theme" />'; $out .= '<ul>' . "\n"; foreach ($profile_themes as $theme) { $out .= '<li>' . "\n"; $out .= '<img src="' . IMAGE_URL . 'profile_themes/' . $theme . '/preview.png" id="preview_' . $theme . '" class="theme_preview" />' . "\n"; $checked = $theme == $_SESSION['userinfo']['profile_theme'] ? ' checked="checked"' : ''; $out .= '<input type="radio" name="theme" value="' . $theme . '"' . $checked . ' />' . "\n"; $out .= '</li>' . "\n"; } $out .= '</ul>' . "\n"; $out .= '<br style="clear: both;" /><input type="submit" value="Spara" class="button_50" />' . "\n"; $out .= '<a href="/open_source/theme_creation.php">Gör ett eget tema</a>,'; $out .= ' <a href="/profilteman/">Testa ditt egna tema</a> (avancerat)'; $out .= '</form>' . "\n" . '';
} if (userblock_checkblock($params['user_id'])) { ui_top(); echo '<p class="error">IXΘYΣ! Du har blivit blockad, var snel hest så slipper du sånt ;)<br /><em>Visste du förresten att IXΘYΣ betyder Fisk på grekiska?</em></p>'; ui_bottom(); exit; } /* Fetching Username and setting page title */ $query = 'SELECT username FROM login WHERE id = "' . $params['user_id'] . '" LIMIT 1'; $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); $data = mysql_fetch_assoc($result); $profile = profile_fetch($params); $ui_options['title'] .= $data['username'] . ' - Hamsterpaj.net'; $ui_options['stylesheets'][] = 'profile_themes/' . $profile['profile_theme'] . '.css'; ui_top($ui_options); echo profile_mini_page($profile); $query = 'SELECT l.regtimestamp, l.username, u.forum_userlabel, u.forum_posts, u.forum_spam, u.birthday AS user_birthday, t.guestbook_entries'; $query .= ' FROM login AS l, userinfo AS u, traffa AS t'; $query .= ' WHERE l.id = "' . $params['user_id'] . '" AND u.userid = l.id AND t.userid = l.id LIMIT 1'; $result = mysql_query($query) or report_sql_error($query); $data = mysql_fetch_assoc($result); /* Lef fiffling */ $one_week_ago = time() - 604800; $query = 'SELECT user_id FROM user_warnings WHERE user_id = "' . $params['user_id'] . '" AND timestamp > "' . $one_week_ago . '"'; $result = mysql_query($query) or report_sql_error($query); $warned = mysql_num_rows($result); /* End of Lef */ /* Set users specialstatus */ if ($warned > 0) { $specialstatus = 'Varnad'; } elseif (strlen($data['forum_userlabel']) > 0) {
$user_id = $_SESSION['login']['id']; } else { $output .= '<h1>Endast medlemmar</h1>'; } if (userblock_checkblock($user_id)) { ui_top(); echo '<p class="error">IXΘYΣ! Du har blivit blockad, var snel hest så slipper du sånt ;)<br /><em>Visste du förresten att IXΘYΣ betyder Fisk på grekiska?</em></p>'; ui_bottom(); exit; } if (isset($user_id)) { $profile = profile_fetch(array('user_id' => $user_id)); if (strlen($profile['profile_theme']) > 0) { $ui_options['stylesheets'][] = 'profile_themes/' . $profile['profile_theme'] . '.css'; } $profile_head .= profile_mini_page($profile); } if ($_SESSION['login']['id'] == $user_id && login_checklogin()) { $display_successful_message = false; for ($i = 0; $i < PHOTOS_MAX_UPLOADS; $i++) { if (is_uploaded_file($_FILES['photo_' . $i]['tmp_name'])) { $options['file'] = $_FILES['photo_' . $i]['tmp_name']; $options['user'] = $_SESSION['login']['id']; $options['description'] = $_POST['description_' . $i]; $options['category'] = $_POST['category_' . $i]; $photo_id = photos_upload($options); $query = 'SELECT id FROM user_action_log WHERE user = "******" AND timestamp > "' . strtotime(date('Y-m-d')) . '" AND action= "photos" LIMIT 1'; $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__); if (mysql_num_rows($result) == 1) { $data = mysql_fetch_assoc($result); $query = 'UPDATE user_action_log SET url = "/traffa/photos.php?id=' . $photo_id . '", label = "' . $options['description'] . '", timestamp = "' . time() . '" WHERE id = "' . $data['id'] . '" LIMIT 1';