function bp_links_settings_validate_order_text($string)
{
    // content to return
    $content = '';
    // parse the config text
    $config = bp_links_settings_parse_order_text($string);
    // loop config and format neatly
    foreach ($config as $key => $value) {
        $content .= sprintf("%s = %s\n", $key, $value);
    }
    // return it!
    return $content;
}
Beispiel #2
0
/**
 * Return order by options config.
 *
 * @return array
 */
function bp_links_get_order_options()
{
    // cache statically so we only have to parse text once
    static $options = null;
    // not parsed yet?
    if (null === $options) {
        // nope parse it
        $options = bp_links_settings_parse_order_text(BP_LINKS_ORDER_BY_TEXT);
        // voting disabled?
        if (false === bp_links_is_voting_enabled()) {
            // yep, kill voting related options
            unset($options['popular'], $options['most-votes'], $options['high-votes']);
        }
    }
    // return config
    return $options;
}