The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: bleh | January 15, 2009 @ 7:04am
PHP Code
[
Download
]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php $curdir = getcwd (); chdir('/forum'); require_once('/global.php'); chdir ($curdir); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Svex</title> <?php include 'header.php'; ?> <link rel="stylesheet" type="text/css" href="scripts/css/svex.css" /> <script src="scripts/js/svexmenu.js" type="text/javascript"> </script> <style type="text/css"> <!-- div.svexmenu {color:#5B6275; font-family: Arial; font-size: 17px} div.svexmenu a {color:#5B6275; font-family: Arial; font-size: 17px} div.svexmenu a:hover {color:#3C404D; font-family: Arial; font-size: 17px} div.svextitle {color:#FFFFFF; font-family: Arial; font-size: 22px} div.svextitle a {color:#FFFFFF; font-family: Arial; font-size: 22px} div.svextitle a:hover {color:#5B6275; font-family: Arial; font-size: 22px} div.svexuser {color:#DCDFE1; font-family: Arial; font-size: 17px} div.svexuser a {color:#DCDFE1; font-family: Arial; font-size: 17px} div.svexuser a:hover {color:#5B6275; font-family: Arial; font-size: 17px} .style34 { font-family: Arial; color: #5B6275; } a:link { color: #FFFFFF; } a:visited { color: #FFFFFF; } a:hover { color: #A8AEB8; } a:active { color: #FFFFFF; } .style36 {color: #000000} body,td,th { color: #FFFFFF; } --> </style> </head> <body style="background-color: white;"> <div id="main" style="width: 900px; padding-left: 1px; margin: auto;"> <div id="navigatorhead" style="width: 900px; height: 21px; background-image: url(images/svex/navigator.jpg);" > <div class= "svexmenu" style="width: 900px; height: 18px; padding-bottom: 3px; "> <span class="style49 style34">SVEX Navigator</span></div> </div> <div style="width: 900px; height: 1px;"></div> <div id="navigator"> </div> <div id="svexible" style="width: 748px; height: 46px; float: right; padding-top: 1px; background-image:url(images/svex/quicknav.jpg);"> <div class="style49" style="height: 18px; width: 700px; padding-left: 12px; padding-top: 13px;"><span class="style46">Simvision Exchange </span> <? $url = $_SERVER['SERVER_NAME']; $page = $_SERVER['php_SELF']; $file = $_SERVER['REQUEST_URI']; ?> <?php // Delimiters may be slash, dot, or hyphen $contentsc = $file; list($pagenumber, $pagenum) = split('[=]', $contentsc); ?> <?php if ( $pagenum <= 4 ) { $count = 147; $pv = $count / 6; $round = ceil($pv); $pvn = 2; $tpn = 10; for ( $pn = $pvn; $pn <= $round; $pn += 1) { /* starting from a value */ ?> <a href="http://simvision.net/tpp/svexy.php?pageid=<?php echo $pn ?>"><?php echo $pn ?></a> <?php if ($pn == $tpn) { /* breaking*/ break; } ?> <?php /* */ } } else { $count = 147; /* total bats */ $pv = $count / 6; /* bats for each page*/ $lvv = $pagenum - 3; $ltpn = $pagenum - 1; for ( $lpn = $lvv; $lpn <= $pv; $lpn += 1) { /* starting from a value */ ?> <a href="http://simvision.net/tpp/svexy.php?pageid=<?php echo $lpn ?>"><?php echo $lpn ?></a> <?php if ($lpn == $ltpn) { /* breaking*/ break; } ?> <?php /* */ } ?> <?php echo $pagenum; ?> <?php $pvn = $pagenum + 1; /* display previous two pages */ $tpn = $pvn + 5; /* display current page and next 5 pages */ $round = ceil($pv); for ( $pn = $pvn; $pn <= $round; $pn += 1) { /* starting from a value */ ?> <a href="http://simvision.net/tpp/svexy.php?pageid=<?php echo $pn ?>"><?php echo $pn ?></a> <?php if ($pn == $tpn) { /* breaking*/ break; } ?> <?php /* */ } } ?> </div> </div> <?php $host=""; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name=""; // Database name $tbl_name=""; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql = "SELECT * FROM WHERE cat1 = 'SimCity 4' AND validator !='' ORDER BY id DESC LIMIT 0,6"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $sql = "SELECT * FROM WHERE cat1 = 'SimCity 4' AND validator !='' ORDER BY id DESC LIMIT 0,6"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)) { ?> <div style="width:748px; height: 206px; float: left; background-color:#A8AEB8; "> <div style="width: 748px; height: 21px; float: left; background-image:url(images/index/common/headblue.jpg);"> <?php echo $row['cat2']; ?> > <?php echo $row['cat3']; ?> </div> <div style="width:748px; height:185px; float: left;"> <div style="width: 270px; height: 200px; float: left; "> <div style="width: 261px; height: 148px; padding-left: 8px; padding-top: 12px;"><img src="<?php echo $row['thumburl1']; ?>" alt="" width="254" height="148" border="3" style="border-color: #5B6275;" /></div> </div> <div class="svextitle" style="width: 472px; padding-left: 6px; float: left; "><a href="http://simvision.net/svex.php?p=details&id=<?php echo $row['id']; ?> "><?php echo $row['name']; ?></a></div> <div class="svexuser" style="width: 472px; padding-left: 6px; float: left; "> <a href="http://www.simvision.net/svex.php?p=user&id=<?php echo $row['userid']; ?>">by <?php echo $row['username']; ?></a></div> <div style="width: 472px; padding-left: 6px; float: left; height: 98px;"> <?php echo substr($row['descrip'],0,125); ?>...</div> <div style="width: 472px; height:34px; padding-left: 3px; height: 40px; background-color:#B5B5B5; float: left;"> <div style="padding-top: 6px; padding-left: 6px; float: left;"> <?=date("F j, Y",$row["dt"])?> | Views <?php echo $row['views']; ?> | Downloads: <?php echo $row['dls']; ?> | <?php $score = $row['score']; $votes = $row['votes']; if ( $votes == 0 ) { echo "No Votes"; } else { $total = $score / $votes; $stars = $total / 2; $starstotal = ceil($stars); switch ($starstotal){ case "1": ?> <img src="images/index/common/star.png" /><?php break; case "2": ?><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /> <?php break; case "3": ?><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /> <?php break; case "4": ?><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /> <?php break; case "5": ?><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /><img src="images/index/common/star.png" /> <?php break; } } ?> </div> </div> </div> <div style="width: 748px; height: 8px; float: left; background-color: #FFFFFF; ">Testing 1..2..3 </div> </div> </div> <span style="width: 900px; padding-left: 1px; margin: auto;"> <?php } ?> </span> </body> </html>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.65 / 8
147 Votes
http://codebin.yi.org/214
page generated in 0.00 seconds