The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
help with php code, vbulletin
PHP Code:
This is what shows: Private Messages: %1$s, %2$s. This is what should show: Private Messages: Unread 0, Total 92. Any help, I would appreciate very much. Thanks! |
#2
|
|||
|
|||
I've never done that before, but looking at the construct_phrase code, I see these comments at the beginning:
Code:
// ############################################################################# /** * Construct Phrase * * this function is actually just a wrapper for sprintf but makes identification of phrase code easier * and will not error if there are no additional arguments. The first parameter is the phrase text, and * the (unlimited number of) following parameters are the variables to be parsed into that phrase. * * @param string Text of the phrase * @param mixed First variable to be inserted * @param mixed Nth variable to be inserted * * @return string The parsed phrase */ So this is untested, but I would think you'd want something like: Code:
if ($show['pmstats']) { echo '<div style="font-size: 11px; padding-left: 5px; padding-top: 5px;>'. construct_phrase($vbphrase['private_messages_nav'], $vbphrase['unread_x_nav_compiled'], $vbphrase['total_x_nav_compiled'], $session['sessionurl_q']). '</div>'; } but it's also possible that I just don't understand what's going on.... |
#3
|
|||
|
|||
no that doesn't work, I know the code I posted above is in the right direction, it sorta works...
Can anyone out here help please? |
#4
|
|||
|
|||
I had an extra " in there, you might try it again.
It's funny, I have to admit I was wondering what you were doing there, now I see you tried to follow something I suggested in another thread. But in that thread the "phr" was just an example, not meant to be literal, it should be replaced with the actual phrase you're constructing (which in this case I believe is $vbphrase['private_messages_nav']. Also you have a <phrase> tag in your output, but that's a tag to be used in templates so I don't think you should be 'echoing' it as output. I think "construct_phrase" does the same thing in a php program so you should be using the return value of that as part of your output. Just wanted to clarify what I was trying to say - if anyone else wants to help, go for it. |
#5
|
|||
|
|||
Ok, that works.
Question though, the word Private Messages, that outputs, how do I add a link to that? |
#6
|
|||
|
|||
Hmm...it should be a link already, I think. The default value for that phrase includes the html tags to make the words "Private Messages" a link.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|