View Full Version : My 1st attempt
MindTrix
10-03-2003, 09:45 PM
ok errrm im not gonna say wut hack im makin lol dunno why guess i dont want other people doin it b4 cus it wil prob take me years to do lmfao neee wayzzz
In the post bit template there this
$post[posttime]
Soo if i wanna put this into another template or something isnt there some code from a php file i have to move aswell??
Yes laugh at me all u want but heck ima newbie (i dun even understand most php code)
joeydood
10-07-2003, 01:38 PM
i think that's all you have to do!
like using $bbuserinfo[username] somewhere. problem is, you have to make sure that info is available wherever you want to print it.
if it isn't, they you'll have to store it in a variable to be accessed when the data is not available.
like let's say you want this on the usercp. $post[posttime] (i'm assuming here...) is retrieved from the database in the postbit section. so to retrieve that info elsewhere when it is not available you would have to store it in a session variable (sorry for the lack of terminology here, i'm an asp/vb guru).
but you'd only have to store it as a variable IF its not available where you want to use it. if i'm not mistaken, there should already be a globally available variable in the $bbuserinfo array == $bbuserinfo[posttime] or whatever the proper name of the field is.
sorry to ramble.
MindTrix
10-07-2003, 01:41 PM
Well i tried moving the $post[posttime] to another template in another catagory example --- from post bits to like errrm forum home i dunno
And it wont show, comes up blank so i guesed i had to move the code that makes up the variable kinda thing. Im useless at php but im gettin it slowley :p i was jus wonderin if ne one new where the code wus or how to get it?
MindTrix
11-13-2003, 04:48 PM
Bumping for help here people lol pleaseeeeeee?
assassingod
11-13-2003, 05:13 PM
Search for that variable in functions.php (that is where the getpostbit function is so all postbit related stuff will be there) and use the code from there and add it to the new file you wish it to appear (global.php for example if you want the thing to appear on all pages)
MindTrix
11-13-2003, 05:16 PM
This is the only instant i could find it---
$post[posttime]=vbdate($timeformat,$post[dateline]);
Would that be the right code im looking for?
assassingod
11-13-2003, 05:18 PM
Next look for $post[dateline] because $post[posttime] is a variable for something else (The date the post was posted)
MindTrix
11-13-2003, 05:20 PM
$post[postdate]=vbdate($dateformat,$post[dateline]);
$post[posttime]=vbdate($timeformat,$post[dateline]);
Would that be it?
assassingod
11-13-2003, 05:24 PM
No, you need to look for more code containing $post[dateline] I cant remember where else it's defined though. sorry
MindTrix
11-13-2003, 05:25 PM
Thats fine i appreciate you helping. Basically i just want to find the code in the php file that will show/tell me the time a reply was made.
MindTrix
11-13-2003, 05:30 PM
Could this be anything maybe?
// get last reply time
if ($postid) {
$dateline=$DB_site->query_first("SELECT dateline
FROM post
WHERE postid='$postid'");
$lastposttime=$DB_site->query_first("SELECT dateline
FROM post
WHERE threadid = '$threadid'
AND dateline < $dateline[dateline]
AND visible = 1
ORDER BY dateline DESC
LIMIT 1");
} else {
$lastposttime=$DB_site->query_first("SELECT dateline
FROM post
WHERE threadid='$threadid'
ORDER BY dateline DESC
LIMIT 1");
}
sabret00the
11-14-2003, 02:03 AM
have you tried $post[dateline] or $postdateline
also try $_POST[postdateline] or $_POST[$post[dateline]] or $_POST[$postdateline]
one of the latter should definately work
MindTrix
11-14-2003, 03:22 PM
Hey sabret00the cheers for the help/advice, and you too assassingod i really REALLY appreciate it.
Yet, sabret00the none of the codes in your post worked at all :( Did i need to move any php code anywhere?
sabret00the
11-14-2003, 04:11 PM
nope you should've just been able to do
$custompostime = $_POST[$dateline]
or something of the sort and then call it in your template as $customposttime
sorry i couldn't help more, if steve checks this again, he might be able to use what i tried to get it to work.
MindTrix
11-14-2003, 05:00 PM
So surely i have to place
$custompostime = $_POST[$dateline]
Somewhere in a php file? I was just adding the codes you listed above in the other post to a template, which obviously were comming up blank. Basically i just want to be able to show the time a new reply was made, in another template.
sabret00the
11-14-2003, 08:00 PM
in your functions.php
what exactly are you trying to do it could go a along way towards me trying to help you
MindTrix
11-14-2003, 08:16 PM
Yeah your write lol, im jus beein over protective cause its something simple i wanted to do and i cant :p Plus i wanted to release it as a tiny hack if i got it to work i jus didnt want someone doin it b4 me (if they aint already) Blah ill pm u what im doing
sabret00the
11-14-2003, 09:00 PM
fromw hat you explained, you can't do it the way it the way i was trying to do it but rather using a query, if i think you mean what i think you mean, anyway, check the query that's used in the forumdisplay.php
MindTrix
11-15-2003, 12:00 PM
Ok i found this code in the forumdisplay.php and i think/hope its the one i need
// dates
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}
If it is could you let me know where i need to put it in the functions.php because im guessing i cant just chuck it in there.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.