Author Topic: Random Quote mod  (Read 522 times)

0 Members and 1 Guest are viewing this topic.

Offline Test Administrator

  • This is my Custom Title
  • Administrator
  • Jr. Member
  • Posts: 83
  • Gender:
  • This is my personal text
    • My Website (This one)
Random Quote mod
« on: January 31, 2012, 04:10:28 PM »
Installed fine, but there is a major error in the code of the mod itself

Code: (find in Load.php) [Select]
// This function generates a random quote. Created by the Random Quotes modification by Marcus "Nas" Forsberg.
function randomQuote()
{
  global $context, $txt, $modSettings;
 
  // Have the admin written any quotes to be used, and is the mod enabled?
  if (!empty($modSettings['random_quote']) && !empty($modSettings['random_quote_enable']))
  {

      // Seperate the quotes from each other.
      $quotes = explode("\n", $modSettings['random_quote']);

      // Number of different quotes
      $num_quotes = count($quotes)-1;

      // A random number
      $number = mt_rand(0,$num_quotes);

      // 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]), '
      </div>';
  }
 
  else
  {
    $output = '';
  }

The error says that there is a problem with a comma on THIS line
      <div class="tborder" style="', !empty($modSettings['random_quote_custom_css'] ? $modSettings['random_quote_custom_css'] : 'padding: 5px;'), '">
no signature to see here... nope, not a thing...