Hjælp med PHP og FLASH
Hvordan kan jeg integrere følgende kode:<?php $video = get_post_meta($post->ID, "video", true); if ($video != "") { $video = explode(",", $video); foreach ($video as $url) { echo "" . $url . ""; } } ?>" />
I nedenstående:
Bemærk at det er "ah.flv&image=preview.jpg" der skal erstates i følgende:
s1.addParam("flashvars","file=ah.flv&image=preview.jpg");
Hele kode ser således ud:
<?php global $theme_options, $newspro; ?>
<?php if($theme_options['enable_video'] == 1) { ?>
<div id="video">
<?php query_posts('cat='.$theme_options["videoCatID"].'&showposts='.$theme_options["videoPostCount"]); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2 class="widgetTitle"><?php the_title(); ?></h2>
<object type="application/x-shockwave-flash" data="<?php $video = get_post_meta($post->ID, "video", true); if ($video != "") { $video = explode(",", $video); foreach ($video as $url) { echo "" . $url . ""; } } ?>" width="260" height="210"><param name="movie" value="<?php $video = get_post_meta($post->ID, "video", true); if ($video != "") { $video = explode(",", $video); foreach ($video as $url) { echo "" . $url . ""; } } ?>" /></object>
<?php endwhile; else : ?>
<?php endif; ?>
</div>
<?php wp_reset_query(); ?>
<?php } ?>
På forhånd mange tak for hjælpen
Tak
