本文整理汇总了PHP中log_insert函数的典型用法代码示例。如果您正苦于以下问题:PHP log_insert函数的具体用法?PHP log_insert怎么用?PHP log_insert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_insert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: store
function store()
{
require_once mnminclude . 'log.php';
global $db, $current_user, $globals;
if (!$this->date) {
$this->date = $globals['now'];
}
$comment_author = $this->author;
$comment_link = $this->link;
$comment_karma = $this->karma;
$comment_date = $this->date;
$comment_randkey = $this->randkey;
$comment_content = $db->escape(clean_lines($this->content));
if ($this->type == 'admin') {
$comment_type = 'admin';
} else {
$comment_type = 'normal';
}
if ($this->id === 0) {
$this->ip = $db->escape($globals['user_ip']);
$db->query("INSERT INTO comments (comment_user_id, comment_link_id, comment_type, comment_karma, comment_ip, comment_date, comment_randkey, comment_content) VALUES ({$comment_author}, {$comment_link}, '{$comment_type}', {$comment_karma}, '{$this->ip}', FROM_UNIXTIME({$comment_date}), {$comment_randkey}, '{$comment_content}')");
$this->id = $db->insert_id;
// Insert comment_new event into logs
log_insert('comment_new', $this->id, $current_user->user_id);
} else {
$db->query("UPDATE comments set comment_user_id={$comment_author}, comment_link_id={$comment_link}, comment_type='{$comment_type}', comment_karma={$comment_karma}, comment_ip = '{$this->ip}', comment_date=FROM_UNIXTIME({$comment_date}), comment_randkey={$comment_randkey}, comment_content='{$comment_content}' WHERE comment_id={$this->id}");
// Insert comment_new event into logs
log_conditional_insert('comment_edit', $this->id, $current_user->user_id, 30);
}
$this->update_order();
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:31,代码来源:comment.php
示例2: store
function store($full = true)
{
require_once mnminclude . 'log.php';
global $db, $current_user, $globals;
$db->transaction();
if (!$this->date) {
$this->date = time();
}
$post_author = $this->author;
$post_src = $this->src;
$post_karma = $this->karma;
$post_date = $this->date;
$post_randkey = $this->randkey;
$post_content = $db->escape($this->normalize_content());
if ($this->id === 0) {
$this->ip = $globals['user_ip_int'];
$db->query("INSERT INTO posts (post_user_id, post_karma, post_ip_int, post_date, post_randkey, post_src, post_content) VALUES ({$post_author}, {$post_karma}, {$this->ip}, FROM_UNIXTIME({$post_date}), {$post_randkey}, '{$post_src}', '{$post_content}')");
$this->id = $db->insert_id;
$this->insert_vote($post_author);
// Insert post_new event into logs
if ($full) {
log_insert('post_new', $this->id, $post_author);
}
} else {
$db->query("UPDATE posts set post_user_id={$post_author}, post_karma={$post_karma}, post_ip_int = '{$this->ip}', post_date=FROM_UNIXTIME({$post_date}), post_randkey={$post_randkey}, post_content='{$post_content}' WHERE post_id={$this->id}");
// Insert post_new event into logs
if ($full) {
log_conditional_insert('post_edit', $this->id, $post_author, 30);
}
}
if ($full) {
$this->update_conversation();
}
$db->commit();
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:35,代码来源:post.php
示例3: store
function store($full = true) {
require_once(mnminclude.'log.php');
global $db, $current_user, $globals;
if(!$this->date) $this->date=$globals['now'];
$comment_author = $this->author;
$comment_link = $this->link;
$comment_karma = $this->karma;
$comment_date = $this->date;
$comment_randkey = $this->randkey;
$comment_content = $db->escape($this->normalize_content());
if ($this->type == 'admin') $comment_type = 'admin';
else $comment_type = 'normal';
$db->transaction();
if($this->id===0) {
$this->ip = $db->escape($globals['user_ip']);
$db->query("INSERT INTO comments (comment_user_id, comment_link_id, comment_type, comment_karma, comment_ip, comment_date, comment_randkey, comment_content) VALUES ($comment_author, $comment_link, '$comment_type', $comment_karma, '$this->ip', FROM_UNIXTIME($comment_date), $comment_randkey, '$comment_content')");
$this->id = $db->insert_id;
// Insert comment_new event into logs
if ($full) log_insert('comment_new', $this->id, $current_user->user_id);
} else {
$db->query("UPDATE comments set comment_user_id=$comment_author, comment_link_id=$comment_link, comment_type='$comment_type', comment_karma=$comment_karma, comment_ip = '$this->ip', comment_date=FROM_UNIXTIME($comment_date), comment_modified=now(), comment_randkey=$comment_randkey, comment_content='$comment_content' WHERE comment_id=$this->id");
// Insert comment_new event into logs
if ($full) log_conditional_insert('comment_edit', $this->id, $current_user->user_id, 60);
}
if ($full) {
$this->update_order();
$this->update_conversation();
}
$db->commit();
}
开发者ID:rasomu,项目名称:chuza,代码行数:32,代码来源:comment.php
示例4: log_conditional_insert
function log_conditional_insert($type, $ref_id, $user_id = 0, $seconds = 0)
{
global $db, $globals;
if (!log_get_date($type, $ref_id, $user_id, $seconds)) {
return log_insert($type, $ref_id, $user_id);
}
return false;
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:8,代码来源:log.php
示例5: log_user
function log_user($user) {
// We want to know who the hell is this
$encoded_user = json_encode($user);
cache_set('user:' . $user['id'], $encoded_user);
// Log this usage
log_insert('user_hit');
}
开发者ID:ryandao,项目名称:Facebook-Status-Time-Capsule,代码行数:8,代码来源:db.php
示例6: do_login
function do_login()
{
global $current_user, $globals;
$form_ip_check = check_form_auth_ip();
$previous_login_failed = log_get_date('login_failed', $globals['form_user_ip_int'], 0, 300);
echo '<form action="' . get_auth_link() . 'login.php" id="xxxthisform" method="post">' . "\n";
if ($_POST["processlogin"] == 1) {
// Check the IP, otherwise redirect
if (!$form_ip_check) {
header("Location: http://" . get_server_name() . $globals['base_url'] . "login.php");
die;
}
$username = clean_input_string(trim($_POST['username']));
$password = trim($_POST['password']);
if ($_POST['persistent']) {
$persistent = 3600000;
// 1000 hours
} else {
$persistent = 0;
}
// Check form
if (($previous_login_failed > 2 || $globals['captcha_first_login'] == true && !UserAuth::user_cookie_data()) && !ts_is_human()) {
log_insert('login_failed', $globals['form_user_ip_int'], 0);
recover_error(_('el código de seguridad no es correcto'));
} elseif ($current_user->Authenticate($username, md5($password), $persistent) == false) {
log_insert('login_failed', $globals['form_user_ip_int'], 0);
recover_error(_('usuario o email inexistente, sin validar, o clave incorrecta'));
$previous_login_failed++;
} else {
UserAuth::check_clon_from_cookies();
if (!empty($_REQUEST['return'])) {
header('Location: ' . $_REQUEST['return']);
} else {
header('Location: ./');
}
die;
}
}
echo '<p><label for="name">' . _('usuario o email') . ':</label><br />' . "\n";
echo '<input type="text" name="username" size="25" tabindex="1" id="name" value="' . htmlentities($username) . '" /></p>' . "\n";
echo '<p><label for="password">' . _('clave') . ':</label><br />' . "\n";
echo '<input type="password" name="password" id="password" size="25" tabindex="2"/></p>' . "\n";
echo '<p><label for="remember">' . _('recuérdame') . ': </label><input type="checkbox" name="persistent" id="remember" tabindex="3"/></p>' . "\n";
// Print captcha
if ($previous_login_failed > 2 || $globals['captcha_first_login'] == true && !UserAuth::user_cookie_data()) {
ts_print_form();
}
get_form_auth_ip();
echo '<p><input type="submit" value="login" tabindex="4" />' . "\n";
echo '<input type="hidden" name="processlogin" value="1"/></p>' . "\n";
echo '<input type="hidden" name="return" value="' . htmlspecialchars($_REQUEST['return']) . '"/>' . "\n";
echo '</form>' . "\n";
echo '<div><strong><a href="login.php?op=recover">' . _('¿has olvidado la contraseña?') . '</a></strong></div>' . "\n";
echo '<div style="margin-top: 30px">';
print_oauth_icons($_REQUEST['return']);
echo '</div>' . "\n";
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:57,代码来源:login.php
示例7: borrar_usuarios_no_activados_antiguos
function borrar_usuarios_no_activados_antiguos()
{
global $dbc;
// miro si se han borrado usuarios inactivos en las últimas 72 horas
$borrados_inactivos = log_get("users_inactives_deleted", 0, 0, 72 * 60 * 60);
if ($borrados_inactivos == 0) {
// si no se ha realizado borrado en las últimas 72 horas lo hago ahora
$sql_delete = "DELETE from `users` WHERE `approved` = 0 AND `date` < now() - INTERVAL 3 DAY";
mysql_query($sql_delete, $dbc['link']) or die("Deletion Failed:" . mysql_error());
log_insert("users_inactives_deleted", 0, 0);
}
}
开发者ID:javimoya,项目名称:carpooling,代码行数:12,代码来源:dbc.inc.php
示例8: deauthorize_page
function deauthorize_page() {
// Remove user from the cache
global $data;
global $db;
$q = $db->prepare('DELETE FROM cache WHERE name = ?');
$name = 'user:' . $data['user_id'];
$q->bind_param('s', $name);
$q->execute();
// Log users that delete the app :( (just log the ID)
log_insert('user_removed_app', $data['user_id']);
}
开发者ID:ryandao,项目名称:Facebook-Status-Time-Capsule,代码行数:12,代码来源:deauthorize.php
示例9: popularity_page
function popularity_page() {
print theme_header(FALSE);
print <<<EOS
<h1>How do we calculate popularity?</h1>
<p>In Status Time Capsule, your popularity depends on:</p>
<ul>
<li>average number of comments per status,</li>
<li>average number of likes per status, and</li>
<li>variance of these numbers among your statuses.</li>
</ul>
<p>Therefore, someone that consistently attracts comments and likes to all of his/her statuses may be ranked as more popular, compared to someone that has occasional popular statuses (with lots of likes and comments).</p>
<p>Technically, we calculate the lower bound of Wilson score confidence interval for a Bernoulli parameter for each user of our app. Then, we rank these lower bound values and derive the top most popular users as well as the percentage of people ranked below yours. For more explanation about the algorithm, see <a href="http://www.evanmiller.org/how-not-to-sort-by-average-rating.html">the article by Evan Miller</a>.</p>
EOS;
print theme_links();
print theme_footer();
// Ugly error suppression
@log_insert('popularity_hit');
}
开发者ID:ryandao,项目名称:Facebook-Status-Time-Capsule,代码行数:23,代码来源:popularity.php
示例10: sprintf
$link->negatives = $votes_neg;
$link->store_basic();
} else {
$karma_mess = '';
}
print "<tr><td class='tnumber{$imod}'>{$link->id}</td><td class='tnumber{$imod}'>" . $link->votes . "</td><td class='tnumber{$imod}'>" . $link->negatives . "</td><td class='tnumber{$imod}'>" . sprintf("%0.2f", $new_coef) . "</td><td class='tnumber{$imod}'>" . intval($link->karma) . "</td>";
echo "<td class='tdata{$imod}'><a href='" . $link->get_permalink() . "'>{$link->title}</a>\n";
echo "{$karma_mess}</td>\n";
if ($link->votes >= $min_votes && $dblink->karma >= $min_karma && $published < $max_to_publish) {
$published++;
$link->karma = $dblink->karma;
$link->status = 'published';
$link->published_date = time();
$link->store_basic();
// Add the publish event/log
log_insert('link_publish', $link->id, $link->author);
$changes = 3;
// to show a "published" later
}
echo "<td class='tnumber{$imod}'>";
switch ($changes) {
case 1:
echo '<img src="../img/common/sneak-problem01.png" width="20" height="16" alt="' . _('descenso') . '"/>';
break;
case 2:
echo '<img src="../img/common/sneak-vote01.png" width="20" height="16" alt="' . _('ascenso') . '"/>';
break;
case 3:
echo '<img src="../img/common/sneak-published01.png" width="20" height="16" alt="' . _('publicada') . '"/>';
break;
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:31,代码来源:promote6.php
示例11: do_register2
function do_register2() {
global $db, $current_user, $globals;
if ( !ts_is_human()) {
register_error(_('el código de seguridad no es correcto'));
return;
}
if (!check_user_fields()) return;
$username=clean_input_string(trim($_POST['username'])); // sanity check
$dbusername=$db->escape($username); // sanity check
$password=md5(trim($_POST['password']));
$email=clean_input_string(trim($_POST['email'])); // sanity check
$dbemail=$db->escape($email); // sanity check
$user_ip = $globals['form_user_ip'];
$standard = (int)$_POST['standard'];
if (!user_exists($username)) {
if ($db->query("INSERT INTO users (user_login, user_login_register, user_email, user_email_register, user_pass, user_date, user_ip, user_standard) VALUES ('$dbusername', '$dbusername', '$dbemail', '$dbemail', '$password', now(), '$user_ip', '$standard')")) {
echo '<fieldset>'."\n";
echo '<legend><span class="sign">'._("registro de usuario").'</span></legend>'."\n";
$user=new User();
$user->username=$username;
if(!$user->read()) {
register_error(_('error insertando usuario en la base de datos'));
} else {
require_once(mnminclude.'mail.php');
$sent = send_recover_mail($user);
$globals['user_ip'] = $user_ip; //we force to insert de log with the same IP as the form
log_insert('user_new', $user->id, $user->id);
}
echo '</fieldset>'."\n";
} else {
register_error(_("error insertando usuario en la base de datos"));
}
} else {
register_error(_("el usuario ya existe"));
}
}
开发者ID:rasomu,项目名称:chuza,代码行数:39,代码来源:register.php
示例12: lang_content_destroy
function lang_content_destroy($p_db, $p_table_name, $p_msg_id, $p_country_id)
{
$success = true;
$is_exist = false;
if (lang_content_exist($p_db, $p_table_name, $p_msg_id, $p_country_id)) {
$is_exist = true;
}
if ($is_exist) {
$qry_del = "DELETE FROM `{$p_table_name}`\r\n\t\tWHERE `msg_id`='{$p_msg_id}'\r\n\t\tLIMIT 1";
$res_del = mysql_query($qry_del, $p_db);
if (!$res_del) {
log_insert($p_db, "Error when deleting multilang table:" . mysql_error($p_db));
$success = false;
}
}
return $success;
}
开发者ID:bayucandra,项目名称:qiaff,代码行数:17,代码来源:general.php
示例13: publish
function publish(&$link)
{
global $globals, $db;
global $users_karma_avg;
// Calculate votes average
// it's used to calculate and check future averages
$votes_avg = (double) $db->get_var("select SQL_NO_CACHE avg(vote_value) from votes, users where vote_type='links' AND vote_link_id={$link->id} and vote_user_id > 0 and vote_value > 0 and vote_user_id = user_id and user_level !='disabled'");
if ($votes_avg < $users_karma_avg) {
$link->votes_avg = max($votes_avg, $users_karma_avg * 0.97);
} else {
$link->votes_avg = $votes_avg;
}
$link->status = 'published';
$link->date = $link->published_date = time();
$link->store_basic();
// Increase user's karma
$user = new User();
$user->id = $link->author;
if ($user->read()) {
$user->karma = min(20, $user->karma + 1);
$user->store();
$annotation = new Annotation("karma-{$user->id}");
$annotation->append(_('Noticia publicada') . ": +1, karma: {$user->karma}\n");
}
// Add the publish event/log
log_insert('link_publish', $link->id, $link->author);
$short_url = fon_gs($link->get_permalink());
if ($globals['twitter_user'] && $globals['twitter_password']) {
twitter_post($link, $short_url);
}
if ($globals['jaiku_user'] && $globals['jaiku_key']) {
jaiku_post($link, $short_url);
}
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:34,代码来源:promote7.php
示例14: mysql_query
if ($lang != $prev_lang) {
$query = "update subs set lang_id={$lang} where subID={$id} and fversion={$rversion} and lang_id={$prev_lang}";
mysql_query($query);
$query = "update flangs set lang_id={$lang} where subID={$id} and fversion={$rversion} and lang_id={$prev_lang}";
mysql_query($query);
}
if (!isset($fversion)) {
if ($is_episode) {
$showname = bd_getShowTitle($showID);
if (strlen($season) < 2) {
$season = '0' . $season;
}
if (strlen($epnumber) < 2) {
$epnumber = '0' . $epnumber;
}
$title = $showname . ' - ' . $season . 'x' . $epnumber . ' - ' . $eptitle;
$title = addslashes($title);
$query = "update files set is_episode=1,title='{$title}',season={$season},season_number={$epnumber} where subID={$id}";
mysql_query($query);
} else {
$title = $movietitle . " ({$year})";
$tile = addslashes($title);
$query = "update files set is_episode=0,title='{$title}' where subID={$id}";
mysql_query($query);
}
}
$title = bd_getTitle($id);
log_insert(LOG_updateprop, '', $userID, $id, bd_userIsModerador());
$url = bd_getUrl($id);
location("{$url}");
bbdd_close();
开发者ID:Raak15,项目名称:subtitols,代码行数:31,代码来源:editprop_do.php
示例15: do_save
function do_save() {
global $linkres, $dblang, $current_user;
$linkres->read_content_type_buttons($_POST['type']);
$linkres->category=intval($_POST['category']);
if ($current_user->admin) {
if (!empty($_POST['url'])) {
$linkres->url = clean_input_url($_POST['url']);
}
if ($_POST['thumb_delete']) {
$linkres->delete_thumb();
}
if ($_POST['thumb_get']) {
$linkres->get_thumb();
}
}
$linkres->title = clean_text($_POST['title'], 40);
$linkres->content = clean_text_with_tags($_POST['bodytext']);
$linkres->tags = tags_normalize_string($_POST['tags']);
// change the status
if ($_POST['status'] != $linkres->status
&& ($_POST['status'] == 'autodiscard' || $current_user->admin)
&& preg_match('/^[a-z]{4,}$/', $_POST['status'])
&& ( ! $linkres->is_discarded() || $current_user->admin)) {
if (preg_match('/discard|abuse|duplicated|autodiscard/', $_POST['status'])) {
// Insert a log entry if the link has been manually discarded
$insert_discard_log = true;
}
$linkres->status = $_POST['status'];
}
// EVENTS
$d = $_POST["datepicker1"];
$linkres->start_date = substr($d,3,2).'-'.substr($d, 0, 2).'-'.substr($d,6,4);
$d = $_POST["datepicker2"];
$linkres->end_date = substr($d,3,2).'-'.substr($d, 0, 2).'-'.substr($d,6,4);
if (!link_edit_errors($linkres)) {
if (empty($linkres->uri)) $linkres->get_uri();
$linkres->store();
tags_insert_string($linkres->id, $dblang, $linkres->tags, $linkres->date);
// Insert edit log/event if the link it's newer than 15 days
if ($globals['now'] - $linkres->date < 86400*15) {
require_once(mnminclude.'log.php');
if ($insert_discard_log) {
// Insert always a link and discard event if the status has been changed to discard
log_insert('link_discard', $linkres->id, $current_user->user_id);
if ($linkres->author == $current_user->user_id) { // Don't save edit log if it's discarded by an admin
log_insert('link_edit', $linkres->id, $current_user->user_id);
}
} elseif ($linkres->votes > 0) {
log_conditional_insert('link_edit', $linkres->id, $current_user->user_id, 60);
}
}
echo '<div class="form-error-submit"> '._("noticia actualizada").'</div>'."\n";
}
$linkres->read();
echo '<div class="formnotice">'."\n";
$linkres->print_summary('preview');
echo '</div>'."\n";
echo '<form class="note" method="GET" action="story.php" >';
echo '<input type="hidden" name="id" value="'.$linkres->id.'" />'."\n";
echo '<input class="button" type="button" onclick="window.history.go(-1)" value="« '._('modificar').'"> '."\n";;
echo '<input class="button" type="submit" value="'._('ir a la noticia').'" />'."\n";
echo '</form>'. "\n";
}
开发者ID:rasomu,项目名称:chuza,代码行数:74,代码来源:editlink.php
示例16: do_register
function do_register()
{
global $hasError, $data, $dbc, $globals, $mostrar_captcha;
borrar_usuarios_no_activados_antiguos();
if ($mostrar_captcha) {
validar_captcha($hasError);
}
$user_ip = $globals['ip'];
// hash sha1 de la clave
$sha1pass = PwdHash($data['Password']);
// Generamos el código de activación
$activ_code = rand(1000, 9999);
$usr_email = $data['Email'];
$user_name = $data['UserName'];
// Valido si existe ya el usuario
$rs_duplicate = mysql_query("select count(*) as total from users where user_name='{$user_name}'") or die(mysql_error());
list($total) = mysql_fetch_row($rs_duplicate);
if ($total > 0) {
$hasError[] = "El usuario ya está dado de alta.";
}
// Valido si existe ya el email
$parts = explode('@', $usr_email);
$subparts = explode('+', $parts[0]);
// se permiten direcciones del tipo [email protected], que debemos controlar para no permitir abusos
$rs_duplicate = mysql_query("select count(*) as total from users where user_email = '{$subparts['0']}@{$parts['1']}' or user_email LIKE '{$subparts['0']}+%@{$parts['1']}'") or die(mysql_error());
list($total) = mysql_fetch_row($rs_duplicate);
if ($total > 0) {
$hasError[] = "El email ya está dado de alta.";
}
if (empty($hasError)) {
// Insertamos el Nuevo Usuario
$sql_insert = "INSERT into `users`\n (`user_email`,`pwd`,`date`,`users_ip`,`activation_code`,`user_name`)\n VALUES\n ('{$usr_email}','{$sha1pass}',now(),'{$user_ip}','{$activ_code}','{$user_name}')\n ";
mysql_query($sql_insert, $dbc['link']) or die("Insertion Failed:" . mysql_error());
$user_id = mysql_insert_id($dbc['link']);
$md5_id = md5($user_id);
mysql_query("update users set md5_id='{$md5_id}' where id='{$user_id}'");
log_insert("register_ok", ip2long($globals['ip']));
$_SESSION['email_registro'] = $usr_email;
$_SESSION['email_registro_contador'] = 3;
$_SESSION['hasSuccess'] = null;
enviar_correo_registro($usr_email, $md5_id, $activ_code);
header("Location: thankyou.php");
exit;
}
}
开发者ID:javimoya,项目名称:carpooling,代码行数:45,代码来源:register.php
示例17: bd_link_getSubID
<?php
include 'includes/includes.php';
$linkID = $_GET['linkid'];
$subID = bd_link_getSubID($linkID);
if (!bd_userIsModerador()) {
bbdd_close();
location(bd_getUrl($subID));
exit;
}
$query = "delete from links_data where linkID={$linkID}";
mysql_query($query);
$query = "delete from links where linkID={$linkID}";
mysql_query($query);
log_insert(LOG_deleteLink, bd_link_getFversion($linkID), $_SESSION['userID'], $subID, bd_userIsModerador());
location(bd_getUrl($subID));
bbdd_close();
开发者ID:Raak15,项目名称:subtitols,代码行数:17,代码来源:dellink.php
示例18: while
while ($numresults > 0) {
$query = "select entryID,edited_seq,version from subs where subID={$id} and fversion={$fversion} and lang_id={$lang} and authorID={$author} and last=1";
$result = mysql_query($query);
$numresults = mysql_affected_rows();
while ($row = mysql_fetch_assoc($result)) {
$entry = $row['entryID'];
$seq = $row['edited_seq'];
$version = $row['version'];
if (!$notoriginal) {
$query = "delete from subs where entryID={$entry}";
mysql_query($query);
}
if ($version > 0) {
if ($notoriginal) {
$query = "delete from subs where entryID={$entry}";
mysql_query($query);
}
$minver = $version - 1;
$query = "update subs set last=1 where subID={$id} and fversion={$fversion} and lang_id={$lang} and edited_seq={$seq} and version={$minver}";
mysql_query($query);
}
}
}
if (bd_getOriginalLang($id, $fversion) != $lang && !bd_isMerged($id, $fversion, $lang)) {
tn_check($id, $fversion, bd_getOriginalLang($id, $fversion), $lang);
bd_confirmTranslated($id, $fversion, $lang);
}
$authorName = bd_getUsername($authorName);
log_insert(LOG_troll, "User {$authorname}", $_SESSION['userID'], $id, bd_userIsModerador());
location("/antitroll.php?id={$id}&fversion={$fversion}&lang={$lang}");
bbdd_close();
开发者ID:Raak15,项目名称:subtitols,代码行数:31,代码来源:antitroll_do.php
示例19: do_login
function do_login()
{
global $current_user, $globals;
$form_ip_check = check_form_auth_ip();
$previous_login_failed = log_get_date('login_failed', $globals['form_user_ip_int'], 0, 300);
// Show menéame intro only if first try and the there were not previous logins
if ($previous_login_failed < 3 && empty($_POST["processlogin"]) && empty($_COOKIE['mnm_user'])) {
echo '<div class="faq" style="float:right; width:55%; margin-top: 10px;">' . "\n";
// Only prints if the user was redirected from submit.php
if (!empty($_REQUEST['return']) && preg_match('/submit\\.php/', $_REQUEST['return'])) {
echo '<p style="border:1px solid #FF9400; font-size:1.3em; background:#FEFBEA; font-weight:bold; padding:0.5em 1em;">Para enviar una historia debes ser un usuario registrado</p>' . "\n";
}
echo '<h3>' . _('¿Qué es menéame?') . '</h3>' . "\n";
echo '<p>' . _('Es un sitio que te permite enviar una historia que será revisada por todos y será promovida, o no, a la página principal. Cuando un usuario envía una historia ésta queda en la <a href="shakeit.php">cola de pendientes</a> hasta que reúne los votos suficientes para ser promovida a la página principal') . '.</p>' . "\n";
echo '<h3>' . _('¿Todavía no eres usuario de menéame?') . '</h3>' . "\n";
echo '<p>' . _('Como usuario registrado podrás, entre otras cosas') . ':</p>' . "\n";
echo '<ul style="margin-left: 1.5em">' . "\n";
echo '<li>' . "\n";
echo '<strong>' . _('Enviar historias') . '</strong><br />' . "\n";
echo '<p>' . _('Una vez registrado puedes enviar las historias que consideres interesantes para la comunidad. Si tienes algún tipo de duda sobre que tipo de historias puedes enviar revisa nuestras <a href="faq-es.php">preguntas frecuentes sobre menéame</a>') . '.</p>' . "\n";
echo '</li>' . "\n";
echo '<li>' . "\n";
echo '<strong>' . _('Escribir comentarios') . '</strong><br />' . "\n";
echo '<p>' . _('Puedes escribir tu opinión sobre las historias enviadas a menéame mediante comentarios de texto. También puedes votar positivamente aquellos comentarios ingeniosos, divertidos o interesantes y negativamente aquellos que consideres inoportunos') . '.</p>' . "\n";
echo '</li>' . "\n";
echo '<li>' . "\n";
echo '<strong>' . _('Perfil de usuario') . '</strong><br />' . "\n";
echo '<p>' . _('Toda tu información como usuario está disponible desde la página de tu perfil. También puedes subir una imagen que representará a tu usuario en menéame. Incluso es posible compartir los ingresos publicitarios de Menéame, solo tienes que introducir el código de tu cuenta Google Adsense desde tu perfil') . '.</p>' . "\n";
echo '</li>' . "\n";
echo '<li>' . "\n";
echo '<strong>' . _('Chatear en tiempo real desde la fisgona') . '</strong><br />' . "\n";
echo '<p>' . _('Gracias a la <a href="sneak.php">fisgona</a> puedes ver en tiempo real toda la actividad de menéame. Además como usuario registrado podrás chatear con mucha más gente de la comunidad menéame') . '</p>' . "\n";
echo '</li>' . "\n";
echo '</ul>' . "\n";
echo '<h3><a href="register.php" style="color:#FF6400; text-decoration:underline; display:block; width:8em; text-align:center; margin:0 auto; padding:0.5em 1em; border:3px double #FFE2C5; background:#FFF3E8;">Regístrate ahora</a></h3>' . "\n";
echo '</div>' . "\n";
echo '<div class="genericform" style="float:left; width:40%; margin: 0">' . "\n";
} else {
echo '<div class="genericform" style="float:auto;">' . "\n";
}
echo '<form action="' . get_auth_link() . 'login.php" id="thisform" method="post">' . "\n";
if ($_POST["processlogin"] == 1) {
// Check the IP, otherwise redirect
if (!$form_ip_check) {
header("Location: http://" . get_server_name() . $globals['base_url'] . "login.php");
die;
}
$username = clean_input_string(trim($_POST['username']));
$password = trim($_POST['password']);
if ($_POST['persistent']) {
$persistent = 3600000;
// 1000 hours
} else {
$persistent = 0;
}
// Check form
if (($previous_login_failed > 2 || $globals['captcha_first_login'] == true && !UserAuth::user_cookie_data()) && !ts_is_human()) {
log_insert('login_failed', $globals['form_user_ip_int'], 0);
recover_error(_('el código de seguridad no es correcto'));
} elseif ($current_user->Authenticate($username, md5($password), $persistent) == false) {
log_insert('login_failed', $globals['form_user_ip_int'], 0);
recover_error(_('usuario o email inexistente, sin validar, o clave incorrecta'));
$previous_login_failed++;
} else {
UserAuth::check_clon_from_cookies();
if (!empty($_REQUEST['return'])) {
header('Location: http://' . get_server_name() . $_REQUEST['return']);
} else {
header('Location: http://' . get_server_name() . $globals['base_url']);
}
die;
}
}
echo '<fieldset>' . "\n";
echo '<legend><span class="sign">login</span></legend>' . "\n";
echo '<p><label for="name">' . _('usuario o email') . ':</label><br />' . "\n";
echo '<input type="text" name="username" size="25" tabindex="1" id="name" value="' . htmlentities($username) . '" /></p>' . "\n";
echo '<p><label for="password">' . _('clave') . ':</label><br />' . "\n";
echo '<input type="password" name="password" id="password" size="25" tabindex="2"/></p>' . "\n";
echo '<p><label for="remember">' . _('recuérdame') . ': </label><input type="checkbox" name="persistent" id="remember" tabindex="3"/></p>' . "\n";
// Print captcha
if ($previous_login_failed > 2 || $globals['captcha_first_login'] == true && !UserAuth::user_cookie_data()) {
ts_print_form();
}
get_form_auth_ip();
echo '<p><input type="submit" value="login" class="button" tabindex="4" />' . "\n";
echo '<div align="center">';
print_oauth_icons($_REQUEST['return']);
echo '</div>' . "\n";
echo '<input type="hidden" name="processlogin" value="1"/></p>' . "\n";
echo '<input type="hidden" name="return" value="' . htmlspecialchars($_REQUEST['return']) . '"/>' . "\n";
echo '</fieldset>' . "\n";
echo '</form>' . "\n";
echo '<div class="recoverpass" align="center"><h4><a href="login.php?op=recover">' . _('¿has olvidado la contraseña?') . '</a></h4></div>' . "\n";
echo '</div>' . "\n";
echo '<br clear="all"/> ';
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:97,代码来源:login.php
示例20: do_login
function do_login()
{
global $current_user, $globals;
// Start posavasos & ashacz code
$previous_login_failed = log_get_date('login_failed', $globals['original_user_ip_int'], 0, 90);
if ($previous_login_failed < 3 && empty($_POST["processlogin"])) {
echo '<div id="mini-faq" style="float:left; width:65%; margin-top: 10px;">' . "\n";
// gallir: Only prints if the user was redirected from submit.php
if (!empty($_REQUEST['return']) && preg_match('/submit\\.php/', $_REQUEST['return'])) {
echo '<p style="border:1px solid #FF9400; font-size:1.3em; background:#FEFBEA; font-weight:bold; padding:0.5em 1em;">Para enviar una historia debes ser un usuario registrado</p>' . "\n";
}
echo '<h3>¿Qué es menéame?</h3>' . "\n";
echo '<p>Es un web que te permite enviar una historia que será revisada por todos y será promovida, o no, a la página principal. Cuando un usuario envía una historia ésta queda en la <a href="shakeit.php" title="Cola de historias pendientes">cola de pendientes</a> hasta que reúne los votos suficientes para ser promovida a la página principal.</p>' . "\n";
echo '<h3>¿Todavía no eres usuario de menéame?</h3>' . "\n";
echo '<p>Como usuario registrado podrás, entre otras cosas:</p>' . "\n";
echo '<ul>' . "\n";
echo '<li>' . "\n";
echo '<strong>Enviar historias</strong><br />' . "\n";
echo 'Una vez registrado puedes enviar las historias que consideres interesantes para la comunidad. Si tienes algún tipo de duda sobre que tipo de historias puedes enviar revisa nuestras <a href="faq-es.php" title="Acerca de meneame">preguntas frecuentes sobre menéame.</a>' . "\n";
echo '</li>' . "\n";
echo '<li>' . "\n";
echo '<strong>Escribir comentarios</strong><br />' . "\n";
echo 'Puedes escribir tu opinión sobre las historias enviadas a menéame mediante comentarios de texto. También puedes votar positivamente aquellos comentarios ingeniosos, divertidos o interesantes y negativamente aquellos que consideres inoportunos.' . "\n";
echo '</li>' . "\n";
echo '<li>' . "\n";
echo '<strong>Perfil de usuario</strong><br />' . "\n";
echo 'Toda tu información como usuar
|
请发表评论