각종 소스창고/자바스크립트

한줄뉴스 TextSlider

아침한때비 2012. 3. 21. 18:24

 

<?php
#############################################################################################
# 프로포즈 성향
#############################################################################################
/*=====================================================================
성사된 프로포즈
=====================================================================*/
$yes_propose_sel = $db->sel("R_marry_propose", "where (`result`='yes' or `result`='settle_end')", "*");

$yes_propose_cnt = mysql_query("select count(*) from R_marry_propose where (`result`='yes' or `result`='settle_end') ");
$P_count = mysql_result($yes_propose_cnt,0,0);
$P_count = ($P_count > 0)? $P_count : "1";
/*=====================================================================
오늘의 프로포즈
=====================================================================*/
$today_propose_sel = $db->sel("R_marry_propose", "where `rdate`='$today_date'", "*");

$today_propose_cnt = mysql_query("select count(*) from R_marry_propose where `rdate`='$today_date'");
$T_count = mysql_result($today_propose_cnt,0,0);
$T_count = ($T_count > 0)? $T_count : "1";
?>

<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td>
<?php include"../RAD/rankup_notice/main_notice.html"; ?>
 <table  width="190" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td height="10"></td>
 </tr>
 <tr>
 <td>
 <!-- 프로포즈 통계 -->
  <table width="190" height="70" border="0" cellpadding="0" cellspacing="0" background="../images/main_right_propose_bg01.gif" align="right">
  <tr>
  <td width="50"></td>
  <td>

<table width="128" border="0" cellspacing="0" cellpadding="0">
<tr class="tc">
<td> <b>성사된 프로포즈</b> </td>
</tr>
<tr class="tc">
<td>

<!--뉴스스크롤이 들어갈 레이어 설정-->
<SCRIPT language="Javascript1.2">
<!--

    // 기본정의
    _TextSlider = function(className)
    {
        document.write("<div id='_TextSliderPLayer_"+ className +"'><div id='_TextSliderLayer_"+ className +"'></div></div>");

        this.item       = [];
        this.width      = this.height = this.speed = this.pixel = this.interval =
        this.size       = this.moveCount = this.X = this.Y = 0;
        this.direction  = "";
        this.pLayer     = document.getElementById("_TextSliderPLayer_"+ className);
        this.layer      = document.getElementById("_TextSliderLayer_"+ className);
        this.align      = "left";
        this.intervalId = null;
        this.className  = className;
        this.isPause    = false;
    }

    // 활성화
    _TextSlider.prototype.init = function()
    {
        with (this.pLayer.style)
        {
            width       = this.width+"px";
            height      = this.height+"px";
            overflow    = "hidden";
        }

        with (this.layer.style)
        {
            width       = this.direction=='up' || this.direction=='down' ? this.width+"px" : this.size*(this.item.length+1)+"px";
            height      = this.direction=='up' || this.direction=='down' ? this.size*(this.item.length+1)+"px" : this.height+"px";
            top         = 0;
            left        = 0;

            position    = "relative";
        }

        for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++)
            this.item[this.item.length] = this.item[i];

        switch (this.direction)
        {
            case "up":      this.X = this.Y = 0; break;
            case "down":    this.X = 0; this.layer.style.top = this.Y = -this.size*(this.item.length-parseInt(5)); break;
            case "left":    this.X = this.Y = 0; break;
            case "right":   this.Y = 0; this.layer.style.left = this.X = -this.width*(this.item.length-1); break;
        }

        var __html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";

        if (this.direction=='up' || this.direction=='down')
        {
            __html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
            for (var i in this.item)
                __html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='middle'>"+this.item[i]+"</td></tr>";
            __html += "</table>";
        }
        else
        {
            __html += "<table cellspacing='0' cellpadding='0' border='0'><tr>";
            for (var i in this.item)
                __html += "<td width='"+this.size+"' height='"+ this.layer.style.height +"' align='"+this.align+"' \
                    valign='middle' style='overflow:hidden;'>"+this.item[i]+"</td>";
            __html += "</tr></table>";
        }
        __html += "</div>";
        this.layer.innerHTML = __html;

        setTimeout(this.className+".start()", 1000); // 시작후 멈추는 시간
    }

    // 액션 Start
    _TextSlider.prototype.start = function()
    {
        this.intervalId = setInterval(this.className+".move()", this.speed);
    }

    // 좌표이동
    _TextSlider.prototype.move = function()
    {
        if (this.isPause) return;
        switch (this.direction)
        {
            case "up":      this.Y -= this.pixel; break;
            case "down":    this.Y += this.pixel; break;
            case "left":    this.X -= this.pixel; break;
            case "right":   this.X += this.pixel; break;
        }

        if (this.direction=='up' || this.direction=='down')
        {
            if (Math.abs(this.Y)%this.size==0) this.stop();
            this.layer.style.top = this.Y;
        }
        else
        {
            if (Math.abs(this.X)%parseInt(100)==0) this.stop();
            this.layer.style.left = this.X;
        }
    }

    // direction에 따라 Stop/좌표지정
    _TextSlider.prototype.stop = function()
    {
        clearInterval(this.intervalId);

        switch (this.direction)
        {
            case "up":
                if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
                break;

            case "down":
                if (Math.abs(this.Y) <= 0) this.Y = this.layer.style.top = -this.size*(this.item.length-parseInt(5))
                break;

            case "left":
                if (Math.abs(this.X) >= parseInt(100)*parseInt(34)) this.X = this.layer.style.left = 0;
                break;

            case "right":
                if (Math.abs(this.X) <= 0) this.X = this.layer.style.left = -this.width*(this.item.length-1);
                break;
        }

        setTimeout(this.className+".start()", this.interval);
    }

    // Pause : Unpause
    _TextSlider.prototype.pause = function() {this.isPause = true;}
    _TextSlider.prototype.unpause = function() {this.isPause = false;}

// 기본설정
var _PM1         = new _TextSlider('_PM1');    // 클래스 명을 인자로 넘긴다.
_PM1.width       = 128;       // Ticker의 가로길이
_PM1.height      = 30;      // Ticker의 세로길이
_PM1.speed       = 6;                        // text가 slide되는 빠르기. 단위는 ms
_PM1.pixel       = 1;                        // text가 한번 slide할 때 움직일 픽셀.
_PM1.interval    = 4000;                     // text가 slide된 후 다음 text가 slide되기 까지의 대기시간
_PM1.size        = 30;                       // text간의 간격. height와 같거나 크게 하여야 제대로 보인다.
_PM1.direction   = 'up';        // text가 slide될 방향
var noImgSrc = "";


<?php
for($i=0; $i < $P_count; $i++) {
$yes_propose_row = mysql_fetch_array($yes_propose_sel['result']);
$Gid = substr($yes_propose_row[Gid],0,1)."****";
$Pid = substr($yes_propose_row[Pid],0,1)."****";

$send_method = $yes_propose_row[send_method];
if($send_method == 'tel') {
 $msg_V = "전화프로포즈";
} else if($send_method == 'msn') {
    $msg_V = "메일프로포즈";
} else if($send_method == 'oneAone') {
    $msg_V = "1:1만남";
} else if($send_method == 'email') {
    $msg_V = "메일프로포즈";
}

?>

 _PM1.item[<?php echo $i;?>]  = "<div style='width:128;height:30px;overflow:hidden'>"
 _PM1.item[<?php echo $i;?>]  += "<table cellpadding='0' cellspacing='0' width='128'>"
 _PM1.item[<?php echo $i;?>]  += "    <tr>"
 _PM1.item[<?php echo $i;?>]  += "        <td style='padding:1;'>"
 _PM1.item[<?php echo $i;?>]  += "            <p align='center'>[<?php echo $msg_V;?>]</p>"
 _PM1.item[<?php echo $i;?>]  += "        </td>"
 _PM1.item[<?php echo $i;?>]  += "    </tr>"
 _PM1.item[<?php echo $i;?>]  += "    <tr>"
 _PM1.item[<?php echo $i;?>]  += "        <td style='padding:1;'>"
 _PM1.item[<?php echo $i;?>]  += "            <p align='center'><img src='../images/man.bmp'> <?php echo $Pid;?> ♥ <img src='../images/women.bmp'> <?php echo $Gid;?></p>"
 _PM1.item[<?php echo $i;?>]  += "        </td>"
 _PM1.item[<?php echo $i;?>]  += "    </tr>"
 _PM1.item[<?php echo $i;?>]  += "</table>"
 _PM1.item[<?php echo $i;?>]  += "</div>"

<?php } ?>


_PM1.init(); // _TextSlider의 작동을 지시한다.

//-->
</script>


<!--뉴스 스크롤이 들어갈 레이어 설정 끝--> 
</td>
</tr>
</table>

  </td>
  </tr>
  </table>
 </td>
 </tr>
 <tr>
 <td>
 <!-- 프로포즈 통계 -->
  <table width="190" height="70" border="0" cellpadding="0" cellspacing="0" background="../images/main_right_propose_bg01.gif" align="right">
  <tr>
  <td width="50"></td>
  <td>

<table width="128" border="0" cellspacing="0" cellpadding="0">
<tr class="tc">
<td> <b>오늘의 프로포즈</b> </td>
</tr>
<tr class="tc">
<td>

<!--뉴스스크롤이 들어갈 레이어 설정-->
<SCRIPT language="Javascript1.2">
<!--
// 기본설정
var _PM2         = new _TextSlider('_PM2');    // 클래스 명을 인자로 넘긴다.
_PM2.width       = 128;       // Ticker의 가로길이
_PM2.height      = 30;      // Ticker의 세로길이
_PM2.speed       = 6;                        // text가 slide되는 빠르기. 단위는 ms
_PM2.pixel       = 1;                        // text가 한번 slide할 때 움직일 픽셀.
_PM2.interval    = 4000;                     // text가 slide된 후 다음 text가 slide되기 까지의 대기시간
_PM2.size        = 30;                       // text간의 간격. height와 같거나 크게 하여야 제대로 보인다.
_PM2.direction   = 'up';        // text가 slide될 방향
var noImgSrc = "";

<?php
for($i=0; $i < $T_count; $i++) {
$today_propose_row = mysql_fetch_array($today_propose_sel['result']);
$Gid = substr($today_propose_row[Gid],0,1)."****";
$Pid = substr($today_propose_row[Pid],0,1)."****";

$send_method = $today_propose_row[send_method];
if($send_method == 'tel') {
 $msg_V = "전화프로포즈";
} else if($send_method == 'msn') {
    $msg_V = "메일프로포즈";
} else if($send_method == 'oneAone') {
    $msg_V = "1:1만남";
} else if($send_method == 'email') {
    $msg_V = "메일프로포즈";
}

?>

 _PM2.item[<?php echo $i;?>]  = "<div style='width:128;height:30px;overflow:hidden'>"
 _PM2.item[<?php echo $i;?>]  += "<table cellpadding='0' cellspacing='0' width='128'>"
 _PM2.item[<?php echo $i;?>]  += "    <tr>"
 _PM2.item[<?php echo $i;?>]  += "        <td style='padding:1;'>"
 _PM2.item[<?php echo $i;?>]  += "            <p align='center'>[<?php echo $msg_V;?>]</p>"
 _PM2.item[<?php echo $i;?>]  += "        </td>"
 _PM2.item[<?php echo $i;?>]  += "    </tr>"
 _PM2.item[<?php echo $i;?>]  += "    <tr>"
 _PM2.item[<?php echo $i;?>]  += "        <td style='padding:1;'>"
 _PM2.item[<?php echo $i;?>]  += "            <p align='center'><img src='../images/man.bmp'> <?php echo $Pid;?> ♥ <img src='../images/women.bmp'> <?php echo $Gid;?></p>"
 _PM2.item[<?php echo $i;?>]  += "        </td>"
 _PM2.item[<?php echo $i;?>]  += "    </tr>"
 _PM2.item[<?php echo $i;?>]  += "</table>"
 _PM2.item[<?php echo $i;?>]  += "</div>"

<?php } ?>


_PM2.init(); // _TextSlider의 작동을 지시한다.

//-->
</script>


<!--뉴스 스크롤이 들어갈 레이어 설정 끝--> 
</td>
</tr>
</table>

  </td>
  </tr>
  </table>
 </td>
 </tr>
 <tr>
 <td height="10"></td>
 </tr>
 <tr>
 <td>
  <table width="190" border="0" cellspacing="0" cellpadding="0" align="right">
  <tr>
  <td height="18"><a href="../etc/service_guide.html"><img src="../images/main_right_service.gif" border=0></a></td>
  </tr>
  <?php if($Eenvi_row['oneAone_use'] == 'yes') :?>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr>
  <td bgcolor="f4f7fa" onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=meet&s_no=14','simul','scrollbars=no resizable=no');return false">1:1만남</a></td>
  </tr>
  <?php endif;?>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr bgcolor="fdf9fe">
  <td onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=tel&s_no=14','simul','scrollbars=no resizable=no');return false">전화프로포즈</a></td>
  </tr>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr>
  <td bgcolor="f4f7fa" onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=mail&s_no=15','simul','scrollbars=no resizable=no');return false">메일프로포즈</a></td>
  </tr>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr bgcolor="fdf9fe">
  <td onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=msn&s_no=14','simul','scrollbars=no resizable=no');return false">메신저프로포즈</a></td>
  </tr>

  <?php if($Eenvi_row['unlimited_all_use'] == 'yes') :?>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr>
  <td bgcolor="f4f7fa" onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=full&s_no=5','simul','scrollbars=no resizable=no');return false">무제한프로포즈</a></td>
  </tr>
  <?php endif; ?>


  <?php if($Eenvi_row['jung_member_use'] == 'yes') :?>
  <tr bgcolor="e4e4e4"><td></td></tr>
  <tr bgcolor="fdf9fe">
  <td onMouseOver=this.style.backgroundColor='ffffff' onMouseOut=this.style.backgroundColor='' height=26><img src="../images/main_right_service_icon.gif"><a href="#" onClick="window.open('../etc/simulation.html?simul=jung&s_no=10','simul','scrollbars=no resizable=no');return false">정회원서비스</a></td>
  </tr>
  <?php endif; ?>
  <tr bgcolor="e4e4e4"><td></td></tr>
  </table>
 </td>
 </tr>
 <tr>
 <td height="5"></td>
 </tr>
 <?php if($Eenvi_row['manager_match_use']=='yes') :?>
 <tr>
 <td align="right"><a href="../manager/manager_guide.html"><img src="../images/main_right_managermatching.gif" border="0"></a></td>
 </tr>
 <tr>
 <td height="5"></td>
 </tr>
 <?php endif;?>
 <?php
 #########################################################################################
 # 커플매니저
 #########################################################################################
 ?>
 <tr><td><?php include "../include/right_couple_manager.html";?></td></tr>
 <tr>
 <td height="5"></td>
 </tr>
 <tr>
 <td align="right">
 <?php include "../RAD/rankup_poll/main_poll.html"; ?>
 </td>
 </tr>
 <tr>
 <td height="5"></td>
 </tr>
 </table>

<?php echo $often->banner_view('right_banner');?>
</td>
</tr>
</table>