예제 #1
0
파일: load.php 프로젝트: Jluct/blog
session_start();
header('Content-Type: text/html; charset= utf-8');
$clientData = json_decode(trim(file_get_contents('php://input')), true);
$userData = $clientData['data'];
//echo json_encode($_SESSION[0]);
switch ($clientData["target"]) {
    case 'menu':
        include_once 'data/get/getMenu.php';
        echo json_encode(getMenu::getDataMenu());
        break;
    case 'news':
        include_once 'data/get/getArticle.php';
        echo json_encode(getArticle::getDataArticle());
        break;
    case 'comment':
        include_once 'data/get/getComment.php';
        echo json_encode(getComment::getDataComment($userData));
        break;
    case 'addComment':
        include_once 'data/set/addComment.php';
        echo json_encode(addComment::addDataComment($userData));
        break;
    case 'authorization':
        include_once 'core/data/session/openSession.php';
        echo json_encode(openSession::openSession1($userData));
        break;
    case 'getSession':
        include_once 'core/data/session/getSession.php';
        echo json_encode(userInfo::sessionInfo());
}
 public function storeShippingInformation(Request $request)
 {
     $this->validate($request, ['firstname' => 'required', 'lastname' => 'required', 'phone' => 'required', 'address' => 'required', 'city' => 'required', 'country' => 'required']);
     Session::put('shipping', $request->except('_token'));
     $userInfo = userInfo::where('user_id', Auth::user()->id);
     $userInfo->update(['firstname' => $request->firstname, 'lastname' => $request->lastname, 'address' => $request->address, 'city' => $request->city, 'country' => $request->country, 'zipcode' => $request->zipcode]);
     helperFunctions::getPageInfo($sections, $cart, $total);
     $publishable_key = Payment::first()->stripe_publishable_key;
     return view('site.payment', compact('sections', 'total', 'cart', 'publishable_key'));
 }
예제 #3
0
<?php

$followerList = $userInfo->followerList;
$followerCount = count($followerList);
if ($followerCount > 0) {
    $followerBlock = '';
    foreach ($followerList as $followerUser) {
        $followerSearch = new userInfo();
        $followerSearch->userMeta($followerUser);
        if (isset($followerSearch->user_first_name)) {
            $follower_first_name = $followerSearch->user_first_name;
        } else {
            $follower_first_name = '';
        }
        if (isset($followerSearch->user_last_name)) {
            $follower_last_name = $followerSearch->user_last_name;
        } else {
            $follower_last_name = '';
        }
        $followerBlock .= '<li><a href="/profile.php?user='******'">';
        if (isset($followerSearch->user_avatar)) {
            $followerAvatar = $followerSearch->user_avatar;
            $followerBlock .= '<img src="' . $followerSearch->user_avatar . '" alt="' . $follower_first_name . ' ' . $follower_last_name . '" class="img-circle img-responsive" />';
        } else {
            $gravatar_hash = $followerSearch->follow_email_hash;
            $followerAvatar = '//www.gravatar.com/avatar/' . $gravatar_hash . '?s=60&d=' . urlencode('http://comicmanager.com/assets/avatar-deadpool.png');
            $followerBlock .= '<img src="' . $followerAvatar . '" alt="' . $follower_first_name . ' ' . $follower_last_name . '" class="img-circle img-responsive" />';
        }
        $followerBlock .= '</a></li>';
    }
} else {
예제 #4
0
파일: feed.php 프로젝트: asanchez78/comicdb
<?php

$userInfo = new userInfo();
$userInfo->userMeta($userID);
$followList = preg_replace('/}{/', ',', $userInfo->user_follows);
$followList = substr($followList, 1, -1);
$feedLength = 150;
$userInfo->showFeed($followList, $feedLength);
?>
<section data-module="feed">
  <ul class="nolist user-feed-container">
    <?php 
echo $userInfo->feed;
?>
  </ul>
</section>
예제 #5
0
<?php

require_once 'views/head.php';
$profile_name = filter_input(INPUT_GET, 'user');
$comic = new comicSearch();
$user = new userInfo();
if (isset($profile_name) && $profile_name != '') {
    $user->userLookup($profile_name);
    $profileID = $user->browse_user_id;
    $profileEmail = $user->browse_user_email_hash;
} else {
    $profileID = $userID;
    $profileEmail = $userEmail;
}
// Grab all fields from users_meta for the user ID
$user->userMeta($profileID);
if (isset($user->user_first_name)) {
    $first_name = $user->user_first_name;
} else {
    $first_name = '';
}
if (isset($user->user_last_name)) {
    $last_name = $user->user_last_name;
} else {
    $last_name = '';
}
if ($first_name === '' && $last_name === '') {
    if (isset($profile_name) && $profile_name != '') {
        $first_name = $profile_name;
    } else {
        $first_name = $userName;
예제 #6
0
<?php

$carouselIssues = new userInfo();
$carouselSlides = 5;
$carouselIssues->carouselComics($userID, $carouselSlides);
?>

<div data-module="carousel_bar">
  <div class="row">
    <h3 class="text-center">Comic Spotlight</h3>
    <div id="carousel_bar_carousel" class="carousel slide" data-ride="carousel">
      <!-- Wrapper for slides -->
      <div class="carousel-inner" role="listbox">
        <?php 
echo $carouselIssues->carousel_list;
?>
      </div>

      <!-- Controls -->
      <a class="left carousel-control" href="#carousel_bar_carousel" role="button" data-slide="prev">
        <span aria-hidden="true"><i class="fa fa-fw fa-chevron-left"></i></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="right carousel-control" href="#carousel_bar_carousel" role="button" data-slide="next">
        <span aria-hidden="true"><i class="fa fa-fw fa-chevron-right"></i></span>
        <span class="sr-only">Next</span>
      </a>
    </div>
  </div>
</div>
예제 #7
0
<?php

$followers = new userInfo();
$followers->userMeta($userID);
// Checks to see if the user is already following the profile
if (isset($followers->user_follows)) {
    $followList = preg_split('/\\D/', $followers->user_follows, NULL, PREG_SPLIT_NO_EMPTY);
    foreach ($followList as $followUser) {
        if ($followUser == $profileID) {
            $userFollowing = true;
        }
    }
}
?>
<div data-module="follow_button">
  <form method="post" name="follow_form" action="">
    <input type="hidden" name="profile_id" value="<?php 
echo $profileID;
?>
" />
    <input type="hidden" name="user_id" value="<?php 
echo $userID;
?>
" />
    <?php 
if (isset($userFollowing)) {
    if ($userFollowing == true) {
        ?>
        <input type="hidden" name="followed" value="false" />
        <button class="btn btn-sm btn-default" type="submit"><i class="fa fa-fw fa-user-times"></i> <span class="hidden-xs hidden-sm">Unfollow</span></button>
      <?php 
예제 #8
0
<div id="topheader" class="spacing">
<?php 
if (!empty($_SESSION['log'])) {
    $id = $_SESSION['log'];
    $user = new userInfo($id);
    ?>
<div id="whoami" >
  <p >Ingelogd als: <strong><?php 
    echo $user->getUser();
    ?>
</strong>
    <span class="line-spacer"><span class="line-spacer">|</span></span>  <a href="/user/logout/">Uitloggen</a>
  </p>
</div>
<?php 
}
?>

</div>

<!-- container -->
<div class="container">

  <!-- header -->
  <div class="header">
    <!-- logo -->
    <div class="logo">
      <a href=""><img src="/res/images/logo.png"></a>
    </div><!-- /logo -->
예제 #9
0
<?php

if (isset($userInfo->user_follows)) {
    $followBlock = '';
    $followList = preg_split('/\\D/', $userInfo->user_follows, NULL, PREG_SPLIT_NO_EMPTY);
    $followCount = count($followList);
    foreach ($followList as $followUser) {
        $followSearch = new userInfo();
        $followSearch->userFollows($followUser);
        $followSearch->userMeta($followUser);
        if (isset($followSearch->user_first_name)) {
            $follow_first_name = $followSearch->user_first_name;
        } else {
            $follow_first_name = '';
        }
        if (isset($followSearch->user_last_name)) {
            $follow_last_name = $followSearch->user_last_name;
        } else {
            $follow_last_name = '';
        }
        $followBlock .= '<li><a href="/profile.php?user='******'">';
        if (isset($followSearch->user_avatar)) {
            $followAvatar = $followSearch->user_avatar;
            $followBlock .= '<img src="' . $followSearch->user_avatar . '" alt="' . $follow_first_name . ' ' . $follow_last_name . '" class="img-circle img-responsive" />';
        } else {
            $gravatar_hash = $followSearch->follow_email_hash;
            $followAvatar = '//www.gravatar.com/avatar/' . $gravatar_hash . '?s=60&d=' . urlencode('http://comicmanager.com/assets/avatar-deadpool.png');
            $followBlock .= '<img src="' . $followAvatar . '" alt="' . $follow_first_name . ' ' . $follow_last_name . '" class="img-circle img-responsive" />';
        }
        $followBlock .= '</a></li>';
    }
예제 #10
0
<?php

$userInfo = new userInfo();
$userInfo->userMeta($userID);
if (isset($userInfo->user_first_name)) {
    $first_name = $userInfo->user_first_name;
} else {
    $first_name = $userName;
}
if (isset($userInfo->user_avatar)) {
    $avatar = $userInfo->user_avatar;
} else {
    $gravatar_hash = $userEmail;
    $avatar = '//www.gravatar.com/avatar/' . $gravatar_hash . '?s=200&d=' . urlencode('http://comicmanager.com/assets/avatar-deadpool.png');
}
?>
<div data-module="user_bar">
  <div class="row">
    <div class="col-xs-6">
      <h2>Dashboard</h2>
    </div>
    <div class="hidden-xs hidden-sm col-md-3 col-lg-2 dropdown">
      <button id="addDropdown" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" >
        <span class="hidden-xs hidden-sm">Add New</span>
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu" aria-labelledby="dLabel">
        <li><a href="/add.php#addSingle">Issue</a></li>
        <li><a href="/add.php#addRange">Range of Issues</a></li>
        <li><a href="/add.php#addList">List of Issues</a></li>
        <li><a href="/add.php#addSeries">Series</a></li>
예제 #11
0
<?php

require_once 'views/head.php';
$issue_list = null;
$series_id = filter_input(INPUT_GET, 'series_id');
$profile_name = filter_input(INPUT_GET, 'user');
$comic = new comicSearch();
$user = new userInfo();
if (isset($profile_name) && $profile_name != '') {
    $user->userLookup($profile_name);
    $profileID = $user->browse_user_id;
} else {
    $profileID = $userID;
}
$comic->seriesInfo($series_id, $profileID);
$comic->issuesList($series_id, $profileID);
$publisherID = $comic->publisherID;
$publisherName = $comic->publisherName;
$publisherShort = $comic->publisherShort;
$series_name = $comic->series_name;
$series_vol = $comic->series_vol;
$issue_num = $comic->issue_number;
?>
  <title><?php 
echo $series_name;
?>
 (Vol <?php 
echo $series_vol;
?>
) :: POW! Comic Book Manager</title>
</head>
예제 #12
0
<?php

// This local function will do the brunt of the work for us, so all we have to do is pass in a few variables to it.
$followUser = function ($profile_id, $user_id, $toggle) {
    $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    $fieldCheck = new userInfo();
    // Let's grab the users's current follow list to compare.
    $fieldCheck->userMeta($user_id);
    if (isset($fieldCheck->user_follows)) {
        // Split the list string into an array
        $followList = preg_split('/\\D/', $fieldCheck->user_follows, NULL, PREG_SPLIT_NO_EMPTY);
        $followCount = count($followList);
    } else {
        $followCount = 0;
    }
    // Follow / Unfollow
    if ($toggle == 'true') {
        // Follow the user
        if (isset($fieldCheck->user_follows)) {
            $sql = "UPDATE users_meta\n          SET meta_value = CONCAT_WS('', meta_value, '{{$profile_id}}') \n          WHERE meta_key='user_follows' AND user_id='{$user_id}'";
        } else {
            $sql = "INSERT INTO users_meta (user_id, meta_key, meta_value) \n          VALUES ('{$user_id}', 'user_follows', '{{$profile_id}}')";
        }
    } else {
        // Unfollow the user
        if ($followCount > 1) {
            $sql = "UPDATE users_meta \n          SET meta_value=REPLACE(meta_value,'{{$profile_id}}','') \n          WHERE meta_key='user_follows' \n          AND user_id='{$user_id}'";
        } else {
            // Is this the only user? Remove the key.
            $sql = "DELETE FROM users_meta \n          WHERE meta_key='user_follows' \n          AND user_id='{$user_id}'";
        }