The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Post create date in showthread
How can i show post create date in showthread template?
$post[postdate] is not work :/ Work for only postbit or postbit_legacy I have a schema code; HTML Code:
<script type="application/ld+json"> { "@context":"http://schema.org", "@type":"DiscussionForumPosting", "@id":"********", "headline":"$thread[prefix_plain_html] $thread[title]<if condition='$pagenumber>1'> - <phrase 1='$pagenumber'>$vbphrase[page_x]</phrase></if>", "articleSection":"$foruminfo[title_clean]", "author":{"@type":"Person","name":"$thread[postusername]"}, "datePublished":"$post[postdate]", [B]// this is not work in showthread template[/B] "dateModified":"", "image":"********************", "interactionStatistic":{ "@type":"InteractionCounter", "interactionType":"https://schema.org/ReplyAction", "userInteractionCount":"$thread[replycount]"}, "publisher":{ "@type":"Organization", "name":"***********", "url":"**********", "logo":{"@type":"ImageObject", "url":"*******************"} }, "mainEntityOfPage":{ "@type":"WebPage", "@id":"***********"} } </script> |
#2
|
||||
|
||||
Which postdate do you want to show?
If it's the first you can create a plugin to do it. Hook location:Showthread_complete Title:thread start date Code Code:
$thread[startdate] = vbdate("Y-m-d", $thread["dateline"]); $thread[startdate] (or {vb:raw thread.startdate} for vb4) will then be available in showthread. Schema also accepts datetime format so you could use Y-m-dTH:i:sP in the plugin instead of Y-m-d for greater accuracy. Attachment 157670 |
#3
|
||||
|
||||
After a little more playing, this will give you first and last post dates (you can use last for date modified)
Code:
$thread[startdate] = vbdate("Y-m-dTH:i:sP", $thread["dateline"]); $thread[lastdate] = vbdate("Y-m-dTH:i:sP", $thread["lastpost"]); |
Благодарность от: | ||
vacancy33 |
#4
|
|||
|
|||
Thank you soo much it s work
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|