|
Joined: Sep 2005
Posts: 136
Journeyman
|
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.
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
Journeyman
Joined: Sep 2005
Posts: 136 |
}
if ($lastpost) { $lastpost = $html->convert_time($lastpost,$user['USER_TIME_OFFSET'], $user['USER_TIME_FORMAT']); }
Is there somewhere to enter this?
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
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.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
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 
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
Journeyman
Joined: Sep 2005
Posts: 136 |
Your speaking cow to a bird, huh? Heh *twitch* So I can slip $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 } } $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.
|
|
|
|
Joined: Nov 2003
Posts: 482
Enthusiast
|
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
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
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.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
I'll start the frying pan to cook things up  Where do you want it? Right under the avatar?
Last edited by blaaskaak; 10/06/2007 5:21 PM.
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
Journeyman
Joined: Sep 2005
Posts: 136 |
http://www.riddledindarkness.com/hp...flat&Number=537264&Main=17197#Post537264I 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.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
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  It's not just showing some field that's there anyway but not shown.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
Registered: 08/29/07 Posts: 2 01/01/70 01:00 AM bleh... fix fix fix... edit: fixed 
Last edited by blaaskaak; 10/06/2007 6:15 PM.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
Yarp™
Joined: Feb 2007
Posts: 329 |
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.
|
|
|
|
Joined: Sep 2005
Posts: 136
Journeyman
|
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.
|
|
|
|
Joined: Feb 2007
Posts: 329
Yarp™
|
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.
|
|
|
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.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|