Example #1
0
    $output .= '<div id="user_flags">' . "\n";
    foreach ($flags as $data) {
        $output .= '<img src="' . IMAGE_URL . 'user_flags/' . $data['handle'] . '.png" alt="' . $data['title'] . '" title="' . $data['title'] . '" id="' . $data['id'] . '" />' . "\n";
    }
    $output .= '</div>' . "\n";
    $output .= '<div id="flag_info">' . "\n";
    $output .= '</div>' . "\n";
    $output .= '</div>' . "\n";
    $output .= '</div>' . "\n";
    $output .= '</div>' . "\n";
}
/* Presentation text */
$output .= '<div class="repeat">' . "\n";
$output .= '<div class="top">' . "\n";
$output .= '<div class="bottom">' . "\n";
$output .= profile_presentation_parse(profile_presentation_load(array('user_id' => $user_id)));
$output .= '</div>' . "\n";
$output .= '</div>' . "\n";
$output .= '</div>' . "\n";
if ($user_id == $_SESSION['login']['id']) {
    $output .= '<a href="/installningar/profilesettings.php" id="profile_change_presentation">Gå till inställningar för din presentation &raquo;</a>';
}
// This is Lef damping on Joel for never fixing new_visitors. So he copypasted from the old profile. Joel will have to change this later on.
if (isset($user_id) && $user_id > 0 && is_numeric($user_id) && $user_id != $_SESSION['login']['id']) {
    $fetch['login'] = array('id', 'username', 'regtimestamp', 'regip', 'lastlogon', 'lastip', 'lastaction', 'lastusernamechange', 'lastusername', 'password', 'session_id');
    $fetch['userinfo'] = array('contact1', 'contact2', 'gender', 'birthday', 'image', 'forum_signature', 'forum_posts');
    $fetch['traffa'] = array('firstname', 'profile_modules', 'color_theme');
    $userinfo = login_load_user_data($user_id, $fetch);
}
if ($_SESSION['login']['id'] != $user_id && isset($_SESSION['login']['id'])) {
    if (!isset($_SESSION['profile_visits'])) {
                }
                $html_data .= '</select>';
                $html_data .= '<input type="button" id="header_insert" class="button_60" value="Infoga" />';
                break;
            case 'poll':
                $html_parameters[] = '{"type": "input_hidden", "id": "choosen_poll_id"}';
                $polls = poll_fetch(array('author' => $_SESSION['login']['id'], 'limit' => 999));
                $onclick_handlers = array();
                $html_data .= '<h2 style="margin: 0px">Välj en av dina omröstningar</h2>';
                $html_data .= 'Klicka på en omröstning för att infoga den i din presentationstext.<br style="clear: both" />';
                $html_data .= '<ul id="profile_presentation_change_markup_properties_poll">';
                foreach ($polls as $poll) {
                    $onclick_handlers[] = '{"id": "select_poll_' . $poll['id'] . '", "call": "hp.profile.presentation.change.markup_properties.property_onevent.poll_select(' . $poll['id'] . ')"}';
                    $html_data .= '<li id="select_poll_' . $poll['id'] . '">' . $poll['question'] . '</li>';
                }
                $html_data .= '</ul>';
                $html_data .= '<input type="hidden" id="choosen_poll_id" />';
                $html_data .= '<br style="clear: both;" />';
                break;
        }
        $output .= '{ "html": "' . addslashes($html_data) . '", "html_parameters": [' . implode(', ', $html_parameters) . '], "onclick_handlers": [' . implode(', ', $onclick_handlers) . '], "onchange_handlers": [' . implode(', ', $onchange_handlers) . '] }';
        break;
    case 'preview':
        if (isset($_POST['data'])) {
            echo stripslashes(profile_presentation_parse(array('presentation_text' => $_POST['data'], 'user_id' => $_SESSION['login']['id'])));
        } else {
            echo 'No post data sent.';
        }
        break;
}
echo $output;