Forums

Fortunate Random Quotes
Integration with qLanguage plugin (3 posts)

  1. TheRider62
    Member
    Posted 2 years ago #

    I have a multilanguage blog and wanted to see quotes showing up in the current language, not just in the language defined in the options panel. For that purpose, I changed the fortunate_widget function in the file fortunate.php like this:

    [code]
    function fortunate_widget($args) {
    extract($args);
    [strong]
    if ( function_exists('qtrans_getLanguage') ) {
    $options = array( 'lang' => qtrans_getLanguage() );
    echo $before_widget
    . $before_title . qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage(get_option('fortunate_title')) . $after_title
    . '<div class="fortunate">'
    . fortunate_fetch($options)
    . '</div>' . "\n"
    . $after_widget;
    } else {[/strong]
    echo $before_widget
    . $before_title . get_option('fortunate_title') . $after_title
    . fortunate() . $after_widget;
    }

    }
    [/code]

    http://wordpress.org/extend/plugins/fortunate/

  2. TheRider62
    Member
    Posted 2 years ago #

    Uh oh -- this code is supposed to look like this (and I hope it works out this time)

    function fortunate_widget($args) {
    extract($args);
    <strong>
    if ( function_exists('qtrans_getLanguage') ) {
    $options = array( 'lang' => qtrans_getLanguage() );
    echo $before_widget
    . $before_title . qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage(get_option('fortunate_title')) . $after_title
    . '<div class="fortunate">'
    . fortunate_fetch($options)
    . '</div>' . "\n"
    . $after_widget;
    } else {</strong>
    echo $before_widget
    . $before_title . get_option('fortunate_title') . $after_title
    . fortunate() . $after_widget;
    }
    
    }
  3. TheRider62
    Member
    Posted 2 years ago #

    Almost. Now remove the "strong" and "/strong" tags. Those delimit the new part of the code.

    I guess I'll never manage this markup business. All forums have their own system. Sorry.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic