Sponsored Content
Top Forums Web Development MySQL Query to Build Mockup Vue.js UserCP Timeline Page Post 303031199 by Neo on Saturday 23rd of February 2019 11:08:32 AM
Old 02-23-2019
And so the current PHP file (working well in testing) is:

Code:
<?php
header("Content-Type: application/json");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, OPTIONS");
require_once('/var/www/global.php');
$timeline = "select thread.threadid, post.userid, post.username, thread.title, post.dateline,post.postid, thread.firstpostid from thread inner join post ON post.threadid = thread.threadid  order by dateline desc limit 100";

$results = $vbulletin->db->query_read($timeline);
while ($item = $db->fetch_array($results)) {
    if($item['postid'] == $item['firstpostid'])
    {
    $item['title'] =  $item['username'].' started discussion '.$item['title'];
    }
    else{
    $item['title'] =  $item['username'].' replied to '.$item['title'];
    }
    $item['when'] =  date("D M j G:i:s T Y", $item['dateline']); 
    $final[] = $item;

}

$serialize = json_encode($final);
echo  $serialize;

I will update the new build with working timeline next Smilie

Edit: Done!

https://www.unix.com/web-programming...-new-post.html
 

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Promotion! Like Our New Facebook Timeline Page for 10,000 Bits!

Hey! We have started a new Forum HQ Facebook "Timeline" page where we plan to create a unix/linux timeline with major milestones for unix/linux, company start up dates for major releases, etc. We are just getting started, so I would like to personally invite you to visit and "Like" our new... (10 Replies)
Discussion started by: Neo
10 Replies

2. Web Development

Vue.js UserCP Mockup Version 0.20 - Badge Notifications

Vue.js UserCP Mockup Version 0.20 - Badge Notifications https://www.unix.com/cp/index.php#/dashboardIn this mockup release: Badge Notifications are working with live data: Upper Right (see image) Added Axios to Vue and changed large table updates to axios (ajax) Note: Will reformat... (2 Replies)
Discussion started by: Neo
2 Replies

3. Web Development

New Discussion Timeline in Vue.js UserCP Mockup

Well, thanks to the amazing power of Vue.js, we now have a new timeline in version 0.23 of the UserCP Mockup: Wow! I'm really impressed with Vue.js. https://www.unix.com/cp/index.php#/pages/timeline In this version: Created database, and PHP model for the remote AJAX (Axios) call to... (1 Reply)
Discussion started by: Neo
1 Replies

4. Web Development

New Badge Timeline in Vue.js UserCP Mockup

Continuing to think Vue.js is AWESOME, we now have a new badges timeline in version 0.26 of the UserCP Mockup: https://www.unix.com/cp/index.php#/pages/badges Changes: Added Mockup from Badges timeline. Changed notifications (upper right) to use v-for: bindings. Fixes minor vue routing... (0 Replies)
Discussion started by: Neo
0 Replies

5. What is on Your Mind?

My Charts in the Prototype Vue.js UserCP

Yea.... something I thought would take me an hour ended up taking most of the day. Well, it's not like those YT video tutorials where it take a week or more to make a video and the guys (gals) make it look so easy. But having said that, I'm happy to share with forum members the first "My... (6 Replies)
Discussion started by: Neo
6 Replies

6. Web Development

Simple Vue.js Component to Redirect to External Web Page Using Vue Router

Vue Router has some quirks and on of the quirks is that it is not reliable when adding external links using the vue-router library. After struggling with many solutions, I have found that creating a simple Vue.js component like this one seems to work the best (so far): Component Example: ... (0 Replies)
Discussion started by: Neo
0 Replies

7. What is on Your Mind?

New UserCP Update Profile Image Page (UserCP Screeching Frog 0.7485)

Update! UserCP Screeching Frog 0.7485 Created a new page for uploaded a profile picture (profile pictures are different than avatar pictures). https://www.unix.com/usercp/#/settings/other https://www.unix.com/members/1-albums225-picture1158.png ... (0 Replies)
Discussion started by: Neo
0 Replies

8. What is on Your Mind?

UserCP Screeching Frog 0.7446 Using Vue.js

Here is a status update on the new forum usercp. The current version of the new UserCP is Screeching Frog v0.7446. Most users will need to clear the files from your browser cache, quit and restart your browser to see the new version (check bottom of the page for version). Safari seems to... (9 Replies)
Discussion started by: Neo
9 Replies

9. What is on Your Mind?

Video Overview of the Vue.js UserCP @UNIX.com

Here is my second live video screencast (in my life, using Camtasia) with voice for the new usercp: Overview of the Vue.js UserCP @UNIX.com Shout outs to Don Cragun, Corona688, Rudi, Wolf, Made in Germany, stomp, Ravinder, Creative Tim, PubNub and others in the video. Thanks. If you are... (1 Reply)
Discussion started by: Neo
1 Replies
PHP_CHECK_SYNTAX(3)							 1						       PHP_CHECK_SYNTAX(3)

php_check_syntax - Check the PHP syntax of (and execute) the specified file

SYNOPSIS
bool php_check_syntax (string $filename, [string &$error_message]) DESCRIPTION
Performs a syntax (lint) check on the specified $filename testing for scripting errors. This is similar to using php -l from the commandline except that this function will execute (but not output) the checked $filename. For example, if a function is defined in $filename, this defined function will be available to the file that executed php_check_syntax(3), but output from $filename will be suppressed. Note For technical reasons, this function is deprecated and removed from PHP. Instead, use php -l somefile.php from the commandline. PARAMETERS
o $filename - The name of the file being checked. o $error_message - If the $error_message parameter is used, it will contain the error message generated by the syntax check. $error_message is passed by reference. RETURN VALUES
Returns TRUE if the lint check passed, and FALSE if the link check failed or if $filename cannot be opened. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.0.5 | | | | | | | This function was removed from PHP. | | | | | 5.0.3 | | | | | | | Calling exit(3) after php_check_syntax(3) | | | resulted in a Segfault. | | | | | 5.0.1 | | | | | | | $error_message is passed by reference. | | | | +--------+---------------------------------------------------+ EXAMPLES
php -l somefile.php The above example will output something similar to: PHP Parse error: unexpected T_STRING in /tmp/somefile.php on line 81 SEE ALSO
include(3), is_readable(3). PHP Documentation Group PHP_CHECK_SYNTAX(3)
All times are GMT -4. The time now is 03:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy