예제 #1
0
function wppa_stereo_box()
{
    // Init
    $result = '';
    // No search box on feeds
    if (is_feed()) {
        return;
    }
    // Open container
    wppa_container('open');
    // Open wrapper
    $result .= "\n";
    $result .= '<div' . ' id="wppa-stereo-' . wppa('mocc') . '"' . ' class="wppa-box wppa-stereo"' . ' style="' . __wcs('wppa-box') . __wcs('wppa-stereo') . '"' . ' >';
    // The search html
    $result .= wppa_get_stereo_html();
    // Clear both
    $result .= '<div class="wppa-clear" style="' . __wis('clear:both;') . '" ></div>';
    // Close wrapper
    $result .= '</div>';
    // Output
    wppa_out($result);
    // Close container
    wppa_container('close');
}
예제 #2
0
function wppa_get_multitag_html($nperline = '2', $seltags = '')
{
    global $wppa;
    $or_only = wppa_switch('tags_or_only');
    $page = wppa_get_the_landing_page('wppa_multitag_linkpage', __a('Multi Tagged photos'));
    $result = '';
    if (wppa_opt('wppa_multitag_linkpage')) {
        $hr = wppa_get_permalink($page);
        if (wppa_opt('wppa_multitag_linktype') == 'album') {
            $hr .= 'wppa-album=0&wppa-cover=0&wppa-occur=1';
        }
        if (wppa_opt('wppa_multitag_linktype') == 'slide') {
            $hr .= 'wppa-album=0&wppa-cover=0&wppa-occur=1&slide';
        }
    } else {
        return __a('Please select a multitag landing page in Table VI-C4b');
    }
    $tags = wppa_get_taglist();
    $result .= '
	<script type="text/javascript">
	function wppaProcessMultiTagRequest() {
	var any = false;
	var url="' . $hr . '&wppa-tag=";';
    if ($or_only) {
        $result .= '
		var andor = "or";';
    } else {
        $result .= '
		var andor = "and";
			if ( document.getElementById( "andoror-' . $wppa['mocc'] . '" ).checked ) andor = "or";
		var sep;';
    }
    $result .= '
	if ( andor == "and" ) sep = ","; else sep = ";";
	';
    $selarr = $seltags ? explode(',', $seltags) : array();
    if ($tags) {
        foreach ($tags as $tag) {
            if (!$seltags || in_array($tag['tag'], $selarr)) {
                $result .= '
			if ( document.getElementById( "wppa-' . str_replace(' ', '_', $tag['tag']) . '" ).checked ) {
				url+="' . str_replace(' ', '%20', $tag['tag']) . '"+sep;
				any = true;
			}';
            }
        }
    }
    $result .= '
	if ( any ) document.location = url;
	else alert ( "' . __a('Please check the tag(s) that the photos must have') . '" );
	}</script>
	';
    $qtag = wppa_get_get('tag');
    $andor = $or_only ? 'or' : 'and';
    // default
    if (strpos($qtag, ',')) {
        $querystringtags = explode(',', wppa_get_get('tag'));
    } elseif (strpos($qtag, ';')) {
        $querystringtags = explode(';', wppa_get_get('tag'));
        $andor = 'or';
    } else {
        $querystringtags = wppa_get_get('tag');
    }
    if ($tags) {
        if (!$or_only) {
            $result .= '<table class="wppa-multitag-table">' . '<tr>' . '<td>' . '<input' . ' class="radio"' . ' name="andor-' . wppa('mocc') . '"' . ' value="and"' . ' id="andorand-' . wppa('mocc') . '"' . ' type="radio"' . ($andor == 'and' ? ' checked="checked"' : '') . ' />' . '&nbsp;' . __a('And', 'wppa_theme') . '</td>' . '<td>' . '<input' . ' class="radio"' . ' name="andor-' . wppa('mocc') . '"' . ' value="or"' . ' id="andoror-' . wppa('mocc') . '"' . ' type="radio"' . ($andor == 'or' ? ' checked="checked"' : '') . ' />' . '&nbsp;' . __a('Or', 'wppa_theme') . '</td>' . '</tr>' . '</table>';
        }
        $count = '0';
        $checked = '';
        $tropen = false;
        $result .= '<table class="wppa-multitag-table">';
        foreach ($tags as $tag) {
            if (!$seltags || in_array($tag['tag'], $selarr)) {
                if ($count % $nperline == '0') {
                    $result .= '<tr>';
                    $tropen = true;
                }
                if (is_array($querystringtags)) {
                    $checked = in_array($tag['tag'], $querystringtags) ? 'checked="checked"' : '';
                }
                $result .= '<td' . ' style="' . __wis('padding-right:4px;') . '"' . ' >' . '<input' . ' type="checkbox"' . ' id="wppa-' . str_replace(' ', '_', $tag['tag']) . '"' . ' ' . $checked . ' />' . '&nbsp;' . str_replace(' ', '&nbsp;', $tag['tag']) . '</td>';
                $count++;
                if ($count % $nperline == '0') {
                    $result .= '</tr>';
                    $tropen = false;
                }
            }
        }
        if ($tropen) {
            while ($count % $nperline != '0') {
                $result .= '<td></td>';
                $count++;
            }
            $result .= '</tr>';
        }
        $result .= '</table>';
        $result .= '<input' . ' type="button"' . ' onclick="wppaProcessMultiTagRequest()"' . ' value="' . __a('Find!') . '"' . ' />';
    }
    return $result;
}