Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
Done! SD can take the time to finished up sunday evenings zip smile

in /scripts/showflat.inc.php there's a line with
Code
	// This is the main query that will be used

Replace the beautifull query below it with this one:
Code
	$query = "
SELECT t1.POST_ID,t2.USER_DISPLAY_NAME,t1.POST_POSTED_TIME,t1.POST_POSTER_IP,t1.POST_SUBJECT,t1.POST_BODY,t1.POST_IS_APPROVED,t3.USER_AVATAR,t3.USER_TITLE,t3.USER_CUSTOM_TITLE,t3.USER_NAME_COLOR,t1.POST_ICON,t1.POST_HAS_POLL,t1.POST_HAS_FILE,t1.POST_PARENT_ID,t2.USER_MEMBERSHIP_LEVEL,t3.USER_SIGNATURE,t1.POST_LAST_EDITED_TIME,t1.POST_LAST_EDIT_REASON,t1.POST_LAST_EDITED_BY,t3.USER_LOCATION,t3.USER_TOTAL_POSTS,t2.USER_REGISTERED_ON,t3.USER_RATING,t3.USER_AVATAR_WIDTH,t3.USER_AVATAR_HEIGHT,t2.USER_ID,t1.POST_PARENT_USER_ID,t3.USER_BIRTHDAY,t3.USER_PUBLIC_BIRTHDAY,t1.POST_ADD_SIGNATURE,t3.USER_ACCEPT_PM,t3.USER_HOMEPAGE,t3.USER_VISIBLE_ONLINE_STATUS,t3.USER_MOOD,t1.POST_POSTER_NAME,t4.USER_LAST_POST_TIME
FROM {$config['TABLE_PREFIX']}POSTS AS t1,
{$config['TABLE_PREFIX']}USERS AS t2,
{$config['TABLE_PREFIX']}USER_PROFILE as t3,
{$config['TABLE_PREFIX']}USER_DATA as t4
WHERE t1.PREG_QUERY_FIELD = ?
AND t1.USER_ID = t2.USER_ID
AND t1.USER_ID = t3.USER_ID
AND t1.USER_ID = t4.USER_ID
$Viewable
ORDER BY POST_ID
";

Find:
Code
		list ($Number,$Username,$Posted,$IP,$Subject,$Body,$Approved,$Picture,$Title,$CustomTitle,$Color,$Icon,$Poll,$Files,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditReason,$LastEditBy,$Location,$TotalPosts,$Registered,$stars,$picwidth,$picheight,$usernum,$ParentUser,$bday,$showbday,$addsig,$accept_pm,$homepage,$visible,$mood,$postername) = $results[$i];

Replace with
Code

list ($Number,$Username,$Posted,$IP,$Subject,$Body,$Approved,$Picture,$Title,$CustomTitle,$Color,$Icon,$Poll,$Files,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditReason,$LastEditBy,$Location,$TotalPosts,$Registered,$stars,$picwidth,$picheight,$usernum,$ParentUser,$bday,$showbday,$addsig,$accept_pm,$homepage,$visible,$mood,$postername,$userlastpost) = $results[$i];



Find
Code
		$PrintLastEdit = "";

Add below:
Code

if ($userlastpost) {
$userlastpost = $html -> convert_time($userlastpost,$useroffset,$user['USER_TIME_FORMAT']);
}
$postrow[$i]['userlastpost'] = "Last post: $userlastpost";

in /templates/default/post_side.tpl
find
Code
{$postrow[post].TotalPosts}

add below:
Code
{if $postrow[post].userlastpost}
<br />
{$postrow[post].userlastpost}
{/if}

Replace #1 adjusts the query so that the lastpost time is available in the query.

Replace #2 makes sure the output of that new field is available for the script

Replace #3 Formats the data and makes it available for the template.

Replace #4 just adds it to the template.

I am pretty sure you can do what you need to do for post_top.

Enjoy! And if there something wrong, let me know. I probably spend only 10 seconds after I thought it was finished.

Sponsored Links
Entire Thread
Subject Posted By Posted
Last Posted Viewable on ShowSide/Show Top AshtarRose 10/06/2007 2:46 AM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/06/2007 2:57 AM
Re: Last Posted Viewable on ShowSide/Show Top Gizmo 10/06/2007 8:22 AM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/06/2007 5:51 PM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/06/2007 9:40 PM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/06/2007 10:17 PM
Re: Last Posted Viewable on ShowSide/Show Top sirdude 10/07/2007 12:04 AM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/07/2007 12:11 AM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/07/2007 12:21 AM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/07/2007 12:29 AM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/07/2007 12:31 AM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/07/2007 1:06 AM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/07/2007 1:25 AM
Re: Last Posted Viewable on ShowSide/Show Top AshtarRose 10/07/2007 4:05 AM
Re: Last Posted Viewable on ShowSide/Show Top blaaskaak 10/07/2007 10:22 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)