1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <?php
  4. $curdir = getcwd ();
  5. chdir('/hsphere/local/home/barbulam/simvision.net/forum');
  6. require_once('/hsphere/local/home/barbulam/simvision.net/forum/global.php');
  7. chdir ($curdir);
  8. ?>
  9.  
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <head>
  12. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  13. <title>Untitled Document</title>
  14. <style type="text/css">
  15. <!--
  16. #svexy {width: 900px; margin: auto; height: 200px; background:#A8AEB8;}
  17. #header {background: #7F8595; height: 30px; width:900px; position: relative, top; }
  18. #download {width: 900px; margin:auto; height: 170px; position: relative, top;}
  19. #thumb {height: 170px; width: 240px; float: left; position: relative, left;}
  20. #description {height: 170px; width:420px; float: left; position: relative, center; }
  21. #right {height: 170px; width: 240px; float: left; position: relative, right;}
  22.  
  23.  
  24.  
  25.  
  26. -->
  27. </style>
  28.  
  29. <script type="text/javascript">
  30.  
  31. /***********************************************
  32. * Contractible Headers script- © Dynamic Drive (www.dynamicdrive.com)
  33. * This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
  34. * Visit http://www.dynamicdrive.com/ for full source code
  35. ***********************************************/
  36.  
  37. var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
  38. var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)
  39.  
  40. if (document.getElementById){
  41. document.write('<style type="text/css">')
  42. document.write('.switchcontent{display:none;}')
  43. document.write('</style>')
  44. }
  45.  
  46. function getElementbyClass(classname){
  47. ccollect=new Array()
  48. var inc=0
  49. var alltags=document.all? document.all : document.getElementsByTagName("*")
  50. for (i=0; i<alltags.length; i++){
  51. if (alltags[i].className==classname)
  52. ccollect[inc++]=alltags[i]
  53. }
  54. }
  55.  
  56. function contractcontent(omit){
  57. var inc=0
  58. while (ccollect[inc]){
  59. if (ccollect[inc].id!=omit)
  60. ccollect[inc].style.display="none"
  61. inc++
  62. }
  63. }
  64.  
  65. function expandcontent(cid){
  66. if (typeof ccollect!="undefined"){
  67. if (collapseprevious=="yes")
  68. contractcontent(cid)
  69. document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
  70. }
  71. }
  72.  
  73. function revivecontent(){
  74. contractcontent("omitnothing")
  75. selectedItem=getselectedItem()
  76. selectedComponents=selectedItem.split("|")
  77. for (i=0; i<selectedComponents.length-1; i++)
  78. document.getElementById(selectedComponents[i]).style.display="block"
  79. }
  80.  
  81. function get_cookie(Name) {
  82. var search = Name + "="
  83. var returnvalue = "";
  84. if (document.cookie.length > 0) {
  85. offset = document.cookie.indexOf(search)
  86. if (offset != -1) {
  87. offset += search.length
  88. end = document.cookie.indexOf(";", offset);
  89. if (end == -1) end = document.cookie.length;
  90. returnvalue=unescape(document.cookie.substring(offset, end))
  91. }
  92. }
  93. return returnvalue;
  94. }
  95.  
  96. function getselectedItem(){
  97. if (get_cookie(window.location.pathname) != ""){
  98. selectedItem=get_cookie(window.location.pathname)
  99. return selectedItem
  100. }
  101. else
  102. return ""
  103. }
  104.  
  105. function saveswitchstate(){
  106. var inc=0, selectedItem=""
  107. while (ccollect[inc]){
  108. if (ccollect[inc].style.display=="block")
  109. selectedItem+=ccollect[inc].id+"|"
  110. inc++
  111. }
  112.  
  113. document.cookie=window.location.pathname+"="+selectedItem
  114. }
  115.  
  116. function do_onload(){
  117. uniqueidn=window.location.pathname+"firsttimeload"
  118. getElementbyClass("switchcontent")
  119. if (enablepersist=="on" && typeof ccollect!="undefined"){
  120. document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
  121. firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
  122. if (!firsttimeload)
  123. revivecontent()
  124. }
  125. }
  126.  
  127.  
  128. if (window.addEventListener)
  129. window.addEventListener("load", do_onload, false)
  130. else if (window.attachEvent)
  131. window.attachEvent("onload", do_onload)
  132. else if (document.getElementById)
  133. window.onload=do_onload
  134.  
  135. if (enablepersist=="on" && document.getElementById)
  136. window.onunload=saveswitchstate
  137.  
  138. </script>
  139. <div style="width: 900px; margin: auto; height: 60px; background:#999999;"> </div>
  140.  
  141. </head>
  142.  
  143. <body>
  144.  
  145. <?php
  146.  
  147.  
  148. // Connect to server and select databse.
  149. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  150. mysql_select_db("$db_name")or die("cannot select DB");
  151.  
  152.  
  153. $sql = "SELECT * FROM WHERE cat1 = 'SimCity 4' AND validator !='' ORDER BY id DESC LIMIT 0,6";
  154. $result=mysql_query($sql);
  155.  
  156. $rows=mysql_fetch_array($result);
  157.  
  158. $sql = "SELECT * FROM WHERE cat1 = 'SimCity 4' AND validator !='' ORDER BY id DESC LIMIT 0,6";
  159. $query = mysql_query($sql);
  160. while($row = mysql_fetch_array($query)) {
  161.  
  162. ?><div id="svexy">
  163. <div id="header" onClick="expandcontent('<?php echo $row['id']; ?>')" style="cursor:hand; cursor:pointer"> <a href="http://simvision.net/svex.php?p=details&id=<?php echo $row['id']; ?> "><?php echo $row['name']; ?></a> by <a href="http://www.simvision.net/svex.php?p=user&id=<?php echo $row['userid']; ?>"><?php echo $row['username']; ?></a> </div>
  164. <div id="download">
  165. <div id="thumb"><img src="<?php echo $row['thumburl1']; ?>" alt="" width="200" height="148" border="3" style="border-color: #5B6275;"
  166. /></div>
  167. <div id="description"><?php echo substr($row['descrip'],0,125); ?> </div>
  168. <div id="right"> Download Here </div>
  169. </div>
  170. <div id="<?php echo $row['id']; ?>" class="switchcontent" style="background: #7F8595; height: 200px; width:900px; position: relative;"> sup yall </div>
  171. </div>
  172. <?php } ?>
  173. </body>
  174. </html>
  175.