 |
 |
 |
 |
#315952 - 10/06/07 01:22 AM
Re: Last Posted Viewable on ShowSide/Show Top
[Re: AshtarRose]
|
Wizard
Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#315962 - 10/06/07 06:25 PM
Re: Last Posted Viewable on ShowSide/Show Top
[Re: blaaskaak]
|
Enthusiast
Registered: 02/25/07
Posts: 329
Loc: The Netherlands
|
Done! SD can take the time to finished up sunday evenings zip  in /scripts/showflat.inc.php there's a line with // This is the main query that will be used Replace the beautifull query below it with this one: $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: 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
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 Add below:
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 {$postrow[post].TotalPosts}add below: {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.
_________________________
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|