本文整理汇总了PHP中Blog::getPostsByUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::getPostsByUser方法的具体用法?PHP Blog::getPostsByUser怎么用?PHP Blog::getPostsByUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::getPostsByUser方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Blog
<?php
// var_dump($_GET);
include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
$config = new Blog();
?>
<form class="attach-post-to-promotions-form">
<select name="files_to_attach" class="form-control" multiple style="height:450px;">
<?php
$posts = $config->getPostsByUser(0, 100, Session::get('user_name'));
foreach ($posts as $key => $value) {
echo '<option value="' . $value['id'] . '">' . $value['blogtitle'] . ' - ' . $value['twitter'] . '</option>';
}
?>
</select>
<button class="btn btn-block btn-primary">Attach To Promo</button>
</form>
<script type="text/javascript">
$(function(){
$('.attach-post-to-promotions-form').submit(function(event){
event.preventDefault();
data = $(this).serializeArray();
console.log(data);
var path = 'http://freelabel.net/users/dashboard/attach_files_to_promo/';
var element = $(this).parent();
$.post(path, {
promo_id: <?php
echo $_GET['promo_id'];
?>
,
示例2: Blog
<?php
include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
require ROOT . 'inc/conn.php';
$config = new Blog();
$current_page = 0;
$site = $config->getSiteData($config->site);
$site['media']['photos'] = $config->getPhotoAds($site['creator'], 'current-promo', 1);
$todays_date = date('Y-m-d');
$result = $conn->query('select * from twitter_data WHERE timestamp LIKE "%' . $todays_date . '%" ORDER BY `id` DESC');
$numb_soms_sent = count($result->fetchAll());
$leads_conversion = new Config();
/* DETECT HOW MANY POSTS CREATED TODAY */
$posted_today = null;
$tp = $config->getPostsByUser(0, 1, 'admin');
foreach ($tp as $post) {
$post_date = date('m-d', strtotime($post['submission_date']));
$todays_date2 = date('m-d');
if ($post_date === $todays_date2) {
$posted_today = true;
}
}
if ($posted_today === true) {
$status[] = '<span class="text-success">BLOGS POSTED TODAY!</span>';
} else {
$status[] = '<span class="text-danger">NOT POSTED TODAY!</span>';
}
/* DETECT HOW MANY PROMOS POSTED TO DAY */
$posted_today = null;
$tpr = $config->getPromosByUser('admin', 0);
// $config->debug($tpr,1);
示例3: Blog
<?php
include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
$config = new Blog();
if (isset($_GET)) {
$current_page = $_GET['page'];
$next_page = $current_page + 1;
$user['media']['feed'] = $config->getPostsByUser($current_page, 20, $_GET['user_name']);
} else {
echo $data = '';
}
// echo "<pre>";
// var_dump($_GET);
// exit;
$count = count($user['media']['feed']);
/* current load is set at 24 max increments */
/* CREATE EVENTS STACKS */
if ($count > 0) {
echo '
<h2 class="stack-title"><a href="#" data-text="Uploads"><span>Uploads</span></a></h2>';
// print_r($user['media']['video']);
// ------------------ DISPLAY PHOTOS --------------------------- //
$i = 0;
foreach ($user['media']['feed'] as $key => $photo) {
$photo['twitter'] = trim($photo['twitter']);
if (strpos($photo['twitter'], '@') === false) {
$photo['twitter'] = '@' . $photo['twitter'];
}
$i++;
$url = 'http://freelabel.net/' . $photo['twitter'] . '/t/' . $photo['id'];
// detect file type for preview
示例4: Blog
<?php
include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
$user_name = Session::get('user_name');
$config = new Blog();
$s = $config->getStatsByUser($user_name);
$stats = $s['count'];
$tracks = $config->getPostsByUser(0, 300, $user_name);
$events = $config->getEventsByUser($user_name, 500);
$promos = $config->getPromosByUser(Session::get('user_name'), 300);
$num_tracks = count($tracks);
$num_events = count($events);
$num_promos = count($promos);
if ($num_tracks == '300') {
$num_tracks = $num_tracks . "+";
}
// earnings calculator
$score = 0.001 * $stats * 0.001 * $num_tracks;
$photo = $config->getProfilePhoto($user_name);
$user = $config->getUserData($user_name);
if (isset($tracks)) {
foreach ($tracks as $key => $value) {
$post_date = date('m-d', strtotime($value['submission_date']));
$todays_date = date('m-d');
$yesterdays_date = date('m-d', '-1 day');
$two_days_ago = date('m-d', strtotime('-2 days', time()));
$three_days_ago = date('m-d', strtotime('-3 days', time()));
if ($post_date == $todays_date) {
$today[] = $value['blogtitle'];
} elseif ($post_date == $yesterdays_date) {
$yesterday[] = $value['blogtitle'];
示例5: Blog
exit;
} else {
$uid = $user_name = $_GET['uid'];
}
include_once '/kunden/homepages/0/d643120834/htdocs/config/index.php';
$config = new Blog();
include_once ROOT . 'inc/huge.php';
$result = mysqli_query($con, "SELECT * \nFROM `users` \nWHERE `user_name` LIKE '%" . $uid . "%'\nLIMIT 1");
while ($row = mysqli_fetch_assoc($result)) {
$user['settings'] = $row;
include_once ROOT . 'inc/connection.php';
$result = mysqli_query($con, "SELECT * FROM `user_profiles` WHERE `id` = '" . $uid . "' LIMIT 1");
if ($row = mysqli_fetch_assoc($result)) {
// echo 'found!';
$user['profile'] = $row;
$user['media']['feed'] = $config->getPostsByUser(0, 24, $_GET['uid']);
//print_r($user);
} else {
echo 'Not Found';
}
}
/* GET USER PROFILE DATA */
$user['profile'] = $config->getUserData($uid);
$meta_tag_photo = str_replace(' ', '%20', $row['image']);
include_once ROOT . 'inc/connection.php';
$result = mysqli_query($con, "SELECT * FROM `images` WHERE `user_name` = '" . $_GET['uid'] . "' AND `type` NOT LIKE '%private%' ORDER BY `id` DESC LIMIT 10");
$i = 0;
while ($row = mysqli_fetch_assoc($result)) {
$todays_date = date('Ymd_H:i');
$id = $row['id'];
$title = $row['title'];
示例6:
top:180px;
left:50vw;
}
.slideshow figure {
background-color:#202020;
border-color:#202020;
}
</style>
</header>
<div id="grid-gallery" class="grid-gallery">
<section class="grid-wrap">
<ul class="grid">
<li class="grid-sizer"></li><!-- for Masonry column width -->
<?php
$posts = $config->getPostsByUser(0, 16, 'admin');
foreach ($posts as $post) {
echo '<li>
<figure>
<img src="' . $post['photo'] . '" alt="img01"/>
<figcaption><h3>' . $post['blogtitle'] . '</h3><p>' . $post['twitter'] . '</p></figcaption>
</figure>
</li>';
}
?>
</ul>
</section><!-- // grid-wrap -->
<section class="slideshow">
<ul>
<?php