News:

Join the Facebook Fan Page.

Main Menu

Error on line

Started by TheListener, March 17, 2010, 08:12:37 PM

Previous topic - Next topic

TheListener

Parse error: syntax error, unexpected ',' in xxxxxxxxxxx/Sources/Load.php on line 3168

// Store the stuff.
         $output = '<br />
         <div class="tborder" style="', !empty($modSettings['random_quote_custom_css'] ? $modSettings['random_quote_custom_css'] : 'padding: 5px;' , '">

            <span style="color:', !empty($modSettings['random_quote_label_color']) ? $modSettings['random_quote_label_color'] : '#000000', '; font-weight: bold;">
               ',!empty($modSettings['random_quote_label_custom']) ? parse_bbc($modSettings['random_quote_label_custom']) : $txt['random_quote_label_standard'],'
            </span>
            ' , parse_bbc($quotes[$number]), '


Line in red is the error line.
         </div>';
   }

Arantor

<div class="tborder" style="', !empty($modSettings['random_quote_custom_css']) ? $modSettings['random_quote_custom_css'] : 'padding: 5px;' , '">

Should be a ) after $modSettings['random_quote_custom_css']

TheListener


Arantor

Fine, try this.

// Store the stuff.
         $output = '<br />
         <div class="tborder" style="', (!empty($modSettings['random_quote_custom_css']) ? $modSettings['random_quote_custom_css'] : 'padding: 5px;'), '">
            <span style="color:', !empty($modSettings['random_quote_label_color']) ? $modSettings['random_quote_label_color'] : '#000000', '; font-weight: bold;">
               ',!empty($modSettings['random_quote_label_custom']) ? parse_bbc($modSettings['random_quote_label_custom']) : $txt['random_quote_label_standard'],'
            </span>
            ' , parse_bbc($quotes[$number]), '


And if that doesn't work, that means something ELSE is broken. If that's the case, consider adding the file here so I can actually see the problem in its entirety rather than this bit of code which may be unrelated.

TheListener

Like I shoulda done to start with.

Arantor

You can't have commas in an assignation ($variable = something) statement, they're restricted to echo statements.

TheListener


TheListener

OK

Have checked all the files and nothing is out of place.

The only problem now is the random quote is not showing on the main board.

Arantor

Would you mind telling me what mod you're using? So then you can ask the author.

TheListener


Arantor



Arantor

http://www.simplemachines.org/community/index.php?topic=289690.0 would have been by far the best place to ask.

Since we already fixed up the random quote code... did you add the edit to index.template.php ?

TheListener

If ya mean

template_menu();

// Show a random quote.
randomQuote();


It's there already.

Arantor

And... any errors in the error log?

TheListener


Arantor

Actually entered some random quotes in the admin panel? (As in, more than 1)

TheListener


Arantor

There are only two reasons it should be producing no content.

1. No quotes
2. Quotes not enabled

Since the code seems to work for me now... something else must be wrong.

TheListener

How would I be writing the quotes?

Quote1
quote2

Or with code?

Arantor

BBcode is fine as long as it's one per line.

Advertisement: