$summary = text_to_summary($db->get_var("SELECT post_content from posts where post_id = {$post_id}"), 250); $globals['description'] = _('Autor') . ": {$user->username}, " . _('Resumen') . ': ' . $summary; $page_title = text_to_summary($summary, 120); if ($user->avatar) { $globals['thumbnail'] = get_avatar_url($user->id, $user->avatar, 80); } //$page_title = sprintf(_('nota de %s'), $user->username) . " ($post_id)"; $globals['search_options']['u'] = $user->username; $where = "post_id = {$post_id}"; $order_by = ""; $limit = ""; $rows = 1; } else { // User is specified $user->username = $db->escape($argv[0]); if (!$user->read() || $user->disabled()) { do_error(_('usuario no encontrado'), 404); } switch ($argv[1]) { case '_friends': $view = 1; $page_title = sprintf(_('amigos de %s'), $user->username); $from = ", friends"; $where = "friend_type='manual' and friend_from = {$user->id} and friend_to=post_user_id and friend_value > 0"; $order_by = "ORDER BY post_id desc"; $limit = "LIMIT {$offset},{$page_size}"; $rows = $db->get_var("SELECT count(*) FROM posts, friends WHERE friend_type='manual' and friend_from = {$user->id} and friend_to=post_user_id and friend_value > 0"); $rss_option = "sneakme_rss2.php?friends_of={$user->id}"; break; case '_favorites': $view = 2;
$globals['extra_js'][] = 'ajaxupload.min.js'; } // Enable user AdSense // do_user_ad: 0 = noad, > 0: probability n/100 // 100 if the user is the current one if ($globals['external_user_ads'] && !empty($user->adcode)) { $globals['user_adcode'] = $user->adcode; $globals['user_adchannel'] = $user->adchannel; if ($current_user->user_id == $user->id || $current_user->admin) { $globals['do_user_ad'] = 100; } else { $globals['do_user_ad'] = $user->karma * 2; } } // Load Google GEO if (!$user->disabled() && $view == 'profile' && $globals['google_maps_api'] && (($globals['latlng'] = $user->get_latlng()) || $current_user->user_id == $user->id)) { if ($current_user->user_id == $user->id) { geo_init('geo_coder_editor_load', $globals['latlng'], 7, 'user'); } else { geo_init('geo_coder_load', $globals['latlng'], 7, 'user'); } $globals['do_geo'] = true; } // Check if it should be index AND if they are valids options, otherwise call do_error() switch ($view) { case 'history': case 'shaken': case 'friends_shaken': case 'friends': case 'friends_new': case 'friend_of':
function do_recover() { global $site_key, $globals; echo '<div class="genericform">' . "\n"; echo '<fieldset>' . "\n"; echo '<legend><span class="sign">' . _("recuperación de contraseñas") . '</span></legend>' . "\n"; if (!empty($_POST['recover'])) { if (!ts_is_human()) { recover_error(_('el código de seguridad no es correcto')); } else { $error = false; $user = new User(); if (preg_match('/.+@.+\\..+$/', $_POST['email'])) { // It's an email address $user->email = $_POST['email']; } else { recover_error(_('el email no es válido')); $error = true; } if (!$error && !$user->read()) { recover_error(_('el email no está relacionado con ninguna cuenta')); $error = true; } if (!$error && $user->disabled()) { recover_error(_('cuenta deshabilitada')); $error = true; } if (!$error) { require_once mnminclude . 'mail.php'; $sent = send_recover_mail($user); } } } if (!$sent) { echo '<form action="login.php" id="thisform-recover" method="post">' . "\n"; echo '<label for="name" style="font-size:120%">' . _('indica el email de la cuenta') . ':</label><br />' . "\n"; echo '<input type="text" name="email" size="25" tabindex="1" id="name" value="' . htmlspecialchars($_POST['email']) . '" />' . "\n"; echo '<p>' . _('(recibirás un e-mail que te permitirá editar tus datos)') . '</p> <br/>'; echo '<input type="hidden" name="recover" value="1"/>' . "\n"; echo '<input type="hidden" name="return" value="' . htmlspecialchars($_REQUEST['return']) . '"/>' . "\n"; ts_print_form(); echo '<br /><input type="submit" value="' . _('recibir e-mail') . '" class="button" />' . "\n"; echo '</form>' . "\n"; } echo '</fieldset>' . "\n"; echo '</div>' . "\n"; }
array_push($globals['extra_js'], 'jquery-form.pack.js'); array_push($globals['extra_js'], 'ajaxupload.min.js'); } // Enable user AdSense // do_user_ad: 0 = noad, > 0: probability n/100 // 100 if the user is the current one if($globals['external_user_ads'] && !empty($user->adcode)) { $globals['user_adcode'] = $user->adcode; $globals['user_adchannel'] = $user->adchannel; if ($current_user->user_id == $user->id || $current_user->admin) $globals['do_user_ad'] = 100; else $globals['do_user_ad'] = $user->karma * 2; } // Load Google GEO if (! $user->disabled() && $view == 'profile' && $globals['google_maps_api'] && (($globals['latlng']=$user->get_latlng()) || $current_user->user_id == $user->id)) { if ($current_user->user_id == $user->id) { geo_init('geo_coder_editor_load', $globals['latlng'], 7, 'user'); } else { geo_init('geo_coder_load', $globals['latlng'], 7, 'user'); } $globals['do_geo'] = true; } // Check if it should be index AND if they are valids options, otherwise call do_error() switch ($view) { case 'categories': case 'history':
function do_recover() { global $site_key, $globals; if (!empty($_POST['recover'])) { if (!ts_is_human()) { recover_error(_('el código de seguridad no es correcto')); } else { $error = false; $user = new User(); if (preg_match('/.+@.+/', $_POST['email'])) { $user->email = $_POST['email']; } else { recover_error(_('el email no es válido')); $error = true; } if (!$error && !$user->read()) { recover_error(_('el email no está relacionado con ninguna cuenta')); $error = true; } if (!$error && $user->disabled()) { recover_error(_('cuenta deshabilitada')); $error = true; } if (!$error) { require_once mnminclude . 'mail.php'; $sent = send_recover_mail($user); } } } if (!$sent) { echo '<form action="login.php" method="post">' . "\n"; echo '<label for="name">' . _('indica el email de la cuenta') . ':</label><br />' . "\n"; echo '<input type="text" name="email" size="25" id="name" value="' . htmlspecialchars($_POST['email']) . '" />' . "\n"; echo '<p>' . _('(recibirás un e-mail que te permitirá editar tus datos)') . '</p> <br/>'; echo '<input type="hidden" name="recover" value="1"/>' . "\n"; echo '<input type="hidden" name="return" value="' . htmlspecialchars($_REQUEST['return']) . '"/>' . "\n"; ts_print_form(); echo '<br /><input type="submit" value="' . _('recibir e-mail') . '"/>' . "\n"; echo '</form>' . "\n"; } }