※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

「top.php」の編集履歴(バックアップ)一覧はこちら

top.php」の最新版変更点

追加された行は青色になります。

削除された行は赤色になります。

--[[アップロード>http://www16.atwiki.jp/amazonz?cmd=upload&act=open&pageid=38&file=top.php]]
+-[[アップロード>http://www16.atwiki.jp/amazonz/upload/38.html]]
 <?php require_once('Connections/connAmazon2.php'); ?>
 <?php
 $currentPage = $_SERVER["PHP_SELF"];
 
 $maxRows_rsAmazonz2 = 5;
 $pageNum_rsAmazonz2 = 0;
 if (isset($_GET['pageNum_rsAmazonz2'])) {
   $pageNum_rsAmazonz2 = $_GET['pageNum_rsAmazonz2'];
 }
 $startRow_rsAmazonz2 = $pageNum_rsAmazonz2 * $maxRows_rsAmazonz2;
 
 $colname_rsAmazonz2 = "%";
 if (isset($_GET['key'])) {
   $colname_rsAmazonz2 = (get_magic_quotes_gpc()) ? $_GET['key'] : addslashes($_GET['key']);
 }
 mysql_select_db($database_connAmazon2, $connAmazon2);
 $query_rsAmazonz2 = sprintf("SELECT * FROM amazonz_data WHERE topic LIKE '%%%s%%' ORDER BY uptime DESC", $colname_rsAmazonz2);
 $query_limit_rsAmazonz2 = sprintf("%s LIMIT %d, %d", $query_rsAmazonz2, $startRow_rsAmazonz2, $maxRows_rsAmazonz2);
 $rsAmazonz2 = mysql_query($query_limit_rsAmazonz2, $connAmazon2) or die(mysql_error());
 $row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2);
 
 if (isset($_GET['totalRows_rsAmazonz2'])) {
   $totalRows_rsAmazonz2 = $_GET['totalRows_rsAmazonz2'];
 } else {
   $all_rsAmazonz2 = mysql_query($query_rsAmazonz2);
   $totalRows_rsAmazonz2 = mysql_num_rows($all_rsAmazonz2);
 }
 $totalPages_rsAmazonz2 = ceil($totalRows_rsAmazonz2/$maxRows_rsAmazonz2)-1;
 
 $queryString_rsAmazonz2 = "";
 if (!empty($_SERVER['QUERY_STRING'])) {
   $params = explode("&", $_SERVER['QUERY_STRING']);
   $newParams = array();
   foreach ($params as $param) {
     if (stristr($param, "pageNum_rsAmazonz2") == false && 
         stristr($param, "totalRows_rsAmazonz2") == false) {
       array_push($newParams, $param);
     }
   }
   if (count($newParams) != 0) {
     $queryString_rsAmazonz2 = "&" . htmlentities(implode("&", $newParams));
   }
 }
 $queryString_rsAmazonz2 = sprintf("&totalRows_rsAmazonz2=%d%s", $totalRows_rsAmazonz2, $queryString_rsAmazonz2);
 ?>
 
 <?php
 // *** Validate request to login to this site.
 session_start();
 
 $loginFormAction = $_SERVER['PHP_SELF'];
 if (isset($accesscheck)) {
   $GLOBALS['PrevUrl'] = $accesscheck;
   session_register('PrevUrl');
 }
 
 if (isset($_POST['id'])) {
   $loginUsername=$_POST['id'];
   $password=$_POST['pass'];
   $MM_fldUserAuthorization = "";
   $MM_redirectLoginSuccess = "admin2.php";
   $MM_redirectLoginFailed = "account_cre.php";
   $MM_redirecttoReferrer = false;
   mysql_select_db($database_connAmazon2, $connAmazon2);
   
   $LoginRS__query=sprintf("SELECT id, pass FROM amazonz_user WHERE id='%s' AND pass='%s'",
     get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 
    
   $LoginRS = mysql_query($LoginRS__query, $connAmazon2) or die(mysql_error());
   $loginFoundUser = mysql_num_rows($LoginRS);
   if ($loginFoundUser) {
      $loginStrGroup = "";
     
     //セッション変数の宣言と割り当て
     $GLOBALS['MM_Username'] = $loginUsername;
     $GLOBALS['MM_UserGroup'] = $loginStrGroup;	      
 
     //セッション変数の登録
     session_register("MM_Username");
     session_register("MM_UserGroup");
 
     if (isset($_SESSION['PrevUrl']) && false) {
       $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
     }
     header("Location: " . $MM_redirectLoginSuccess );
   }
   else {
     header("Location: ". $MM_redirectLoginFailed );
   }
 }
 ?>
 
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
 <title>Amazonz </title>
 <link href="css.css" rel="stylesheet" type="text/css">
 <script language="JavaScript" type="text/JavaScript">
 <!--
 function MM_swapImgRestore() { //v3.0
   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
 }
 
 function MM_preloadImages() { //v3.0
   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
 }
 
 function MM_findObj(n, d) { //v4.01
   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
   if(!x && d.getElementById) x=d.getElementById(n); return x;
 }
 
 function MM_swapImage() { //v3.0
   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
 }
 //-->
 </script>
 
 </head>
 <body onLoad="MM_preloadImages('img/account2.jpg','img/key2.jpg','img/member2.jpg','img/kate2.jpg')">
    <div id="body_2"> 
        <div id="head"> 
 	   <div id="head1"></div>	   
        <div id="head2"></div>
    </div>
 	   
      <div id="main">
        <div id="menu">
            <div class="img1"><img src="img/menu1.jpg" width="180" height="24" class="img1"></div>
 		   <?php
 		   		if($_SESSION['MM_Username'] == ""){
 		   ?>	
 	       <div class="img1"><a href="account_cre2.php" class="img1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','img/account2.jpg',1)"><img src="img/account.jpg" alt="アカウントを作成する" name="Image6" width="180" height="40" hspace="0" vspace="0" border="0" class="img1"></a></div>
 		 <div class="img1"><img src="img/menu1.jpg" width="180" height="24" hspace="0" vspace="0" border="0" class="img1"></div>
 		
 		
 		<div id="login">
 		<form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
         ユーザーID:<input name="id" type="text"><br>
         パスワード:<input name="pass" type="password" id="pass"><br>
       <p><input type="submit" name="Submit" value="ログイン"></p>
 </form> 
         </div>
 		<?php
 		}else{
 		?>
 		<div class="img1"><?php echo ("ようこそ  " .$_SESSION['MM_Username']. "  さん"); ?><br><br>
 		<a href="admin2.php?doLogout=true">ログアウト</a>
 		</div>
 		
 		<?php
 		
 		}
 		?>
 		
 		
 		
 		 <div class="img1"><img src="img/menu1.jpg" width="180" height="24" hspace="0" vspace="0" border="0" class="img1"></div>
 		 <div class="img1"><a href="member_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','img/member2.jpg',1)"><img src="img/member.jpg" alt="メンバー検索" name="Image10" width="180" height="40" border="0"></a></div>
 		 <div class="img1"><a href="category_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','img/kate2.jpg',1)"><img src="img/kate.jpg" alt="カテゴリー検索" name="Image11" width="180" height="40" border="0"></a></div>
 		 
 	     <div class="img1"><a href="key_s.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','img/key2.jpg',1)"><img src="img/key.jpg" alt="キーワード検索" name="Image9" width="180" height="40" border="0"></a></div>
        </div>
          <div id="text">
 		 <img src="img/blank.jpg">
            <table width="450" border="0" align="center" cellpadding="3">
           <tr>
           <td><p>最近の記事<?php echo ($startRow_rsAmazonz2 + 1) ?> ~ <?php echo min($startRow_rsAmazonz2 + $maxRows_rsAmazonz2, $totalRows_rsAmazonz2) ?> 件 / 全 <?php echo $totalRows_rsAmazonz2 ?>
                       </p>
             <HR></td>
           </tr>
           
   <?php do { ?>
           <tr>
             <td><a name="<?php echo $row_rsAmazonz2['id']; ?>"><span class="style3"><?php echo $row_rsAmazonz2['uptime']; ?></span></name></td>
           </tr>
           <tr>
             <td><span class="style3"><?php echo $row_rsAmazonz2['title']; ?></span></td>
           </tr>
           <tr>
             <td>
 	<span class="style3">
 	<?php 
 		if($row_rsAmazonz2['category'] == 'MUSIC'){
 	?><img src="img/music.gif">
 	<?php
 	 }else if($row_rsAmazonz2['category'] == 'DVD'){
 	?><img src="img/dvd.gif">
 	<?php
 	 }else if($row_rsAmazonz2['category'] == 'BOOK'){
 	?><img src="img/book.gif">
 	<?php
 	 } 
 	?></span></td>
           </tr>
           <tr>
             <td><span class="style3"><?php echo  nl2br($row_rsAmazonz2['topic']); ?></span></td>
           </tr>
           <tr>
             <td><span class="style3"><?php echo $row_rsAmazonz2['uset_id']; ?></span></td>
           </tr>
           <tr>
             <td><hr></td>
           </tr>
           <?php } while ($row_rsAmazonz2 = mysql_fetch_assoc($rsAmazonz2)); ?>
            </table>
            <table border="0" width="50%" align="center">
           <tr>
             <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 > 0) { // Show if not first page ?>
               <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, 0, $queryString_rsAmazonz2); ?>">先頭</a>
               <?php } // Show if not first page ?>
             </td>
             <td width="31%" align="center"><?php if ($pageNum_rsAmazonz2 > 0) { // Show if not first page ?>
               <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, max(0, $pageNum_rsAmazonz2 - 1), $queryString_rsAmazonz2); ?>">戻る</a>
               <?php } // Show if not first page ?>
             </td>
             <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 < $totalPages_rsAmazonz2) { // Show if not last page ?>
               <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, min($totalPages_rsAmazonz2, $pageNum_rsAmazonz2 + 1), $queryString_rsAmazonz2); ?>">次へ</a>
               <?php } // Show if not last page ?>
             </td>
             <td width="23%" align="center"><?php if ($pageNum_rsAmazonz2 < $totalPages_rsAmazonz2) { // Show if not last page ?>
               <a href="<?php printf("%s?pageNum_rsAmazonz2=%d%s", $currentPage, $totalPages_rsAmazonz2, $queryString_rsAmazonz2); ?>">最終</a>
               <?php } // Show if not last page ?>
             </td>
           </tr>
            </table>
            <?php
              mysql_free_result($rsAmazonz2);
            ?>
            <p>&nbsp;</p>
          </div>
 		 <div id="under">
 		   <div id="under1"></div>
 		   <div id="under2"></div>
          </div>
      </div>
   </div>
 </body>
 </html>