The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to add CMS to $vboptions
Is it possible to add cms phrases to $vboptions so they can be called when needed?
Currently, when a new article is posted it PHP Code:
I want to edit this so that it pulls the brief preview description along with the link, when it posts. I tried: PHP Code:
The phrase variables I want to include are article_preview & article_title. Does anyone know the correct format for adding these variables into the phrase?? Or how to add CMS phrases into vboptions so they can be called in the phrase? |
#2
|
||||
|
||||
You wouldn't use {article_preview} in a phrase. It would be $article_preview. Assuming that variable is even valid. If you do a search for the phrase "comment_thread_firstpost", you'll find it created in packages/vbcms/content.php, and that is leading me to think the variable may just be $preview, not $article_preview (and I'm guessing the title one is wrong too). And, I'm also thinking you may have to enter them as {2} and {3} and pass the info by modifying the line in that page.
|
#3
|
|||
|
|||
Hi Lynne, thanks...
the currently (original) existing line in that phrase is: PHP Code:
Do I call those varnames using $varname ? --------------- Added [DATE]1285255411[/DATE] at [TIME]1285255411[/TIME] --------------- When I try using: PHP Code:
PHP Code:
|
#4
|
||||
|
||||
I guess I don't understand what you are trying to do. You want to put the phrase $vbphrase[article_preview] into the phrase $vbphrase[comment_thread_firstpost]? I thought you were trying to put a variable in there, not a phrase.
Did you look at the file I mentioned? It's around line 944 that the phrase is created. You would (maybe) have to edit that to pass the other variables you want to use in there and then you would enter the variables as {2} and {3} (just like the page url is a variable that is entered as {1} and is passed to the phrase in that line I mention). |
#5
|
|||
|
|||
Quote:
Quote:
PHP Code:
PHP Code:
I went to the file you suggested and I see this line: PHP Code:
--------------- Added [DATE]1285256606[/DATE] at [TIME]1285256606[/TIME] --------------- Would I change it to: PHP Code:
|
#6
|
||||
|
||||
You need to read the code to see what vB_Phrase is doing. First variable is the name of the phrasegroup, vbcms. Second is the name of the phrase, comment_thread_firstpost. Third is a variable being passed, $this->getPageURL(), in this case it would be {1} in the phrase itself. If you put another after it, $variable2, it will be {2}... another after it will be {3}:
PHP Code:
HTML Code:
Variable 2 is {2} You can view the page at [url]{1}[/url] |
#7
|
|||
|
|||
I finally got it, thank you so much for your help lynne, as usual, you're an angel :-)
|
#8
|
|||
|
|||
*Bumping* Ok.. in the last few years the code in packages>vbcms>content.php has changed to this:
(Line 1055) Code:
$message = new vB_Phrase('vbcms', 'comment_thread_firstpost', $this->getPageURL(array(), true)); I tried the following: Quote:
Quote:
Any Ideas on the correct syntax?? Thank you in advance! --------------- Added [DATE]1424053817[/DATE] at [TIME]1424053817[/TIME] --------------- Nevermind, got it. Code:
$message = new vB_Phrase('vbcms', 'comment_thread_firstpost', $this->getPageURL(), $this->content->getDescription(), $title); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|