View Full Version : Help with a small snippet of code?
Sarge
08-17-2001, 03:08 PM
I want the last posttime and date under the avatar when someone posts
I added $lastonline_time $lastonline_date like it shows in get_info to the postbit template but it didn't show up like it does in the profile
Any suggestions on how to make this work?
BradC
08-17-2001, 03:23 PM
well cause the 2 variables that you added to postbit, have not been given a value.
find where you have the variables... that go with the getinfo template. it should be in your member.php file.. do a search for "getinfo" which should eventually bring up an "if ($getinfo)" line..
find the code in there, and then take that part of the code and I do believe either add it to the functions.php in the admin folder, or to the showthread folder..
open them both up, and see if you can find where it calls the other variables like post[username] stuff like that.. I think it got moved from the showthread.php file to the functions.php since vb2.0.3
did you try formatting $post[lastpost] under the
while ($post = $DB_site->fetch_array($posts) and $counter++<$perpage)
subroutine (it's in showthread.php)
Sarge
08-17-2001, 05:36 PM
Originally posted by BradC
well cause the 2 variables that you added to postbit, have not been given a value.
Argh
That went right over my head
IS there anyway someone can hack this and release it?
IT would be a cool and easy hack to release
Chris
So, you want the last time they visited?
i.e., Last Post: 25 July 2001 at 6:05 p.m.?
in showthread.php (under the piece of code I just mentioned), add this:
$post[lastposttime] = vbdate($timeformat,$post[lastpost]);
$post[lastpostdate] = vbdate($dateformat,$post[lastpost]);
Then, in your postbit template, add this right under your avatar:
<smallfont>Last Post: $post[lastposttime] on $post[lastpostdate]</font>
That's how I put it in mine at least.
Originally posted by Sarge
Argh
That went right over my head
All he was saying is that you made two variables $lastonline_time and $lastonline_date, however, in showthread.php, they're not actually defined.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.