function synved_connect_sponsor_content(array $sponsor_item = null)
{
    if ($sponsor_item == null) {
        $sponsor_item = synved_connect_sponsor_item();
        if ($sponsor_item == null) {
            $sponsor_item = synved_connect_sponsor_item_pick();
        }
    }
    if ($sponsor_item == null) {
        return null;
    }
    $sponsor_type = isset($sponsor_item['type']) ? $sponsor_item['type'] : null;
    $sponsor_text = isset($sponsor_item['text']) ? $sponsor_item['text'] : null;
    $sponsor_markup = isset($sponsor_item['markup']) ? $sponsor_item['markup'] : null;
    $sponsor_link = synved_connect_sponsor_link($sponsor_item);
    if ($sponsor_text == null) {
        if ($sponsor_type == 'credit') {
            $sponsor_text = '%%link%% by Synved';
        } else {
            return null;
        }
    }
    if ($sponsor_markup == null) {
        if ($sponsor_type == 'credit') {
            $sponsor_markup = '<span class="%%class%%">%%content%%</span>';
        } else {
            $sponsor_markup = '<div class="%%class%%">%%content%%</div>';
        }
    }
    $sponsor_class = 'sponsor-holder';
    if ($sponsor_type != null) {
        $sponsor_class .= ' sponsor-type-' . $sponsor_type;
    }
    $sponsor_markup = str_replace('%%class%%', $sponsor_class, $sponsor_markup);
    $sponsor_content = str_replace('%%link%%', $sponsor_link, $sponsor_text);
    $sponsor_content = str_replace('%%content%%', $sponsor_content, $sponsor_markup);
    return $sponsor_content;
}
예제 #2
0
function synved_connect_credit_link(array $credit_item = null)
{
    return synved_connect_sponsor_link($credit_item);
}