Recommended Servers - Topics UP



Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Modulo/codigo Event Time Mucore 1.8  (Visto 1647 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline darkenix Posteado: May 11, 2017, 10:17:36 PM | Modificado: May 12, 2017, 10:50:37 AM by ZabiinoOo

Mucore 1.8
Files usados: http://tuservermu.com.ve/index.php?topic=13.0

Holas a todos, ya he logrado grandes avances en mi proyecto, pero me gustaría agregar un sistema de tiempo de eventos para saber cuanto tiempo queda para los siguientes Eventos:

  • Blood Castle
  • Devil Square
  • Invacion de dragones, etc.

No me importa si es un modulo o un código, me gustaría algo como:

Code: [Select]
<?
$statistics_accounts=mssql_query("SELECT count(*) G_Name FROM MuOnline.dbo.Guild");
while($row=mssql_fetch_assoc($statistics_accounts)){
$core['guild_reults']=$row['G_Name'];?>
<?=$core['guild_reults'];?>
<?} ?>

Para modificarlo a mi gusto dentro de la plantilla, gracias de ante mano.

Gracias:


Offline Xysad #1 Posteado: May 12, 2017, 02:28:42 AM

  • Php Coder
  • 0 puntos por ventas
  • *
  • *
  • Rank: Puto amo
  • Posts: 279
  • Gracias recibida: 1202
  • ar
Spoiler for Hiden:
Code: [Select]
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>
var Events = {};

Events.text = [
['starts in ', '<font color="green">open, to start </font>'],
['will appear in ', '<font color="red">hurry up, left </font>']
];

Events.sked = [
['Blood Castle - ', 0, '00:00', '04:00', '08:00', '12:00', '16:00', '20:00'],
['Devil Square - ', 0, '02:30', '06:30', '10:30', '14:30', '18:30', '22:30'],
['Chaos Castle - ', 0, '01:00', '05:00', '09:00', '13:00', '17:00', '21:00'],
['White Wizard - ', 0, '03:30', '06:30', '09:30', '12:30', '15:30', '18:30', '21:30'],
['Golden Invasion - ', 0, '00:00', '06:00', '12:00', '18:00'],
['Loren Deep - ', 0, '18:00'],
['HAPPY HOUR - ', 0, '21:00'],
];

Events.init = function(e)
{
if (typeof e == "string") var g = new Date(new Date().toString().replace(/\d+:\d+:\d+/g, e));

var f = (typeof e == "number" ? e : (g.getHours() * 60 + g.getMinutes()) * 60 + g.getSeconds()),
q = Events.sked,
j = [];

for (var a = 0; a < q.length; a++)
{
var n = q[a];
for (var k = 2; k < q[a].length; k++)
{
var b = 0,
p = q[a][k].split(":"),
o = (p[0] * 60 + p[1] * 1) * 60,
c = q[a][2].split(":");

if (q[a].length - 1 == k && (o - f) < 0) b = 1;

var r = b ? (1440 * 60 - f) + ((c[0] * 60 + c[1] * 1) * 60) : o - f;

if (f <= o || b)
{
var l = Math.floor((r / 60) / 60),
l = l < 10 ? "0" + l : l,
d = Math.floor((r / 60) % 60),
d = d < 10 ? "0" + d : d,
u = r % 60,
u = u < 10 ? "0" + u : u;
j.push('<div class="event">' + '<b class="time" style="color: #FFBF00;">' + n[0] + q[a][b ? 2 : k] + '</b><div class="small"><span>' + (Events.text[q[a][1]][+(l == 0 && d < (q[a][1] ? 1 : 5))]) + "</span>" + (l + ":" + d + ":" + u) + "</div></div>");
break;
};
};
};
document.getElementById("events").innerHTML = j.join("");

setTimeout(function()
{
Events.init(f == 86400 ? 1 : ++f);
}, 1000);
};

jQuery(document).ready(function($)
{
var d = new Date();
hh = d.getUTCHours() + 3, mm = d.getMinutes(), ss = d.getSeconds();

if (hh >= 24)
{
hh = hh - 24;
}

if (hh <= 9)
{
hh = "0" + hh;
}

if (mm <= 9)
{
mm = "0" + mm;
}

if (ss <= 9)
{
ss = "0" + ss;
}

Events.init(hh + ":" + mm + ":" + ss);
});
</script>

<div class="xysad" id="events"></div>

Gracias:


Offline darkenix #2 Posteado: May 12, 2017, 09:34:27 AM

Funciono perfectamente y sin problema algun, ahora voy a decorarlo y lo dejare hermoso, muchas gracias :).


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Recommended Servers - Topics Bottom



 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1205 Views
Last post May 18, 2017, 04:02:30 PM
by Azzlaer
1 Replies
610 Views
Last post May 24, 2017, 06:05:18 PM
by FrancoB
1 Replies
617 Views
Last post July 06, 2017, 01:05:16 PM
by Azzlaer
6 Replies
898 Views
Last post April 12, 2019, 10:11:22 PM
by ASTRAL
32 Replies
842 Views
Last post October 31, 2020, 07:05:18 AM
by andiixu