• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP event_log_log函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中event_log_log函数的典型用法代码示例。如果您正苦于以下问题:PHP event_log_log函数的具体用法?PHP event_log_log怎么用?PHP event_log_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了event_log_log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: array

<?php

require '../include/core/common.php';
require PATHS_LIBRARIES . 'movie_compability.lib.php';
$ui_options['menu_path'] = array('mattan', 'ladda_ner_program');
$ui_options['stylesheets'][] = 'downloads.css';
event_log_log('downloads_section_load');
$query = 'SELECT * FROM downloads ORDER BY category ASC, title ASC';
$result = mysql_query($query);
$program_count = mysql_num_rows($result);
while ($data = mysql_fetch_assoc($result)) {
    $download_categories[url_secure_string($data['category'])] = $data['category'];
    $download_items[] = $data;
}
foreach ($download_categories as $handle => $category) {
    $ui_options['menu_addition']['mattan']['children']['ladda_ner_program']['children'][$handle] = array('label' => $category, 'url' => '#' . $handle);
}
ui_top($ui_options);
echo '<div id="downloads">' . "\n";
echo '<h1>Hamsterpaj tipsar om bra program att ladda hem</h1>' . "\n";
echo '<p>Vi har valt ut våra favoritprogram från nätet, samlat länkar och beskrivningar här. Just nu finns det <strong>' . $program_count . '&nbsp;program</strong> att ladda ner <strong>gratis</strong>.<br />Har du ett tips på ett program som skulle passa här? Skicka namn och länk till <a href="/traffa/profile.php?id=85514">ehrw</a> som ett privat meddelande!</p>' . "\n";
foreach ($download_items as $data) {
    if ($current_category != $data['category']) {
        foreach ($download_categories as $handle => $category) {
            if ($category == $data['category']) {
                echo '<a name="' . $handle . '"></a>';
            }
        }
        echo '<h2>' . $data['category'] . '</h2>' . "\n";
        $current_category = $data['category'];
    }
开发者ID:Rojk,项目名称:hamsterpaj,代码行数:31,代码来源:ladda_ner_program.php


示例2: mysql_query

<?php

require 'include/core/common.php';
if (is_numeric($_GET['id'])) {
    $query = 'UPDATE recent_updates SET clicks = clicks + 1 WHERE id = "' . $_GET['id'] . '" LIMIT 1';
    mysql_query($query);
    if ($_GET['source'] == 'global_notice') {
        $_SESSION['recent_update_notifier'][$_GET['id']] = 10;
        event_log_log('recent_update_global_notice_click');
    } else {
        event_log_log('recent_update_fp_click');
    }
    if ($_GET['url'] != '#survey') {
        header('location: ' . html_entity_decode($_GET['url']));
    }
}
开发者ID:Razze,项目名称:hamsterpaj,代码行数:16,代码来源:recent_updates_redirect.php


示例3: age_guess_result

function age_guess_result()
{
    global $AGE_GUESS_COMMENTS;
    $return .= '<img src="http://images.hamsterpaj.net/images/users/thumb/' . $_SESSION['age_guess']['current_user'] . '" />' . "\n";
    $age_diff = $_GET['guessed_age'] == 'skip' ? 1 : $_GET['guessed_age'] - $_SESSION['age_guess']['current_age'];
    switch (abs($age_diff)) {
        case 0:
            $score = 5;
            $score_class = 'positive';
            break;
        case 1:
            $score = 0;
            $score_class = 'unchanged';
            break;
        default:
            $score = abs($age_diff) * -1 + 1;
            $score = $score < -5 ? -5 : $score;
            $score_class = 'negative';
    }
    $return .= '<h2 class="age_guess_score_' . $score_class . '">' . $score . 'p</h2>' . "\n";
    foreach ($AGE_GUESS_COMMENTS as $comment => $differences) {
        foreach ($differences as $difference) {
            $comments_by_diff[$difference][] = $comment;
        }
    }
    $comment = $_GET['guessed_age'] == 'skip' ? 'Hoppade över' : $comments_by_diff[$age_diff][rand(0, count($comments_by_diff[$age_diff]) - 1)];
    $return .= '<h2>' . $comment . '</h2>' . "\n";
    $return .= '<p class="age_guess_answer_text"><a href="/traffa/profile.php?id=' . $_SESSION['age_guess']['current_user'] . '">' . $_SESSION['age_guess']['current_username'] . '</a>' . "\n";
    $return .= ' är ' . $_SESSION['age_guess']['current_age'] . ' år</p>';
    $return .= '<button onclick="window.open(\'/traffa/profile.php?id=' . $_SESSION['age_guess']['current_user'] . '\');">Besök i nytt fönster</button>' . "\n";
    if (is_numeric($_GET['guessed_age'])) {
        event_log_log('age_guess_guess');
        /* Log answer to database */
        $insertquery = 'INSERT INTO age_guess_logs (user, age_' . $_GET['guessed_age'] . ') VALUES("' . $_SESSION['age_guess']['current_user'] . '", 1)';
        $updatequery = 'UPDATE age_guess_logs SET age_' . $_GET['guessed_age'] . ' = age_' . $_GET['guessed_age'] . ' + 1 WHERE user = "' . $_SESSION['age_guess']['current_user'] . '" LIMIT 1';
        mysql_query($insertquery) or mysql_query($updatequery);
        if (login_checklogin()) {
            $correct = $age_diff == 0 ? 1 : 0;
            $insertquery = 'INSERT INTO age_guess_scoring (user, week, score, viewed_images, correct_guesses, correct_ratio)';
            $insertquery .= ' VALUES("' . $_SESSION['login']['id'] . '", "' . date('YW') . '", "' . $score . '", 1, ' . $correct . ', correct_guesses/viewed_images)';
            $updatequery = 'UPDATE age_guess_scoring SET score = score + ' . $score . ', viewed_images = viewed_images + 1, correct_guesses = correct_guesses + ' . $correct . ', correct_ratio = correct_guesses/viewed_images';
            $updatequery .= ' WHERE user = "' . $_SESSION['login']['id'] . '" AND week = "' . date('YW') . '" LIMIT 1';
            mysql_query($insertquery) or mysql_query($updatequery);
            $_SESSION['age_guess']['score'] += $score;
            $_SESSION['age_guess']['correct_guesses'] += $correct;
            if ($_SESSION['age_guess']['score'] < -10) {
                $_SESSION['age_guess']['score'] = -10;
                $query = 'UPDATE age_guess_scoring SET score = -10 WHERE user = "' . $_SESSION['login']['id'] . '" AND week = "' . date('YW') . '" LIMIT 1';
                mysql_query($query);
            }
            /* Find out if the remote user is online, if so, open the session and send a quicknote about the vote */
            if ($score != 5) {
                $query = 'SELECT session_id, lastaction FROM login WHERE id = "' . $_SESSION['age_guess']['current_user'] . '" LIMIT 1';
                $result = mysql_query($query);
                if ($data = mysql_fetch_assoc($result)) {
                    if ($data['lastaction'] > time() - 600) {
                        $remote_session = session_load($data['session_id']);
                        $remote_session['notice_message'] = 'Du, <a href="/traffa/profile.php?id=' . $_SESSION['login']['id'] . '">' . $_SESSION['login']['username'] . '</a> gissade nyss att du är ' . $_GET['guessed_age'] . ' år gammal i <a href="/traffa/age_guess.php">Gissa Åldern</a>!';
                        session_save($data['session_id'], $remote_session);
                    }
                }
            }
        }
    }
    return $return;
}
开发者ID:Razze,项目名称:hamsterpaj,代码行数:66,代码来源:age_guess.lib.php


示例4: event_log_log

    } else {
        event_log_log('classic_reg_form_sign_up');
        /* Input from user is OK, create rows in required tables */
        $query = 'INSERT INTO login(username, password, regtimestamp, regip, lastlogon) ';
        $query .= 'VALUES ("' . $_POST['username'] . '", "' . md5(utf8_decode($_POST['password'])) . '", "';
        $query .= time() . '", "' . $_SERVER['REMOTE_ADDR'] . '", "")';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        $user_id = mysql_insert_id();
        $query = 'INSERT INTO userinfo (userid) VALUES ("' . $user_id . '")';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        $query = 'INSERT INTO traffa (userid) VALUES ("' . $user_id . '")';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        $query = 'INSERT INTO preferences (userid) VALUES ("' . $user_id . '")';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
        /* Rows created, log on the user */
        login_dologin($_POST['username'], $_POST['password']);
        /* Redirect to welcome page asking the user for more information */
        jscript_alert('Du kan numera känna dig som en riktig Hamsterpajare!\\nVi loggar in dig på ditt konto nu.');
        jscript_location('/registered.php');
    }
} else {
    regform_header_p13();
    regform_header_welcome();
    register_form();
    event_log_log('classic_reg_form_load');
}
ui_bottom();
?>


开发者ID:Razze,项目名称:hamsterpaj,代码行数:28,代码来源:register.php


示例5: mysql_fetch_assoc

        $data = mysql_fetch_assoc($result);
        $_SESSION['burger']['current_burger'] = $data['id'];
        $_SESSION['burger']['seen_burgers'][] = $data['id'];
        echo '<h2>Vilken hamburgare är detta?</h2>' . "\n";
        echo '<img src="' . IMAGE_URL . 'hamburgers/' . $data['id'] . '_real.jpg" id="burger_guess_image" />' . "\n";
        echo '<div id="hamburger_guessing_pane">' . "\n";
        $query = 'SELECT * FROM burgers ORDER BY vendor ASC, name ASC';
        $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
        while ($burger = mysql_fetch_assoc($result)) {
            if ($burger['vendor'] != $vendor) {
                echo '<h3>' . $burger['vendor'] . '</h3>' . "\n";
                $vendor = $burger['vendor'];
            }
            echo '<a href="?guessed_burger=' . $burger['id'] . '">' . $burger['name'] . '</a>' . "\n";
        }
        echo '</div>' . "\n";
    } else {
        echo '<h1>Nu har du gissat på alla hamburgare</h1>' . "\n";
        echo '<p>Vi hoppas du tyckte det var kul och att du tänker lite mer kritiskt nästa gång det blir dags för en snabb cheeseburgare på donkan. Titta gärna på <a href="alla_burgare.php">översikten med alla hamburgare</a> eller läs mer <a href="om_testet.php">om hur vi gjorde testet</a>.' . "\n";
        $survey = survey_fetch(array('id' => 165));
        echo survey_draw_frame($survey);
    }
}
echo '<h2 style="clear: both; margin-top: 50px;">Tror du att vi har fuskat med bilderna?</h2>' . "\n";
echo '<p>Det har vi inte, det här testet är helt ärligt gjort. Du kan läsa mer <a href="om_testet.php">om testet</a>, gör gärna det när du har gissat på alla burgare!</p>' . "\n";
event_log_log('burgers_test_pageview');
ui_bottom();
?>


开发者ID:Rojk,项目名称:hamsterpaj,代码行数:28,代码来源:test.php


示例6: films_film_play_draw

function films_film_play_draw($film, $options)
{
    event_log_log('new_' . $film['film_type'] . '_watch');
    film_view_count($film['id']);
    echo '<div class="film_play" id="film_play">' . "\n";
    rounded_corners_top();
    $related_films = films_fetch(array('released' => true, 'film_type' => $film['film_type'], 'exclude' => array($film['id']), 'limit' => 3, 'order' => 'random'));
    films_list($related_films, array('list_type' => 'film_list_compact', 'headline' => 'Fler ' . $film['film_type']));
    echo '<h1 class="film_header">' . $film['title'] . '</h1>' . "\n";
    echo '<div class="film_statistics">' . "\n";
    echo '<div class="film_view_count">' . "\n";
    echo cute_number($film['view_count'] + 1) . ' visningar' . "\n";
    echo '</div>' . "\n";
    // film_view_count
    echo rank_draw($film['rank_average'], array('size' => 'medium'));
    //	echo '<div class="film_rank_count">' . "\n";
    //	echo cute_number($film['rank_count']) . ' röster' . "\n";
    //	echo '</div>' . "\n";
    if (5 == $_SESSION['login']['userlevel']) {
        echo '<a class="film_edit" href="/film/admin/' . $film['handle'] . '.html">[Redigera]</a>' . "\n";
    }
    echo '</div>' . "\n";
    // film_statistics
    echo '<div class="film_player">' . "\n";
    if ($film['trailer_id'] > 0) {
        echo '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
        echo '<div id="playnw" class="playnw">' . "\n";
        echo '<script src="http://se.player.playnetworks.net/player.php?mid=' . $film['trailer_id'] . '&channel_user_id=4601100020-1&width=460&height=345"></script><br>' . "\n";
        echo '</div>' . "\n";
        echo '<!-- Play Networks - Embeddable Flash Player -->' . "\n";
    } elseif ($film['use_special_code'] == 1) {
        echo stripslashes($film['html']);
    } elseif ($film['extension'] == 'swf') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<object type="application/x-shockwave-flash" data="http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.swf" >
					<param name="movie" value="http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.swf" /></object>';
    } elseif ($film['extension'] == 'flv') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Installera Flash Player</a> för att kunna se den här filmen.</p>
				<script type="text/javascript">
				var s1 = new SWFObject("/film/flvplayer.swf","single","460","345","7");
				s1.addParam("allowfullscreen","true");
				s1.addVariable("file","http://amuse.hamsterpaj.net/distribute/film/' . $film['handle'] . '.flv");
				s1.addVariable("image","' . IMAGE_URL . '/film/' . $film['handle'] . '.png");
				s1.addVariable("width","460");
				s1.addVariable("height","345");
				s1.write("player1");
				</script>';
    } elseif ($film['film_type'] == 'bilder') {
        //todo! Här skall anpassas till distribute-systemet. distribute_server_get skall anropas för att f? en adress
        // adress skall byggas med server . type . handle . '.' . extension
        echo '<img src="http://images.hamsterpaj.net/fun_images/' . $film['handle'] . '.jpg" class="fun_images_big" />' . "\n";
    }
    echo '</div>' . "\n";
    // film_player
    echo '<br style="clear: both;" />' . "\n";
    echo '<div class="film_description">' . "\n";
    if (strlen($film['description']) > 0) {
        echo '<p>' . $film['description'] . '</p>' . "\n";
    }
    if ($film['trailer_id'] > 0) {
        echo '<p>Filmtrailers visas i samarbete med Play Networks</p>' . "\n";
    }
    echo '</div>' . "\n";
    // end film_description
    echo '<div class="film_comments">' . "\n";
    echo '<input type="hidden" id="film_id" value="' . $film['id'] . '" />' . "\n";
    echo '<h2 class="rank_input_header">Din poäng</h2>' . "\n";
    echo '<h2 class="comment_input_header">Din kommentar</h2>' . "\n";
    echo '<br style="clear: both;" />' . "\n";
    $query = 'SELECT rank FROM user_ranks WHERE user_id = "' . $_SESSION['login']['id'] . '" AND item_id = "' . $film['id'] . '" AND item_type = "film"';
    $result = mysql_query($query);
    if (mysql_num_rows($result) == 1) {
        $data = mysql_fetch_assoc($result);
    }
    unset($rank_options);
    $rank_options['previous'] = $data['rank'];
    rank_input_draw($film['id'], 'film', $rank_options);
    comments_input_draw($film['id'], 'film');
    echo '<br style="clear: both;" />' . "\n";
    echo '</div>' . "\n";
    // film_comments
    rounded_corners_bottom();
    $options['comments'] = isset($options['comments']) ? $options['comments'] : 'yes';
    if ($options['comments'] == 'yes') {
        rounded_corners_top();
        echo comments_list($film['id'], 'film');
        rounded_corners_bottom();
    }
    echo '</div>' . "\n";
    // film_play
}
开发者ID:Razze,项目名称:hamsterpaj,代码行数:94,代码来源:films.lib.php


示例7: switch

<?php

require '../include/core/common.php';
if (login_checklogin()) {
    switch ($_GET['report_type']) {
        case 'post':
            if ($_GET['action'] == 'unreport' && is_privilegied('abuse_report_handler')) {
                $query = 'DELETE FROM abuse_reports WHERE reference_id = "' . $_GET['reference_id'] . '" AND object_type = "post" LIMIT 1';
            }
            if ($_GET['action'] == 'report') {
                event_log_log('forum_post_reported');
                $query = 'INSERT INTO abuse_reports (reference_id, object_type, author, text) VALUES("' . $_GET['reference_id'] . '", "post", "' . $_SESSION['login']['id'] . '", "' . $_GET['comment'] . '")';
            }
            mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
            break;
        case 'user':
            if ($_GET['action'] == 'unreport' && is_privilegied('abuse_report_handler')) {
                $query = 'DELETE FROM abuse_reports WHERE reference_id = "' . $_GET['reference_id'] . '" AND object_type = "user" LIMIT 1';
            }
            if ($_GET['action'] == 'report') {
                event_log_log('user_reported');
                $query = 'INSERT INTO abuse_reports (reference_id, object_type, author, text) VALUES("' . $_GET['reference_id'] . '", "user", "' . $_SESSION['login']['id'] . '", "' . $_GET['comment'] . '")';
            }
            mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
            break;
    }
}
开发者ID:Razze,项目名称:hamsterpaj,代码行数:27,代码来源:abuse_report.php


示例8: login_dologin

function login_dologin($options)
{
    if (!isset($options['method'])) {
        throw new Exception('No login method specified.');
    }
    if (isset($options['username']) && strtolower($options['username']) == 'borttagen') {
        header('Location: http://disneyworld.disney.go.com/wdw/index?bhcp=1');
        throw new Exception('Username CANNOT be "borttagen"!');
    }
    $query = 'SELECT id FROM login WHERE is_removed = 0';
    switch ($options['method']) {
        case 'ghost':
            if (isset($options['username'])) {
                $query .= ' AND username = "' . $options['username'] . '"';
            } else {
                throw new Exception('No username was set!');
            }
            break;
        case 'username_and_password':
            if (isset($options['username']) && isset($options['password'])) {
                $options['password'] = utf8_decode($options['password']);
                $query .= ' AND password_version = 4 AND username = "' . $options['username'] . '" AND password = "' . hamsterpaj_password($options['password']) . '"';
            } else {
                throw new Exception('No username or password was set!');
            }
            break;
        default:
            throw new Exception('Invalid login method.');
    }
    $query .= ' LIMIT 1';
    $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    if (mysql_num_rows($result) > 0) {
        $data = mysql_fetch_assoc($result);
        $user_id = $data['id'];
        // * Fetch neccessary data from login, userinfo, preferences and traffa-tables and unserialize...
        $_SESSION = array_merge($_SESSION, login_load_user_data($user_id, array('login' => array('id', 'lastlogon', 'username', 'password', 'userlevel', 'regtimestamp', 'lastusernamechange', 'session_id', 'lastaction', 'lastip', 'regip', 'quality_level', 'quality_level_expire'), 'userinfo' => array('contact1', 'contact2', 'gender', 'birthday', 'image', 'image_ban_expire', 'forum_signature', 'zip_code', 'forum_quality_rank', 'parlino_activated', 'cell_phone', 'firstname', 'surname', 'email', 'streetaddress', 'msn', 'visible_level', 'phone_ov', 'user_status', 'gbrss'), 'preferences' => array('bubblemessage_visitors', 'allow_hotmessages', 'activate_current_action', 'enable_hetluft', 'randomizer', 'left_login_module', 'enable_shoutbox', 'module_states', 'module_order', 'forum_enable_smilies', 'forum_subscribe_on_create', 'forum_subscribe_on_post', 'gb_anti_p12'), 'traffa' => array('firstname', 'profile_modules')), __FILE__, __LINE__));
        $_SESSION['module_states'] = unserialize($_SESSION['preferences']['module_states']);
        $_SESSION['module_order'] = unserialize($_SESSION['preferences']['module_order']);
        //$_SESSION['preferences']['forum_favourite_categories'] = unserialize($_SESSION['preferences']['forum_favourite_categories']);
        // * Update fields in logon related to the login...
        if ($options['method'] != 'ghost') {
            $login_time = time();
            $query = 'UPDATE login SET lastlogon = ' . $login_time . ', lastip = "' . $_SERVER['REMOTE_ADDR'] . '", session_id = "' . session_id() . '" WHERE id = "' . $user_id . '" LIMIT 1';
            mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
            $_SESSION['login']['lastlogon'] = $login_time;
            $_SESSION['login']['lastip'] = $_SERVER['REMOTE_ADDR'];
            $_SESSION['login']['session_id'] = session_id();
            event_log_log('user_log_on');
            if ($_SESSION['login']['lastlogon'] < strtotime(date('Y-m-d'))) {
                event_log_log('user_unique_log_on');
            }
        }
        // * Set some special/initial parametrers...
        $_SESSION['cache']['lastupdate'] = 0;
        switch ($options['method']) {
            case 'ghost':
                $_SESSION['ghost'] = true;
                break;
            case 'username_and_password':
                $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
                $_SESSION['login']['lastlogon'] = time();
                break;
        }
        // * Fetch guestbook notices...
        $guestbook_query = 'SELECT COUNT(id) AS unread FROM traffa_guestbooks WHERE recipient = ' . $user_id . ' AND `read` =  0 AND deleted = 0';
        $guestbook_result = mysql_query($guestbook_query) or report_sql_error($guestbook_query, __FILE__, __LINE__);
        $guestbook_data = mysql_fetch_assoc($guestbook_result);
        $_SESSION['notices']['unread_gb_entries'] = $guestbook_data['unread'];
        // * Fetch group notices...
        $_SESSION = array_merge($_SESSION, login_load_group_data($user_id, array('groups_members' => array('groupid'))));
        // * Fetch friends notices...
        $_SESSION['friends'] = friends_fetch_online_smart(array('user_id' => $user_id));
        // * Fetch visitors from "my visitors"
        $query = 'SELECT DISTINCT(uel.remote_user_id) AS id, uel.timestamp, l.username';
        $query .= ' FROM user_event_log AS uel, login AS l, userinfo AS u';
        $query .= ' WHERE uel.action = "profile_visit" AND uel.user = "' . $user_id . '" AND l.id = uel.remote_user_id AND (u.image = 1 OR u.image = 2) AND u.userid = uel.remote_user_id';
        $query .= ' GROUP BY uel.remote_user_id ORDER BY timestamp DESC LIMIT 8';
        $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
        $_SESSION['visitors_with_image'] = array();
        while ($data = mysql_fetch_assoc($result)) {
            $_SESSION['visitors_with_image'][] = $data;
        }
        // * Fetch privilegies...
        $query = 'SELECT privilegie, value FROM privilegies WHERE user = "' . $_SESSION['login']['id'] . '"';
        $result = mysql_query($query);
        while ($data = mysql_fetch_assoc($result)) {
            $_SESSION['privilegies'][$data['privilegie']][is_numeric($data['value']) ? intval($data['value']) : $data['value']] = true;
        }
        // * Log the logon to the database...
        $query = 'INSERT INTO login_log (user_id, logon_time, impressions, ip, ghost)';
        $query .= ' VALUES(' . $user_id . ', ' . time() . ', 0, ' . ip2long($_SERVER['REMOTE_ADDR']) . ', "' . ($options['method'] == 'ghost' ? 'YES' : 'NO') . '")';
        mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
        // * Cache some info about the users visits to categories. This is used to calculate new threads and category-subscriptions
        $query = 'SELECT * FROM forum_category_visits WHERE user_id = "' . $user_id . '"';
        $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
        while ($data = mysql_fetch_assoc($result)) {
            $_SESSION['forum']['categories'][$data['category_id']] = $data;
        }
    } else {
        if ($options['method'] == 'username_and_password') {
//.........这里部分代码省略.........
开发者ID:Rambutan,项目名称:hamsterpaj,代码行数:101,代码来源:login.lib.php


示例9: foreach

$form .= '<br /><label>Välj en stil</label><br />' . "\n";
$form .= '<ol id="collage_illusion_thumbs">' . "\n";
foreach ($templates as $bg) {
    $form .= '<li>' . "\n";
    $checked = $bg == 'wood' ? ' checked="checked"' : '';
    $form .= '<img src="http://images.hamsterpaj.net/collage_illusion/thumbs/' . $bg . '.jpg" />';
    $form .= '<input type="radio" name="template" value="' . $bg . '"' . $checked . ' />';
    $form .= '</li>' . "\n";
}
$form .= '</ol>' . "\n";
$form .= '<br style="clear: both;" />' . "\n";
$form .= '<input type="submit" value="OK" />' . "\n";
$form .= '</form>' . "\n";
event_log_log('collage_illusion_impression');
if (isset($_FILES['photo'])) {
    event_log_log('collage_illusion_upload');
    $template = in_array($_POST['template'], $templates) ? $_POST['template'] : 'wood_standing';
    $work_dir = '/mnt/images/collage_illusion/';
    $filename = time() . rand(1000, 9999) . '.jpg';
    $bg = '/mnt/images/collage_illusion/templates/' . $template . '.png';
    $photo = $_FILES['photo']['tmp_name'];
    $outfile = '/mnt/images/collage_illusion/outfiles/' . $filename;
    $size = '"640x640>"';
    $tmp_photo = $work_dir . 'tmp/' . rand(0, 99999999) . '.jpg';
    $photo_resize = 'convert -resize ' . $size . ' ' . $photo . ' ' . $tmp_photo;
    system($photo_resize);
    $size = getimagesize($tmp_photo);
    $size = $size[0] . 'x' . $size[1] . '!';
    $tmp_bg = $work_dir . 'tmp/' . rand(0, 99999999) . '.png';
    $bg_resize = 'convert -resize ' . $size . ' ' . $bg . ' ' . $tmp_bg;
    system($bg_resize);
开发者ID:Rambutan,项目名称:hamsterpaj,代码行数:31,代码来源:collage_illusion.php


示例10: login

    echo '<span style="color: red; font-weight: bold;">Användarnamnet får inte vara längre än 16 tecken!</span><br />';
}
if (strlen($info['username']) < 2) {
    $error = true;
    echo '<span style="color: red; font-weight: bold;">Användarnamnet får inte vara kortare än två tecken!</span><br />';
}
if (register_username_exists($info['username'])) {
    $error = true;
    echo '<span style="color: red; font-weight: bold;">Användarnamnet är redan upptaget!</span><br />';
}
if (strlen($info['password']) < 4) {
    $error = true;
    echo '<span style="color: red; font-weight: bold;">Ditt lösenord måste vara minst fyra tecken långt!</span><br />';
}
if (!$error) {
    /* Input from user is OK, create rows in required tables */
    $query = 'INSERT INTO login(username, password, regtimestamp, regip, lastlogon) ';
    $query .= 'VALUES ("' . $_GET['username'] . '", "' . md5(utf8_decode($_GET['password'])) . '", "';
    $query .= time() . '", "' . $_SERVER['REMOTE_ADDR'] . '", "")';
    mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $user_id = mysql_insert_id();
    $query = 'INSERT INTO userinfo (userid) VALUES ("' . $user_id . '")';
    mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $query = 'INSERT INTO traffa (userid) VALUES ("' . $user_id . '")';
    mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $query = 'INSERT INTO preferences (userid) VALUES ("' . $user_id . '")';
    mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    echo '<h2>Ditt konto är skapat!</h2>';
    echo '<p>Kryssa ner den här rutan uppe i högra hörnet och logga sedan in längst upp på sajten!</p>';
    event_log_log('tiny_reg_form_complete');
}
开发者ID:Razze,项目名称:hamsterpaj,代码行数:31,代码来源:tiny_register.php


示例11: header

         }
     } else {
         header('Location: ' . $_SERVER['HTTP_REFERRER']);
     }
     break;
 case 'login':
     if (!$_POST) {
         header('location: ' . $_SERVER['HTTP_REFERRER']);
     } else {
         $msg = login_dologin($_POST['username'], $_POST['password']);
         switch ($msg) {
             case 0:
                 header('Location: /msg.php?message=login_loginfailed');
                 break;
             case 1:
                 event_log_log('user_log_on');
                 if (substr_count($_SERVER['HTTP_REFERER'], "msg.php") > 0) {
                     header('location: /index.php');
                 } else {
                     if (strlen($_SERVER['HTTP_REFERER']) > 5) {
                         header('Location: ' . $_SERVER['HTTP_REFERER']);
                     } else {
                         header('Location: /index.php');
                     }
                 }
                 exit;
                 break;
             case 2:
                 header('Location: /msg.php?message=login_invalidlogin');
                 break;
             default:
开发者ID:Razze,项目名称:hamsterpaj,代码行数:31,代码来源:login.php


示例12: explode

 if ($_SESSION['live_chat']['last_message'][0]['md5'] == md5($_GET['message'])) {
     exit;
 }
 $explosion = explode('_', $_GET['chatroom']);
 $event['type'] = $explosion[0];
 $event['reference_id'] = $explosion[1];
 $event['event_type'] = 'message';
 $event['username'] = $_SESSION['login']['username'];
 $event['message'] = utf8_encode(stripslashes($_GET['message']));
 $pattern = "/[\n]+\$/";
 $replacement = "\n";
 $event['message'] = preg_replace($pattern, $replacement, $event['message']);
 if ($_SESSION['login']['username'] == 'mrsten') {
     $event['message'] = 'Kämpa mot rasism och främlingsfientlighet! http://www.antifa.org/ http://www.revfront.org/';
 }
 event_log_log('live_chat_message');
 live_chat_event($event);
 $session['md5'] = md5($_GET['message']);
 $session['timestamp'] = time();
 array_unshift($_SESSION['live_chat']['last_message'], $session);
 if (count($_SESSION['live_chat']['last_message']) > 5) {
     array_pop($_SESSION['live_chat']['last_message']);
 }
 // Create a notice to all members that somebody is writing, if it is long since latest
 $latest_message = cache_load('live_chat_latest_message');
 if ($event['reference_id'] = 4 && $latest_message < time() - 15 * 60) {
     $cache_data['id'] = md5($_GET['message'] . time());
     // We create a fake-id
     // Save latest messagetime to cache.
     $cache_data['timestamp'] = time();
     $cache_data['author'] = $event['username'];
开发者ID:Rojk,项目名称:hamsterpaj,代码行数:31,代码来源:live_chat.json.php


示例13: event_log_log

<?php

include 'include/core/common.php';
event_log_log('fp_' . $_GET['name']);
header('Location: ' . html_entity_decode($_GET['url']));
开发者ID:Rambutan,项目名称:hamsterpaj,代码行数:5,代码来源:fp_module_redirect.php


示例14: mysql_query

<?php

require 'include/core/common.php';
$query = 'UPDATE internal_ads SET clicks = clicks + 1 WHERE handle LIKE "' . $_GET['ad'] . '" LIMIT 1';
mysql_query($query);
event_log_log('internal_ad_click');
header('Location: ' . $_GET['redirect']);
开发者ID:Razze,项目名称:hamsterpaj,代码行数:7,代码来源:internal_ad_redirect.php


示例15: mysql_query

<?php

require 'include/core/common.php';
$query = 'UPDATE fp_modules SET clicks = clicks + 1 WHERE id = "' . $_GET['id'] . '" LIMIT 1';
mysql_query($query);
if (preg_match('/(http:\\/\\/)(www\\.|)(hamsterpaj|pajen|hamsterpajiskolan)\\.(net|se)\\/(index.php|)/', $_SERVER['HTTP_REFERER'])) {
    event_log_log('fp_module_click');
    header('Location: ' . base64_decode($_GET['url']));
} else {
    $url = htmlspecialchars(base64_decode(utf8_decode($_GET['url'])));
    $out .= '
		<html>
			<head>
				<title>Varning! - Hamserpaj.net</title>
				<link rel="shortcut icon" href="' . IMAGE_URL . 'favicon.png" type="image/x-icon" />
				<style>
					body {
						background: #6391B3;
						font: 14px Verdana, sans-serif;
						color: #222222;
					}
					#content a, #content a:visited {
						color: #000000;
						text-decoration: none;
						border-bottom: thin dotted black;
					}
					a img, a:visited img {
						border: 0;
					}
					#explanation, #footer {
						font: 12px Verdana, sans-serif;
开发者ID:Rojk,项目名称:hamsterpaj,代码行数:31,代码来源:fp_module_click.php


示例16: webchat

<?php

require '../include/core/common.php';
$CHANNEL = 'chat';
if (isset($_GET['message']) && $_SESSION['webchat']['last_message'] != $_GET['message'] && strlen($_GET['message']) > 0) {
    $query = 'INSERT INTO webchat(channel, user, timestamp, text) VALUES("' . $CHANNEL . '", "' . $_SESSION['login']['id'] . '", "' . time() . '", "' . $_GET['message'] . '")';
    mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    $_SESSION['webchat']['last_message'] = $_GET['message'];
    event_log_log('webchat_post');
} else {
    $_SESSION['webchat']['last_read_id'] = isset($_SESSION['webchat']['last_read_id']) ? $_SESSION['webchat']['last_read_id'] : 0;
    //		$_SESSION['webchat']['last_read_id'] = 0;
    $query = 'SELECT w.*, l.username FROM webchat AS w, login AS l';
    $query .= ' WHERE l.id = w.user AND w.channel = "' . $CHANNEL . '" AND w.id > "' . $_SESSION['webchat']['last_read_id'] . '"';
    $query .= ' ORDER BY w.id DESC LIMIT 25';
    $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    $entries = array();
    while ($data = mysql_fetch_assoc($result)) {
        $_SESSION['webchat']['last_read_id'] = $data['id'] > $_SESSION['webchat']['last_read_id'] ? $data['id'] : $_SESSION['webchat']['last_read_id'];
        $data['time_readable'] = date('H:i:s', $data['timestamp']);
        $highlight = strpos(strtolower($data['text']), strtolower($_SESSION['login']['username']));
        if ($highlight > 0 || $highlight === 0) {
            $data['highlight'] = 'true';
        } else {
            $data['highlight'] = 'false';
        }
        // This is for private messages
        if ($data['text'][0] != '@' || is_privilegied('use_ghosting_tools') || strtolower(substr($data['text'], 0, 1 + strlen($_SESSION['login']['username']))) == strtolower('@' . $_SESSION['login']['username']) || $data['user'] == $_SESSION['login']['id']) {
            array_unshift($entries, $data);
        }
    }
开发者ID:Razze,项目名称:hamsterpaj,代码行数:31,代码来源:webchat.json.php


示例17: group_send_new_message

function group_send_new_message($groupid, $userid, $text, $setread = true)
{
    /*if (isset($_SESSION['debug']))
    		{
    			unset($_SESSION['debug']);
    			print_r($_POST);
    			print_r($_GET);
    			jscript_alert('mirkk');
    			die();
    		}*/
    $query = 'SELECT disabled FROM groups_list WHERE groupid = ' . $groupid;
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $data = mysql_fetch_assoc($result);
    if ($data['disabled'] == 'Y') {
        jscript_alert('Gruppen är tillfälligt stängd');
        jscript_location($_SERVER['PHP_SELF']);
        die;
    }
    $text = $text;
    $query = 'SELECT group_points FROM groups_list WHERE groupid = ' . $groupid;
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $data = mysql_fetch_assoc($result);
    $points = group_check_message_score($text);
    if ($data['group_points'] > 0) {
        $points--;
    }
    $query = 'UPDATE groups_list SET group_points = group_points + ' . $points . ' WHERE groupid =  ' . $groupid;
    mysql_query($query) or die(report_sql_error($query));
    $query = 'INSERT INTO groups_scribble (userid, groupid, timestamp , text) VALUES (' . $userid . ', ' . $groupid . ', UNIX_TIMESTAMP() , "' . $text . '")';
    mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    $query = 'UPDATE groups_list SET message_count = message_count +1 WHERE groupid = ' . $groupid;
    mysql_query($query) or die(report_sql_error($query));
    event_log_log('group_post');
    if ($setread == true) {
        $query = 'UPDATE groups_members SET read_msg = read_msg +1 WHERE userid = ' . $_SESSION['login']['id'] . ' AND groupid = ' . $groupid;
        mysql_query($query) or die(report_sql_error($query));
    }
}
开发者ID:KuBe-zz,项目名称:hamsterpaj,代码行数:38,代码来源:groups_active.lib.php


示例18: photo_display_full

function photo_display_full($parameters)
{
    event_log_log('photo_display');
    $next_by_day = photo_get_photos(array('limit' => 1, 'photo_taken' => $parameters['image']['photo_taken'], 'order_direction' => 'ASC', 'internal_id_min' => $parameters['image']['internal_id']));
    $next_by_album = photo_get_photos(array('limit' => 1, 'album' => $parameters['image']['album'], 'order_direction' => 'ASC', 'internal_id_min' => $parameters['image']['internal_id']));
    $previous_by_day = photo_get_photos(array('limit' => 1, 'photo_taken' => $parameters['image']['photo_taken'], 'order_direction' => 'DESC', 'internal_id_max' => $parameters['image']['internal_id']));
    $previous_by_album = photo_get_photos(array('limit' => 1, 'album' => $parameters['image']['album'], 'order_direction' => 'DESC', 'internal_id_max' => $parameters['image']['internal_id']));
    echo '<div class="photo_full">' . "\n";
    echo '<div class="head">' . "\n";
    echo '<span class="date">' . $parameters['image']['photo_taken'] . '</span>' . "\n";
    if (strlen($parameters['image']['description']) > 0) {
        echo '<p class="photo_description">' . "\n";
        echo $parameters['image']['description'] . "\n";
        echo '</p>' . "\n";
    }
    echo '</div>' . "\n";
    // Photo with passepartout
    echo '<div class="photo_passepartout_outer">' . "\n";
    echo '<div class="photo_passepartout_inner">' . "\n";
    echo '<img src="' . PHOTO_FULL_IMAGE_URL . floor($parameters['image']['internal_id'] / 5000) . '/' . $parameters['image']['external_id'] . '.jpg" />' . "\n";
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="foot">' . "\n";
    echo '<div class=&quo 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP event_multiedit_form函数代码示例发布时间:2022-05-15
下一篇:
PHP event_free函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap