Previous Thread
Next Thread
Print Thread
Rate Thread
Last Posted Viewable on ShowSide/Show Top
#315950 10/05/2007 7:46 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
I'd like to see if one of you super geniuses would know how to add a mod to my posts that show when the person last posted under their avatar.

It shows last posted in the CPanel so it keeps track somewhere, can that be harnessed and displayed for all users to see when they post.

Sponsored Links
Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315951 10/05/2007 7:57 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
Code

}

if ($lastpost) {
$lastpost = $html->convert_time($lastpost,$user['USER_TIME_OFFSET'], $user['USER_TIME_FORMAT']);
}

Is there somewhere to enter this?

Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315952 10/06/2007 1:22 AM
Joined: Jan 2000
Posts: 5,805
Likes: 10
UBB.Dev / UBB.Wiki Owner
Time Lord
Online Tapedshut
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,805
Likes: 10
I'd immagine so


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: Last Posted Viewable on ShowSide/Show Top
Gizmo #315953 10/06/2007 10:51 AM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
Well I know where I got it from, whats the right way to work the code into the postside so it doesn't wig everything out. Or is it just that straight code.

Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315954 10/06/2007 2:40 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
In /scripts/showflat.inc.php you should add that code, or something like it that would really work, put it in the posts show thingy array, and show that thingy in the smarty template.

As easy as counting 1,2,3 smile

Sponsored Links
Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315955 10/06/2007 3:17 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
Your speaking cow to a bird, huh? Heh *twitch*

So I can slip
Code

$query = "
SELECT NOTE_TEXT
FROM {$config['TABLE_PREFIX']}USER_NOTES
WHERE USER_ID = ?
";
$sth = $dbh -> do_placeholder_query($query,array($uid),__LINE__,__FILE__);
list($notes) = $dbh -> fetch_array($sth);
// Setup the default values

if ($lastpost) {
$lastpost = $html->convert_time($lastpost,$user['USER_TIME_OFFSET'], $user['USER_TIME_FORMAT']);
}

Somewhere near
Code

}
}
$postrow[$i]['Username'] = $Username;
$postrow[$i]['Title'] = $Title;
$postrow[$i]['CustomTitle'] = $CustomTitle;

if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
$postrow[$i]['IP'] = "($IP)";
}

elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
$postrow[$i]['IP'] = "($IP)";

On showflat.inc.php

...

But the rest of what your saying.. erg?

Last edited by AshtarRose; 10/06/2007 3:26 PM.
Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315956 10/06/2007 5:04 PM
Joined: Nov 2003
Posts: 482
Enthusiast
Offline
Enthusiast
Joined: Nov 2003
Posts: 482
um that's easy peasy..

if Yarp™ hasn't done it by later on today i can whip it up for you..

should be a 5 minute dealio

Re: Last Posted Viewable on ShowSide/Show Top
sirdude #315957 10/06/2007 5:11 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
In my head it seems like it should be super easy to do, I want people to know when someone made their last post and to me it almost seems like plugging code into a new spot. But its still intimidating.

Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315958 10/06/2007 5:21 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
I'll start the frying pan to cook things up smile

Where do you want it? Right under the avatar?

Last edited by blaaskaak; 10/06/2007 5:21 PM.
Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315959 10/06/2007 5:29 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
http://www.riddledindarkness.com/hp...flat&Number=537264&Main=17197#Post537264

I want to be able to slip it under Posts:

Posts:
Last Posted:


he board revolves around activity, if their posting somewhere on the board then I'd like it to be known their active even if they've not responded to a thread they've started.

Sponsored Links
Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315960 10/06/2007 5:31 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
I just had a looksy, and it is pretty easy to do, but it will put an extra serverload to your forum because we have to join in a 4th table (ubbt_USER_DATA) to the main query of showflat.inc.php which will make the query run longer. How much the impact really is, I don't know smile

It's not just showing some field that's there anyway but not shown.

Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315961 10/06/2007 6:06 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Registered: 08/29/07
Posts: 2
01/01/70 01:00 AM

bleh... fix fix fix...

edit: fixed smile

Last edited by blaaskaak; 10/06/2007 6:15 PM.
Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315962 10/06/2007 6:25 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
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.

Re: Last Posted Viewable on ShowSide/Show Top
blaaskaak #315963 10/06/2007 9:05 PM
Joined: Sep 2005
Posts: 136
Journeyman
OP Offline
Journeyman
Joined: Sep 2005
Posts: 136
Hack Working! Kick Ass! There is no excuse to abandon a thread if someone can clearly see wether you are active or not.

Re: Last Posted Viewable on ShowSide/Show Top
AshtarRose #315969 10/07/2007 3:22 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Heck, there's even a last visit field where the actual last time of visit is kept in if you want to take it further.

If you would want that, change in replace #1 t4.USER_LAST_POST_TIME by t4.USER_LAST_VISIT_TIME

And change the text ofcourse.


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
Pilgrim
Pilgrim
NH, USA
Posts: 190
Joined: June 2000
Forum Statistics
Forums63
Topics37,543
Posts293,773
Members13,838
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 339
Topics Created 0
Posts Made 1
Users Online 3
Birthdays 28
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,805
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 9
isaac 8
driv 2
temp 2
Morgan 1
Top Likes Received
isaac 38
Gizmo 10
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 4
Gizmo 2
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200524.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.060s Queries: 45 (0.027s) Memory: 3.3755 MB (Peak: 3.6269 MB) Data Comp: Zlib Server Time: 2020-05-29 00:21:20 UTC
Valid HTML 5 and Valid CSS