コード例 #1
0
    $responsive = $slideshowS['responsive'] == 'no' ? ',responsiveSlider: false' : '';
    $baseUrl = cu3er__resolveUrl(cu3er__removeDomainName($slideshowS['images_folder'])) . cu3er__removeDomainName($slideshowS['images_folder']);
    $fflash = cu3er__isFallback($baseUrl . '/fallback') ? 'false' : 'true';
    $content = $seo_str != '' ? $seo_str : $slideshowS['content'];
    $images_var = '';
    if ($default['use_post_images'] == 'yes' && $default['posts_count'] > 0) {
        query_posts('showposts=' . $default['posts_count']);
        while (have_posts()) {
            the_post();
            $images[] = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        }
        $images_var = ',images:"' . implode(",", $images) . '"';
    }
    $slideshowS['width_type'] = $slideshowS['width_type'] == '%' ? '%' : '';
    $slideshowS['height_type'] = $slideshowS['height_type'] == '%' ? '%' : '';
    $var = "<div id='CU3ER" . $slideshow . "'>" . $content . "</div><script type='text/javascript'>\n\t\t\tjQuery(document).ready(function(\$) {\n\t\t\t\t\$('#CU3ER" . $slideshow . "').cu3er({\n\t\t\t\t\tvars: {\n\t\t\t\t\t\txml_location: \"" . cu3er__removeDomainName($slideshowS['xml_location']) . "\",\n\t\t\t\t\t\txml_encoded: '" . urlencode(cu3er__array2xml($data)) . "',\n\t\t\t\t\t\tswf_location: '" . $settings['cu3er_location'] . "?" . time() . "',\n\t\t\t\t\t\tcss_location: '" . WP_PLUGIN_URL . "/wpcu3er/css/CU3ER.css',\n\t\t\t\t\t\tjs_location: '" . $settings['js_player_location'] . "?" . time() . "',\n\t\t\t\t\t\twidth: '" . $slideshowS['width'] . $slideshowS['width_type'] . "',\n\t\t\t\t\t\theight: '" . $slideshowS['height'] . $slideshowS['height_type'] . "',\n\t\t\t\t\t\tforce_javascript: " . $fjs . ",\n\t\t\t\t\t\tforce_flash: " . $fflash . "" . $images_var . "" . $fjs3d . "" . $responsive . "\n\t\t\t\t\t},\n\t\t\t\t\tparams: {\n\t\t\t\t\t\t" . $params . ",\n\t\t\t\t\t\tallowScriptAccess: 'always'\n\t\t\t\t\t},\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tid:'CU3ER" . $slideshow . "',\n\t\t\t\t\t\tname:'CU3ER" . $slideshow . "'\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t</script>";
    echo $var;
    echo '
		</body>
		</html>';
} elseif ($_GET['act'] == 'upload') {
    if (is_user_logged_in()) {
        if (!current_user_can('upload_files')) {
            die("You need to have permission to upload files!");
        }
    } else {
        die("You need to be logged in!");
    }
    $uploadsDir = wp_upload_dir();
    $writable = true;
    if (is_writable($uploadsDir['basedir'] . '/wpcu3er')) {
コード例 #2
0
function cu3er__array2xml($array)
{
    foreach ($array as $key => $value) {
        if (is_array($value)) {
            if ($key !== '@attributes' && $key !== 'vle') {
                if (is_numeric($key)) {
                    $childs = '';
                    $children = cu3er__array2xml($value);
                } else {
                    $childs .= cu3er__array2xml($value);
                    $childs = $childs != '' ? $childs : 'empty';
                }
            }
        } else {
            $childs = $value != '' ? $value : 'empty';
        }
        if ($childs != '') {
            $attributes = cu3er__getAttributes($array[$key], $key);
            $vle = cu3er__getNodeValue($array[$key]);
            $attributes[$key] = $attributes[$key] != '' ? ' ' . $attributes[$key] : '';
            if ($key !== 'vle' && $key !== '@attributes') {
                if ($childs == 'empty') {
                    if ($vle != '') {
                        $xml .= '<' . $key . $attributes[$key] . '>' . $vle . '</' . $key . '>';
                    } else {
                        $xml .= '<' . $key . $attributes[$key] . ' />';
                    }
                } else {
                    $xml .= '<' . $key . $attributes[$key] . '>' . $vle . $childs . '</' . $key . '>';
                }
                unset($attributes[$key], $childs);
            }
        }
        if ($children != '') {
            $xml .= $children;
            $children = '';
        }
    }
    return $xml;
}