A little coding help for module style

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    smile A little coding help for module style

    Ok so here the Events Timer module made by code master 4FUNer, looking like this :



    I want to edit it but after many tests I can't get the right coding to make it look as I want, like this :

    Want it like this :



    My additional wishes

    1. The table to be centered <center>
    2. Add a short event description under event timer.
    3. Keep the same style used by 4FUNer, that gray color.

    Link to download files needed for edit : Download eventsEpocal.rar from Sendspace.com - send big files the easy way

    PS : If someone could explain me how the module really works I mean that when I add a new event time, how do I know its the right time ? Example : I have golden invasion every 30 minutes, what settings shoud I use in ETconfig to add the timer for Golden Invasion every 30 minutes ?

    Thank you very much !


  2. #2
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    It's not my module, it's the one included in mfs web, i've added style to this & removed box lol.

    about request, you're so lazy, u will style it ur self ^^

    1. Use <center> tag before <table> tag or add to each table align ="center"

    2. Make code to read from cfg, like

    modify on events.php

    style="color:#FF6611;"></span></td></tr>';
    to
    style="color:#FF6611;"></span><br>'.$value['description'].'</td></tr>';

    & add in ETconfig.php

    New lines to each event (remember about number [X])

    $eventtime[1]['description'] = 'Fucking BC --------------------------------';

    Result


    3. FO

    about "how do you know it's right time", you can see in config
    define('WEBSITE_REAL_TIME', time());

    about adding new events

    [8] +1 for every new event

    $eventtime[8]['name'] = 'Golden Invasion'; <--- Name lol
    $eventtime[8]['start'] = 'Jan 01, 2013 01:00:00'; <--- Start Date (remember abt time changes (+1 -1)
    $eventtime[8]['repeattime'] = '1800'; < --- Repeat every X Seconds (1h = 3600)
    $eventtime[8]['opentime'] = '300'; <--- Msg time for how long in seconds (300 = 5min)
    $eventtime[8]['description'] = 'Fucking New Config';
    Last edited by 2009x2014; 24-07-13 at 03:20 PM. Reason: fkn typo

  3. #3
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Quote Originally Posted by 4FUNer View Post
    It's not my module, it's the one included in mfs web, i've added style to this & removed box lol.

    about request, you're so lazy, u will style it ur self ^^

    1. Use <center> tag before <table> tag

    2. Make code to read from cfg, like

    modify on events.php

    style="color:#FF6611;"></span></td></tr>';
    to
    style="color:#FF6611;"><br>'.$value['description'].'</span></td></tr>';

    & add in ETconfig.php

    New lines to each event (remember about number [X])

    $eventtime[1]['description'] = 'Fucking BC --------------------------------';

    Result


    3. FO

    about "how do you know it's right time", you can see in config
    define('WEBSITE_REAL_TIME', time());

    about adding new events

    [8] +1 for every new event

    $eventtime[8]['name'] = 'Golden Invasion'; <--- Name lol
    $eventtime[8]['start'] = 'Jan 01, 2013 01:00:00'; <--- Start Date (remember abt time changes (+1 -1)
    $eventtime[8]['repeattime'] = '1800'; < --- Repeat every X Seconds (1h = 3600)
    $eventtime[8]['opentime'] = '300'; <--- Msg time for how long in seconds (300 = 5min)
    $eventtime[8]['description'] = 'Fucking New Config';
    Code:
    ((WEBSITE_REAL_TIME - strtotime($value['start'])) % $value['repeattime']);
    	$startevents .= 'eventstime('.$bc_remain.', '.$value['repeattime'].', \'event'.$i.'\', '.$value['opentime'].'); ';
    	echo '<tr id="customRbg" height="25"><td align="center">'.$value['name'].': <span id="event'.$i.'" style="color:#FF6611;"><br>'.$value['description'].'</span></td></tr>';
    }
    echo '<script type="text/javascript">'.$startevents.'</script>
    </table>';
    ?>
    <style>
    .customRTable
    {
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    #customRbg
    {
    background-color: #111111;
    Added that description in events.php and this in ETconfig

    Code:
    $eventtime[1]['name']	= '<a href="?op=bc_rank">Blood Castle</a>';
    $eventtime[1]['start']		= 'Jan 01,	2013 00:19:00';
    $eventtime[1]['repeattime']	= '3600';
    $eventtime[1]['opentime']	= '300';
    $eventtime[1]['description'] 	= 'thanks 4FUNer event';
    And description doesn't show up ... what did I miss ?

  4. #4
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    Ah im blind ^^ must be after </span>

    modify
    style="color:#FF6611;"></span></td></tr>';
    to
    style="color:#FF6611;"></span><br>'.$value['description'].'</td></tr>';

  5. #5
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Quote Originally Posted by 4FUNer View Post
    Ah im blind ^^ must be after </span>

    modify
    style="color:#FF6611;"></span></td></tr>';
    to
    style="color:#FF6611;"></span><br>'.$value['description'].'</td></tr>';
    Working like a charm now ! You didn't answer about this, what if I want to have double table like this :



    To blend in ofc ... the table like :



    How do I do this ?

  6. #6
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    Quote Originally Posted by epocal View Post
    Working like a charm now ! You didn't answer about this, what if I want to have double table like this :
    How do I do this ?
    I've answered in previous posts

    Quote Originally Posted by 4FUNerG0D!#@M7D#@E
    you're so lazy, u will style it ur self ^^
    Google & Learn basics, or wait for some1 to reply.

    Hint, float:left & float:right will help you, now just separate results
    Last edited by 2009x2014; 23-07-13 at 11:33 PM.

  7. #7
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Quote Originally Posted by 4FUNer View Post
    I've answered in previous posts



    Google & Learn basics, or wait for some1 to reply.

    Hint, float:left & float:right will help you, now just separate results
    No one will reply :)) you are the only one who does this sh*t right ! I will try ... thank's

    You could always send me more hints :D because that float thing only moves my first cell :)) does not multiply mu cells as in the picture :P lazy copy cat here
    Last edited by epocal; 24-07-13 at 08:42 AM.

  8. #8
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Anyone ? :D

  9. #9
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    4FUNer, common mate help me just extend the Table left, because I don't want it to be a list down, I want it to be a list left like this :



    Any help would be much appreciated !

  10. #10
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    customRTitle table witdh -> 100 %

    2 separated tables
    float:left in style for 1st table + width="50%"
    float:right in style for 2nd table + width="50%"

    second table with everything - foreach ($eventtime2 as $value2) {

    in etconfig $eventstime2 for displaying in second table

    $i = 0; for second table

    0 = eventstime2[X]

    so for example $i = 8; will display eventstime2[8] ++

    Result = on title witdh 80 tables with 40 40 + margin-left on 1st table looking nice yea? too bad its going to trash ^^


    Now go do it & don't wait for download, unless some1 help you XD

    HF
    Last edited by 2009x2014; 24-07-13 at 09:33 PM.

  11. #11
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Quote Originally Posted by 4FUNer View Post
    customRTitle table witdh -> 100 %

    2 separated tables
    float:left in style for 1st table + width="50%"
    float:right in style for 2nd table + width="50%"

    second table with everything - foreach ($eventtime2 as $value2) {

    in etconfig $eventstime2 for displaying in second table

    $i = 0; for second table

    0 = eventstime2[X]

    so for example $i = 8; will display eventstime2[8] ++

    Result = on title witdh 80 tables with 40 40 + margin-left on 1st table looking nice yea? too bad its going to trash ^^


    Now go do it & don't wait for download, unless some1 help you XD

    HF
    :((( you've deleted it , omg you really want me to do this on my own ... damn ... I will try it today after I get back from work ! Have a nice day, Martin and thank you, I hope this info will help me do it ...

  12. #12
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Martin, you can't say I didn't try but look, the float thing doesn't work !, I know I've missed some code.

    1. I did add float:left to the first table in <style>

    2. I did a copy all and made a new table with CustomRTitle deleted, because I only need one, am I right ?

    3. Added float:right to the second table in <style>

    4. Edited the <table border="0" cellspacing="2" cellpadding="2" width="50%" class="customRTable">'; as you said to both tables.

    5. customRTitle table witdh -> 100 % and nothing happens ...

    See my code here :
    Code:
    <script type="text/javascript">
    function eventstime(lasttime, repeattime, showid, opentime) {
    	if (lasttime < 0) lasttime = repeattime-1;
    	if (lasttime <= opentime) {
    		document.getElementById(showid).innerHTML = "is Open";
    		setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
    	} else {
    		var secs = lasttime % 60;
    		if (secs < 10) secs = '0'+secs;
    		var lasttime1 = (lasttime - secs) / 60;
    		var mins = lasttime1 % 60;
    		if (mins < 10) mins = '0'+mins;
    		lasttime1 = (lasttime1 - mins) / 60;
    		var hours = lasttime1 % 24;
    		var days = (lasttime1 - hours) / 24;
    		if (days > 1) days = days+' days + ';
    		else if (days > 0) days = days+' day + ';
    		document.getElementById(showid).innerHTML = days+hours+':'+mins+':'+secs;
    		setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
    	}
    }
    </script>
    
    <?
    echo'
    <table border="0" cellspacing="0" cellpadding="0" width="55%" style="margin-top: 30px;" >
    <td align="center" class="customRTitle">Events</td></table><div style="height: 3px; width="100%""></div>
    <table border="0" cellspacing="2" cellpadding="2" width="50%" class="customRTable">';
    include ("ETconfig.php");
    $i = 0;
    echo '';
    foreach ($eventtime as $value) {
    	$i++;
    	$bc_remain = $value['repeattime'] - ((WEBSITE_REAL_TIME - strtotime($value['start'])) % $value['repeattime']);
    	$startevents .= 'eventstime('.$bc_remain.', '.$value['repeattime'].', \'event'.$i.'\', '.$value['opentime'].'); ';
    	echo '<tr id="customRbg" height="25"><td align="center">'.$value['name'].': <span id="event'.$i.'" style="color:#FF6611;"></span><br>'.$value['description'].'</td></tr>'; 
    }
    echo '<script type="text/javascript">'.$startevents.'</script>
    </table>';
    ?>
    <style>
    .customRTable
    {
    float:left;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    #customRbg
    {
    background-color: #111111;	
    }
    .customRTitle
    {
    padding-top: 3px;
    padding-bottom: 3px;
    color: #D5D5D5;
    margin-top: 15px;
    font-size: 18px;
    background-color: #111111;
    border: 1px solid #444444; 
    border-radius:7px;
    font-weight:bold;	
    }
    </style>
    <script type="text/javascript">
    function eventstime(lasttime, repeattime, showid, opentime) {
    	if (lasttime < 0) lasttime = repeattime-1;
    	if (lasttime <= opentime) {
    		document.getElementById(showid).innerHTML = "is Open";
    		setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
    	} else {
    		var secs = lasttime % 60;
    		if (secs < 10) secs = '0'+secs;
    		var lasttime1 = (lasttime - secs) / 60;
    		var mins = lasttime1 % 60;
    		if (mins < 10) mins = '0'+mins;
    		lasttime1 = (lasttime1 - mins) / 60;
    		var hours = lasttime1 % 24;
    		var days = (lasttime1 - hours) / 24;
    		if (days > 1) days = days+' days + ';
    		else if (days > 0) days = days+' day + ';
    		document.getElementById(showid).innerHTML = days+hours+':'+mins+':'+secs;
    		setTimeout('eventstime('+(lasttime-1)+', '+repeattime+', \''+showid+'\', '+opentime+');', 999);
    	}
    }
    </script>
    
    <?
    echo'
    <table border="0" cellspacing="0" cellpadding="0" width="55%" style="margin-top: 30px;" >
    <table border="0" cellspacing="2" cellpadding="2" width="50%" class="customRTable">';
    include ("ETconfig.php");
    $i = 0;
    echo '';
    foreach ($eventtime as $value) {
    	$i++;
    	$bc_remain = $value['repeattime'] - ((WEBSITE_REAL_TIME - strtotime($value['start'])) % $value['repeattime']);
    	$startevents .= 'eventstime('.$bc_remain.', '.$value['repeattime'].', \'event'.$i.'\', '.$value['opentime'].'); ';
    	echo '<tr id="customRbg" height="25"><td align="center">'.$value['name'].': <span id="event'.$i.'" style="color:#FF6611;"></span><br>'.$value['description'].'</td></tr>'; 
    }
    echo '<script type="text/javascript">'.$startevents.'</script>
    </table>';
    ?>
    <style>
    .customRTable
    {
    float:right;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    #customRbg
    {
    background-color: #111111;	
    }
    </style>
    And the result is sh*t :



    Need your help, Martin, you can't say I am lazy now ... I've tried ...

    PS : I think I don't know how to separate the tables that's why the float thing doesn't work.

  13. #13
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    Hahahaha ...

    how the f*** you think it will work if you use same class "customRTable" for both tables ?

    first table let be

    customRTable
    second make
    customRTable2222222222222222222

    witdh must be 50% for both

    also why you copied whole code 2x ? i told you only to double this ->

    take ready 2 go
    Code:
    <table align ="center" border="0" cellspacing="4" cellpadding="5" width="50%" class="customRTable2">';	
    $i2 = X;
    foreach ($eventtime2 as $value2) {
    	$i2++;
    	$bc_remain = $value2['repeattime'] - ((WEBSITE_REAL_TIME - strtotime($value2['start'])) % $value2['repeattime']);
    	$startevents .= 'eventstime('.$bc_remain.', '.$value2['repeattime'].', \'event2'.$i2.'\', '.$value2['opentime'].'); ';
    	echo '<tr id="customRbg" height="25"><td align ="center">'.$value2['name'].': <span id="event2'.$i2.'" style="color:#FF6611;"></span><br>'.$value2['description'].'</td></tr>';	
    }
    echo '<script type="text/javascript">'.$startevents.'</script>
    </table>';
    X = start of $eventtime2[X] config


    style
    Code:
    .customRTable
    {
    float:left;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    .customRTable2
    {
    float:left;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    cfg for second table like this

    Code:
    $eventtime2[X]['name']	= 'XXXXX';
    $eventtime2[X]['start']		= 'Jan 01,	2013 01:00:00';
    $eventtime2[X]['repeattime']	= '3600';
    $eventtime2[X]['opentime']	= '300';
    $eventtime2[X]['description']
    X = start value for $i2
    Last edited by 2009x2014; 27-07-13 at 11:40 AM.

  14. #14
    Account Upgraded | Title Enabled! epocal is offline
    MemberRank
    Jun 2012 Join Date
    inside MuServerLocation
    579Posts

    Re: A little coding help for module style

    Quote Originally Posted by 4FUNer View Post
    Hahahaha ...

    how the f*** you think it will work if you use same class "customRTable" for both tables ?

    first table let be

    customRTable
    second make
    customRTable2222222222222222222

    witdh must be 50% for both

    also why you copied whole code 2x ? i told you only to double this ->

    take ready 2 go
    Code:
    <table align ="center" border="0" cellspacing="4" cellpadding="5" width="50%" class="customRTable2">';	
    $i2 = X;
    foreach ($eventtime2 as $value2) {
    	$i2++;
    	$bc_remain = $value2['repeattime'] - ((WEBSITE_REAL_TIME - strtotime($value2['start'])) % $value2['repeattime']);
    	$startevents .= 'eventstime('.$bc_remain.', '.$value2['repeattime'].', \'event2'.$i2.'\', '.$value2['opentime'].'); ';
    	echo '<tr id="customRbg" height="25"><td align ="center">'.$value2['name'].': <span id="event2'.$i2.'" style="color:#FF6611;"></span><br>'.$value2['description'].'</td></tr>';	
    }
    echo '<script type="text/javascript">'.$startevents.'</script>
    </table>';
    X = start of $eventtime2[X] config


    style
    Code:
    .customRTable
    {
    float:left;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    .customRTable2
    {
    float:left;
    background-color: #222222;
    border: 1px solid #444444; 
    border-radius:7px;
    }
    cfg for second table like this

    Code:
    $eventtime2[X]['name']	= 'XXXXX';
    $eventtime2[X]['start']		= 'Jan 01,	2013 01:00:00';
    $eventtime2[X]['repeattime']	= '3600';
    $eventtime2[X]['opentime']	= '300';
    $eventtime2[X]['description']
    X = start value for $i2
    float:left & float:left for both tables , you said that ? :|

  15. #15
    Alpha Member 2009x2014 is offline
    MemberRank
    Dec 2009 Join Date
    2,765Posts

    Re: A little coding help for module style

    Quote Originally Posted by epocal View Post
    float:left & float:left for both tables , you said that ? :|
    I'll explain

    you have 2 tables right ?

    float:left & float:right will be the same as float:left & float:left except if you gonna use different witdh than 50/50

    doesn't matter, just paste the code correctly on echo' ';

    & style on <style> </style> tags :]



Page 1 of 2 12 LastLast

Advertisement