хочу сделать задержку перед появлением новой строки но что то ковырял ковырял и так не получилось, вид курсора поменял на одинаковый а вот задержку не сделал
<?php
/**
* @version $Id: mod_char_ge.php,v 1.0 22.05.2005 14:28:13 Alecfyz Exp $
* Autor Alecfyz
* @copyright (C) 2005 Gorsk.net Studio
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$moduleclass_sfx = $params->get("moduleclass_sfx");
$CharTypeTextSize = $params->get("CharTypeTextSize");
$CharTypeTextColor = $params->get("CharTypeTextColor");
$CharTypeBGColor = $params->get("CharTypeBGColor");
$CharTypeText1 = $params->get("CharTypeText1");
$CharTypeText2 = $params->get("CharTypeText2");
$CharTypeText3 = $params->get("CharTypeText3");
$CharTypeText4 = $params->get("CharTypeText4");
$CharTypeText5 = $params->get("CharTypeText5");
$CharTypeText6 = $params->get("CharTypeText6");
$CharTypeSpeed = $params->get("CharTypeSpeed");
// Block to uncomment #1
/*global $database;
$cnt=0;
//++++++++++++++++
function getNewsFlash( $database, $limit=0, $how=null, $catid=3, $order='asc' ) {
global $my, $mosConfig_offset;
if($limit>0) {
$limit = "LIMIT $limit";
} else {
$limit = "";
}
$now = date( "Y-m-d H:i:s", time()+$mosConfig_offset*60*60 );
switch($how) {
case 'random': $query="SELECT a.id"
."\n FROM #__content AS a"
."\n INNER JOIN #__categories AS b ON b.id = a.catid"
."\n WHERE a.state = 1"
."\n AND a.access <= ". $my->gid .""
."\n AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '". $now ."') "
."\n AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '". $now ."')"
."\n AND catid='". $catid ."' "
."\n ORDER BY RAND() $limit";
break;
default: $query="SELECT a.id"
."\n FROM #__content AS a"
."\n INNER JOIN #__categories AS b ON b.id = a.catid"
."\n WHERE a.state = 1"
."\n AND a.access <= ". $my->gid .""
."\n AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '". $now ."') "
."\n AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '". $now ."')"
."\n AND catid='". $catid ."' "
."\n ORDER BY a.id $order $limit";
break;
}
$database->setQuery( $query );
$rows = $database->loadResultArray();
return $rows;
} // end getNewsFlash
//----------------
$rows = getNewsFlash( $database, 5, random, 3, asc);
$counter=1;
$start=0;
$dlina=40;
$offset=1;
*/
echo '<table border="0" align="center" width="100%" height="10" class="moduletable'.$moduleclass_sfx.'"><tr><td>';
// Block to uncomment #2
/*
$row1 = new mosContent( $database );
foreach($rows as $row) {
$row1->load( $row );
$row1->introtext = eregi_replace('{mos.*}','',$row1->introtext); // doesn't work
$row1->text = $row1->introtext;
//їшёђшь юђ ђ§уют +++
$pattern = "/(<.[0-9a-zA-Zр-џР-п\x20\_\-\.\!\?\,\&\#]*.>)/";
$row1->text=preg_replace($pattern, "", $row1->text);
//їшёђшь юђ ђ§уют ---
for ($counter=1;$counter<=6;$counter++) {
$dlina = strpos($row1->text,'***');
$tmp_string = substr ( $row1->text, $start, $dlina );
switch ($counter) {
case '1' :
if ($tmp_string<>"") {
$CharTypeText1 = $tmp_string." ";}
else {$CharTypeText1 = "";}
case '2' :
if ($tmp_string<>"") {
$CharTypeText2 = $tmp_string." ";}
else {$CharTypeText2 = "";}
case '3' :
if ($tmp_string<>"") {
$CharTypeText3 = $tmp_string." ";}
else {$CharTypeText3 = "";}
case '4' :
if ($tmp_string<>"") {
$CharTypeText4 = $tmp_string." ";}
else {$CharTypeText4 = "";}
case '5' :
if ($tmp_string<>"") {
$CharTypeText5 = $tmp_string." ";}
else {$CharTypeText5 = "";}
case '6' :
if ($tmp_string<>"") {
$CharTypeText6 = $tmp_string." ";}
else {$CharTypeText6 = "";}
};
$row1->text = substr_replace ( $row1->text, '', 0 , $dlina+3 );
} // for
$cnt++;
}
*/
echo '<script language="JavaScript1.2">
//Secify scroller contents
var line=new Array()
line[1]="'.$CharTypeText1.'"
line[2]="'.$CharTypeText2.'"
line[3]="'.$CharTypeText3.'"
line[4]="'.$CharTypeText4.'"
line[5]="'.$CharTypeText5.'"
line[6]="'.$CharTypeText6.'"
//Specify font size for scoller
var ts_fontsize="'.$CharTypeTextSize.'"
var ts_fontcolor="'.$CharTypeTextColor.'"
var ts_bgcolor="'.$CharTypeBGColor.'"
var longestmessage=1
for (i=2;i<line.length;i++){
if (line[i].length>line[longestmessage].length)
longestmessage=i
}
//Auto set scroller width
var tscroller_width=line[longestmessage].length
lines=line.length-1 //--Number of lines
//if IE 4+ or NS6
if (document.all||document.getElementById){
document.write(\'<form name="bannerform">\')
document.write(\'<input type="text" name="banner" size="\'+tscroller_width+\'"\')
document.write(\' style="background-color: \'+ts_bgcolor+\'; color: \'+ts_fontcolor+\'; font-family: verdana; font-size: \'+ts_fontsize+\'; font-weight:bold; border: medium none" onfocus="blur()">\')
document.write(\'</form>\')
}
temp=""
nextchar=-1;
nextline=1;
cursor="\\\\"
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)} [b][color=red]думал что менять задержку тут но не фига не работает [/color][/b]
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)} [b][color=red]думал что менять задержку тут но не фига не работает [/color][/b]
else{
nextstep()}}
function nextstep(){ [b][color=red] тут я поменял курсор
[/color][/b]
if (cursor=="\\\\"){
cursor="\\\"}
else if (cursor=="|"){
cursor="\\\"}
else if (cursor=="/"){
cursor="\\\"}
else if (cursor=="-"){
cursor="\\\\"}
nextchar++;
temp+=line[nextline].charAt(nextchar);
document.bannerform.banner.value=temp+cursor
setTimeout("animate()",'.$CharTypeSpeed.')}
//if IE 4+ or NS6
if (document.all||document.getElementById)
window.onload=animate
// -->
animate()
</script>';
//---------------
//-------------------------------------
echo '</td></tr></table>';
?>