function updatePrivacySettings($data, $user_id) { global $db_con; $privacy = getPrivacySettings($user_id); if (empty($privacy)) { $q = 'INSERT INTO `privacy_settings` (`user_id`, `selected_option`, `limit_activity`, `router_available`) VALUES( ' . $user_id . ', ' . $data['privacy_type'] . ', ' . $data['limit_authority'] . ', ' . $data['router_available'] . ')'; } else { $q = 'UPDATE `privacy_settings` SET `selected_option` = ' . $data['privacy_type'] . ', `limit_activity` = ' . $data['limit_authority'] . ', `router_available` = ' . $data['router_available'] . ' WHERE `user_id` = ' . $user_id; } $db_con->query($q); }
<?php include 'includes/header.php'; require_once DIR_APP . 'projects.php'; require_once DIR_APP . 'users.php'; if (empty($_SESSION['logged_in'])) { redirect('index.php'); } if (isset($_POST['save_privacy'])) { updatePrivacySettings($_POST, $_SESSION['uid']); } $privacy = getPrivacySettings($_SESSION['uid']); ?> <div class="inner-page-wrapper"> <div class="privacy inner-page content"> <?php include DIR_INCLUDE . 'left_nav.php'; ?> <div class="main-content"> <ul class="router-top-nav"> <li><a href="account.php">Account</a></li> <li class="active"><a href="privacy.php">Privacy</a></li> <li><a href="payment.php">Payment</a></li> <li><a href="report.php">Report</a></li> <li class="logout"><a href="logout.php">Logout</a></li>
<div class="content-block"> <div class="content-title"><?php echo $user['display_name']; ?> <?php if ($user['verified'] == True) { ?> <img src="images/4.png" title="Verified." "><?php } ?> <div class="add-router"> <?php if (!$own_profile) { $privacy = getPrivacySettings($uid); $router_settings = $privacy['router_available']; $status = checkRouter($uid, $_SESSION['uid']); if ($status == -1) { if (!empty($options_settings)) { ?> <?php if ($router_settings == '1') { ?> <?php if ($_GET['uid'] != $_SESSION['uid']) { ?> <a href="<?php echo SITE_URL; ?> /user.php?action=add_router&uid=<?php
<?php include_once 'config.php'; include_once 'app/projects.php'; include_once 'app/users.php'; if ($_GET['uid']) { $user_id = $_GET['uid']; } else { $user_id = $_SESSION['uid']; } $interactions = getInteractions($user_id); $privacy = getPrivacySettings($user_id); $option_settings = $privacy['selected_option']; $limit_settings = $privacy['limit_activity']; if ($interactions) { foreach ($interactions as $i) { $timestamp = $i['created_on']; $user = getUserNameById($i['created_by']); $author = getUserNameById($i['author']); if ($i['type'] == 'ideathread') { $title = getIdeaTitle($i['id']); $url = SITE_URL . '/home.php?iid=' . $i['id']; } if ($i['type'] == 'project') { $title = getProjectTitle($i['id']); $url = SITE_URL . '/home.php?pid=' . $i['id']; } if ($i['action'] == 'like') { $action = 'liked'; $icon_image = SITE_URL . '/images/icons/like.png'; }