View Full Version : Where to find the funtion vB_Template_Runtime::parsePhrase()
Infoman4ever
12-22-2011, 11:01 AM
Hi,
I want to perform some changes to the post date on the postbit_legacy template, so I got the cached template from the database to see what to edit, I found this:
<span class="date">' . vB_Template_Runtime::parsePhrase("x_until_y", '' . $post['startdate'] . '', '' . $post['enddate'] . '') . '</span>
So I should modify this function vB_Template_Runtime::parsePhrase(), so that I'm asking where do I find its declaration on vBulletin files?
Thanks for help in advance.
That function is in includes/class_core.php. But I think if you just want to change the date you either want to edit the phrase that's being used or else modify $post['startdate'] or $post['enddate'] before the postbit is rendered.
Infoman4ever
12-22-2011, 04:19 PM
I want to do so using a product as usual, so I need to include instructions to a plugin, and I don't have a good experience in vbuelltin phrases, that's for I'm asking you explain more your solution please.
Oh right, you want to do it in a plugin. I guess it depends what you want to do exactly. If you can do what you want just by changing the date format, you can probably use a plugin on postbit_display_complete hook and reset those fields (see includes/class_postbit_alt.php to see how they're set). If you want to change what the phrase says, you could include your own phrase in your product then replace that phrase name with your own.
Infoman4ever
12-22-2011, 08:13 PM
Not sure I fully understand, I saw how are the fields set from class_postbit_alt.php but changing it from a plugin?! still unclear, you know, I'm new and I'm learning right here ;)
About the phrases, it's important to say how I'm changing the date, I passe it as a parameter of a specific function I created to perform some changes on it, or, what I'm working on now is another way, I created a new column on the table post to store the new date returned from that function having as parameters the first date from the column named "dateline", anyway, it's not important for you to know such details, I just wanted to tell you how does the function look like, right? so after knowing that, please, tell me how to use phrases? I did not experience phrases before except creating ones, naming it, linking it to a plugin and displaying it from a plugin: {vb:rawphrase word}, right? but I don't know to use a function with phrases.
Edit: the new date is stored to the table post, it's OK, now let's focus on showing the date on the postbit_legacy for each post.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.