The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Applying HTML tags to parts of PHP file
I am trying to change the font-colour of part of a query in php, by using a CSS class in html.
I want the following code to have the css class 'time' applied to it. '.vbdate($vbulletin->options['timeformat'], $dateline); I have edited the above php code in this way: echo '<span class=\"time\">' '.vbdate($vbulletin->options['timeformat'], $dateline) '</span>' ; This code however does not work. Does anyone here know how I can correctly apply the 'time' class to a piece of code in php? |
#2
|
||||
|
||||
What is the full line of code? (Perhaps a few lines above and below.)
|
#3
|
|||
|
|||
Here is the full query from that section:
// ################################################## ############ // ###################### Start WTdatelineTOusertime ############ // gets dateline in unix format and converts it to visitor's time. function WTdatelineTOusertime($dateline) { global $vbulletin, $vbphrase; if ($dateline == 'Never' OR $dateline == '0') { return $vbphrase[never]; } $readbable = vbdate($vbulletin->options['dateformat'], $dateline, true).' - '.vbdate($vbulletin->options['timeformat'], $dateline); return $readbable; } The part in red is the part I want to apply the css class to. |
#4
|
|||
|
|||
Use [php] tags when posting PHP. The syntax highlighting would probably have told you where you were going wrong...
Try something like: PHP Code:
|
#5
|
|||
|
|||
Then you just add it to the string your storing in that variable. You echoing it is trying to send it to the browser.
Quote:
edit: There you go again OP...lol |
#6
|
|||
|
|||
Thanks guys, much appreciated
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|