All pastes #901064 Raw Edit

b925 - index

public php v1 · immutable
·published 2008-02-12 11:22 UTC
rendered paste body
<?php$id = trim(intval($_GET['id']));include('conninfo.php');?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>[beyond925] - Home</title><link rel="stylesheet" type="text/css" href="style.css" /></head><body><div id="container">	<div id="header">			<div id="area">			<h1 class="pageHead">[ Home ]</h1>		</div> 				<div id="logo">			<a href="index.php"><img src="images/logoMag.jpg" alt="" /></a>		</div>				<div id="navBar">			<ul class="nav">				<li>[<a href="events.php">Events</a>]</li>				<li>[<a href="clubs.php">Clubs</a>]</li>				<li>[<a href="candy.php">Candy</a>]</li>				<li>[<a href="features.php">Features</a>]</li>			</ul>			<ul class="nav">				<li>[<a href="subscriptions.php">Subscriptions</a>]</li>				<li>[<a href="advertising.php">Advertising</a>]</li>				<li>[<a href="contributors.php">Contributors</a>]</li>				<li>[<a href="outlets.php">Selected Outlets</a>]</li>			</ul>		</div>	</div><!--/header-->		<div id="content">		<div id="primCol">			<?php			//if ID is set then display the corresponding info:			if($id >= 1){			$query="SELECT * FROM news WHERE newsID = $id";			$result=mysql_query($query) or die ("Couldn't execute query");									$numrows=mysql_num_rows($result);										while($r=mysql_fetch_array($result)){			?>			<img class="<?php echo $r['newsClass'];?>" src="<?php echo $r['newsImage'];?>" alt="" />			<p class="intro"  >[Beyond925 magazine is, as the name implies, a gateway into the world of adventure and endurance sport lifestyle.]</p>			<p><?php echo $r['newsContent'];?></p>			<?php				}			} else			{			//if ID isn't set then display the generic info:			?>			<img class="<?php echo $r['newsClass'];?>" src="images/sampleimage.jpg" alt="" />			<p class="intro">[Beyond925 magazine is, as the name implies, a gateway into the world of adventure and endurance sport lifestyle.]</p>			<p><span class="first">[W</span>ork/Life balance is a bit of a buzz phrase at the moment, it keeps coming up in all forms of the media and even the politicians are trying to use it as a way to butter-up the voting public. The bitter reality about modern life is that despite all the new fangled technology, like super-fast broadband, powerful PCs and 3G mobile phones, we work as hard as ever and it is all too easy to let the whole work/life balance thing fall right over.<span class="first">]</span></p><p><span class="first">[B</span>eyond925 magazine provides high quality content covering adventure and endurance sports in Wales and the West. With a developing online knowledge base, the magazine is an invaluable resource of where, how, with what, taught by whom and where to stay, for adventure and endurance sports in the region, encouraging growth and cross-over of these activities. Many of these sports can be very intimidating to the uninitiated, so there is considerable focus on novices. There is also a particular push to promote these sports to women as they are often under represented and to the disabled, who increasingly have the option to participate in these activities<span class="first">]</span></p>			<?php			}			?>		</div>				<div id="ad">			<img src="images/advertTest.jpg" alt="Testing Advert" />		</div>				<div><span id="clear"></span><hr/></div>		<div id="secCol">			<h1>[ News ]</h1>			<?php			$per_page = 2;			$cur_page = isset($_GET['p']) ? (int)$_GET['p'] : 1;			$result = mysql_query("SELECT COUNT(*) FROM news");			$numrows = mysql_result($result, 0, 0);			// total pages = number of results / amount per page (rounded up using ceil)			$total_pages = ceil($numrows / $per_page);			if ($cur_page < 1 || $cur_page > $total_pages){				$cur_page = 1;			}			$offset = (($cur_page - 1) * $per_page);			$result = mysql_query("SELECT * FROM news LIMIT $offset, $per_page");			$numrows=mysql_num_rows($result);			// Dynamically process the URLs for the news articles			// using the queries information from the database			if($numrows == 0){				?>			<p>Currently there is no news available, check back soon for the latest announcements!</p>			<?php			}			else {			?>			<p>Here's the latest news from the Beyond925 team:</p><br/>			<?php				while($r=mysql_fetch_array($result)){			?>							<a class="news" href="?p=<?php echo $cur_page;?>&amp;id=<?php echo $r['newsID'];?>"><?php echo $r['newsTitle'];?></a><br/>			<?php				}			}			$show_prev = $cur_page > 1 ? $cur_page - 1 : false;			$show_next = $cur_page < $total_pages ? $cur_page + 1 : false;						?>			<br/>			<?php if ($show_prev){ ?><a class="prevURL" href="?p=<?php echo $show_prev; ?>&amp;id=<?php echo $id;?>">&lt; [ View Previous ]</a>			<?php } ?>			<?php if ($show_next){ ?><a class="nextURL" href="?p=<?php echo $show_next; ?>&amp;id=<?php echo $id;?>">[ View More ] &gt;</a>			<?php } ?>		</div>				<div id="terCol">			<h1>[ Latest Issue ]</h1>			<img src="images/firstissue2.jpg" alt="" />			<p>Here is some text that will describe what is in the current issue</p>		</div>		</div><!-- /content -->				<div id="footer">		</div>	</div></body></html>