Hi All, kind of new to php and trying to display 2 flash movies one below the other on the right side of the page. apparently I can't post urls (gets *** out). please message me for the site/page addresss thanks.
The first flash movie is already on there. for the second, I only want it to display when the article id=78 and not just if there is a flash file flag on the database elements for this page. The page works fine if the code in red is taken out. can someone help me figure out what I'm doing wrong here please.
PS: sorry if the code posts wrong, its my first time on any forum 😃
<?php
require_once ("classes/include_classes.php");
$output = new site_output;
$db = new db_connect;
if(isset($GET['id'])) {
$id = $GET['id'];
$sql = "select articles.*, articles.flash as artflash, categories.flash as catflash, unix_timestamp(articles.article_date) as article_date, categories.id as catid, categories.colour as colour, categories.name as name, categories.image as banner1, articles.banner as banner from articles ";
$sql .= "left join categories on categories.id = articles.category_id where articles.status = 1 and articles.id = ".$id;
$result = $db->query($sql);
$row = mysql_fetch_array($result);
if($row['artflash'] != "") {
$flash = $row['artflash'];
$showflash = 1;
} else if ($row['catflash'] != "") {
$flash = $row['catflash'];
$showflash = 1;
} else {
$showflash = 0;
}
} else {
header("location: index.php");
exit;
}
$output->css = $row['colour'];
$output->page_title = $row['title'];
$output->keywords = $row['mkeywords'];
$output->description = $row['mdescription'];
$output->nav = $row['category_id'];
$output->current_article = $row['id'];
if($row['banner'] != "") {
$output->banner = "uploaded_files/".$row['banner'];
} else if($row['banner1'] != "") {
$output->banner = "uploaded_files/".$row['banner1'];
} else {
}
$output->breadcrumb[0]['url'] = "section.php?id=".$row['catid'];
$output->breadcrumb[0]['name'] = $row['name'];
$output->breadcrumb[1]['url'] = "";
$output->breadcrumb[1]['name'] = $row['title'];
$output->do_header();
$output->do_vnav();
?>
<div id="block_3">
<div class="block3_padding">
<?php
$output->do_breadcrumb();
?>
<h1 style="margin-bottom: 0;"><?php echo $output->page_title;?></h1>
<span style="color: #999999; display:block; padding-bottom: 20px;">Last updated: <?php echo date("d/m/Y", $row['article_date']);?></span>
<?php
if (file_exists("uploaded_files/".$row['image']) && $row['image'] != "") {
?>
<img src="uploaded_files/<?php echo $row['image'];?>" style="float: right; margin: 0px 0px 10px 20px;" width="300" height="200" alt="<?php echo $row['name'];?>" />
<?php
}
?>
<?php
if($showflash == 1) {
?>
<div style="width:298px; border:1px solid #eeeeee; float: right; height: 150px; clear:right; margin: 0px 0px 10px 20px;">
<object data="flash/<?php echo $flash;?>.swf" width="298" height="150" type="application/x-shockwave-flash" id="main">
<param name="type" value="application/x-shockwave-flash" />
<param name="src" value="flash/<?php echo $flash;?>.swf" />
<param name="data" value="flash/<?php echo $flash;?>.swf" />
<param name="codebase" value="flash/<?php echo $flash;?>.swf" />
<param name="movie" value="flash/<?php echo $flash;?>.swf" />
<param name="quality" value="best" />
<param name="loop" value="true" />
<param name="menu" value="false" />
<param name="scale" value="noscale" />
<param name="salign" value="LT" />
<param name="wmode" value="window" />
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
</object>
[COLOR="Red"]<?php
if($showflash == 1 && $id ==78) {
?>
<object data="flash/marine_dl.swf" width="298" height="150" type="application/x-shockwave-flash" id="main">
<param name="type" value="application/x-shockwave-flash" />
<param name="src" value="flash/<?php echo $flash;?>.swf" />
<param name="data" value="flash/<?php echo $flash;?>.swf" />
<param name="codebase" value="flash/<?php echo $flash;?>.swf" />
<param name="movie" value="flash/<?php echo $flash;?>.swf" />
<param name="quality" value="best" />
<param name="loop" value="true" />
<param name="menu" value="false" />
<param name="scale" value="noscale" />
<param name="salign" value="LT" />
<param name="wmode" value="window" />
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>[/COLOR]
<?php
}
echo $row['description'];
?>
<?php
if (file_exists("uploaded_files/".$row['download']) && $row['download'] != "") {
?>
<div class="download_box">
<a href="uploaded_files/<?php echo $row['download'];?>"><img src="images/icon_downloads.gif" width="37" height="33" style="float: left; padding-right: 10px; border:none;" alt="Download File" /></a>
<div style="float: left; width: 400px;">
<span style="font-size: 1.5em; color: #422f03; font-family: 'Lucida Grande'; font-weight: bold;">Download:</span>
<p style="padding:0; margin: 0;"><a href="uploaded_files/<?php echo $row['download'];?>"><?php echo $row['download'];?></a> (<?php echo (filesize("uploaded_files/".$row['download'])/1024);?> Kb)</p>
</div>
<div class="clear"></div>
</div>
<?php
}
?>
<div class="contact_box">
<a href="contact_us.php?article=<?php echo $row['id'];?>"><img src="images/icon_contact.gif" width="37" height="32" style="float: left; padding-right: 10px; border:none;" alt="Contact Wil****s Associates" /></a>
<div style="float: left; width: 400px;">
<span style="font-size: 1.5em; color: #000000; font-family: 'Lucida Grande'; font-weight: bold;">Interested?</span>
<p style="padding:0; margin: 0;"><a href="contact_us.php?article=<?php echo $row['id'];?>">Contact Wil****s Associates</a> about <strong>"<?php echo $row['title'];?>"</strong></p>
</div>
<div class="clear"></div>
</div>
<div style="float: right;">
<!-- AddThis Button BEGIN -->
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<div class="addthis_toolbox addthis_default_style">
<a href="http://www.addthis.com/bookmark.php?v=250&username=walimited" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_linkedin"></a>
<a class="addthis_button_google"></a>
<a class="addthis_button_twitter"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=walimited"></script>
<!-- AddThis Button END -->
</div>
<div class="clear"></div>
<p><a href="#">Back to top</a></p>
<?php
if ($row['category_id'] == 4) {
?>
<div class="contact_box">
<p style="padding: 0px; margin: 0px; font-size:0.9em;">Think carefully before securing other debts against your home. Your home may be repossessed if you do not keep up repayments on your mortgage or any other debt secured on it. There will be a fee for mortgage advice. The precise amount will depend upon your circumstances, but we estimate that it will be 995% of the loan value. The overall cost for comparison is 6.25% APR. The actual rate available will depend upon your circumstances. Please ask for a personalised illustration.</p>
</div>
<?php
}
?>
</div>
</div>
<?php
$output->do_footer();
?>