} else { $tid = 0; } $link = pc_db_connect(); $pc = pc_load_infor($link, $userid); if (!$pc) { pc_db_close($link); html_init("gb2312", "Blog"); html_error_quit("对不起,您要查看的Blog不存在"); exit; } $f_err = ""; if (pc_is_admin($currentuser, $pc) && $loginok == 1) { if (isset($_GET["act"])) { if ($_GET["act"] == "addfriend") { $f_err = add_friend($pc); } if ($_GET["act"] == "delfriend") { del_friend($pc); } } } $isfriend = pc_is_friend($currentuser["userid"], $pc["USER"]); $userPermission = pc_get_user_permission($currentuser, $pc); $sec = $userPermission["sec"]; $pur = $userPermission["pur"]; $tags = $userPermission["tags"]; $secnum = count($sec); if (!$tags[$tag]) { $tag = 0; }
<?php include "top.php"; // Get the userID to display $userID = $_GET["userID"]; // NOTE: Here you can use your new database query function to get // more fields from the database $username = database_get_username($userID); $phone = database_get_phone($userID); //Get the posts from this userID $posts = database_get_user_posts($userID); $loggedInUser = get_user_logged_in(); // See if we should add the friend if (!empty($_GET["addfriend"])) { add_friend($loggedInUser, $userID); } ?> <!-- Start the content for this user --> <div id = "container"> <div id = "picture"> <?php echo "<img width='120' height ='130' src='show_picture.php?id={$userID}'>"; if ($loggedInUser != 0) { // Show the add friend link if this user is not the same user that is logged in if ($loggedInUser != $userID) { echo "<br /><div id = 'addfriend'><a href = 'user.php?userID={$userID}&addfriend=1'> Add Friend </a></div>"; } } ?> </div>
<?php require_once "../includes/session.php"; require_once "../includes/db_connection.php"; require_once "../includes/functions.php"; if (!isset($_SESSION["user_id"])) { set_error_output("Please log in to add friend. ", "log_in.php"); } else { if (!isset($_GET["user"])) { set_error_output("Invalid friend. ", "index.php"); } else { if ($_SESSION["user_id"] == $_GET["user"]) { set_error_output("Cannot add yourself to your own friends list. ", "index.php"); } else { if (already_friend($_SESSION["user_id"], $_GET["user"])) { set_error_output("That user is already on your friends list. ", "user.php?user="******"user"])); } } } } add_friend($_SESSION["user_id"], $_GET["user"]); redirect_to("user.php?user="******"user_id"]);
echo '<p>Todavía no he escrito nada, pronto lo actualizaré ;).</p>'; } else { echo '<p>' . get_usermeta($_GET['id'], 'user_info') . '</p>'; } ?> </div> <!-- This is an optional area for any extra data fields you may want to add. It shows up beneath the mobile/phone/fax numbers. --> <div class="optional-fields"> <h3 class="site-subtitle">Agregame a tu red de contactos</h3> <?php show_xfn_form($_GET['id']); ?> <?php if ($_POST['xfn_post'] == 'true') { add_friend(); } ?> <?php if ($_GET['elim']) { del_friend($userdata->ID, $_GET['elim']); } ?> </div> </div> <div class="extra"> <div class="notes"> <?php $primary_blog = get_usermeta($_GET['id'], "primary_blog");
function main() { if (!empty($_POST["type"])) { $type = $_POST["type"]; $sender = $_SESSION["name"]; if ($type == "message_send") { $ciphered_message = $_POST["cipher"]; $real_message = $_POST["message"]; $friend = $_POST["friend"]; send_friend($ciphered_message, $real_message, $friend, $sender); } else { if ($type == "message_load") { load_messages($sender); } else { if ($type == "inbox_load") { load_inbox($sender); } else { if ($type == "outbox_load") { load_outbox($sender); } else { if ($type == "message_read") { $ciphered_message = $_POST["cipher"]; $real_message = $_POST["message"]; $friend = $_POST["friend"]; // mark_message($ciphered_message, $real_message, $friend, $sender); } else { if ($type == "show_friends") { $sender = $_SESSION["name"]; show_friends($sender); } else { if ($type == "accept_friend_request") { $friend = $_POST["friend"]; // accept_friend_request($friend, $sender); } else { if ($type == "make_friend_request") { $friend = $_POST["friend"]; // make_friend_request($friend, $sender); } else { if ($type == "settings_load") { load_settings($sender); } else { if ($type == "settings_change") { $new_color = $_POST["new_color"]; change_settings($sender, $new_color); } else { if ($type == "add_friend") { $new_friend = $_POST["new_friend"]; add_friend($sender, $new_friend); } else { //redirect("index", "Oops! Post information wasn't passed."); } } } } } } } } } } } } }