Jump to content

boionfire81

Members
  • Content Count

    517
  • Joined

  • Last visited

  • Days Won

    4

boionfire81 last won the day on September 23 2016

boionfire81 had the most liked content!

Community Reputation

7 Neutral

About boionfire81

  • Rank
    Trainee
  • Birthday 10/01/1981

Personal Information

  • Occupation
    caregiver
  1. Looking for an SVG designer. Message me for details
  2. Let me know when you get it running. I'd love to see it.
  3. [uSER=64684]Dayo[/uSER] I'm only having 2 issues with this. 1) I'd like to echo the time right after the db query. But it looks like this: "in -17056 days, -22:, 0-13:-13" $time=rand(60,180); $totaltime=$time*$_POST['energy']; $ttime=".(time.()+$totaltime)."; echo "You will see daylight again in ".time_format($ttime).". ";   function time_format($time) { $ttime=($time-time()); $days = floor($ttime / 60 / 60 / 24); $hours = floor($ttime / 60 / 60) % 24; $mins = floor($ttime / 60) % 60 % 24; $sec = floor($ttime) % 60 % 60 % 60 % 24; if($days) { $days = "$days days, and "; } else { $days = ""; } if($hours) { $hours = "$hours:"; } else { $hours = ""; } if($mins == 1) { $mins = "1"; } else { $mins = "$mins"; } if($sec == 1) { $sec = ":01"; } else { $sec = ":$sec"; } return $days.$hours.$mins.$sec; }  
  4. boionfire81

    $counter++?

    Well, I tried sniko's. This is basically an hof layout. Each player having a player card with a 3 layer accordion. The accordian id needs to be unique to each player AND the accordion level needs to be unique to itself. i.e. <label id='accordion-1'> <span name='acc-1-1'></span> <span name='acc-1-2'></span> <span name='acc-1-3'></span> NEXT <label id='accordion-2'> <span name='acc-2-4'></span> <span name='acc-2-5'></span> <span name='acc-2-6'></span>  
  5. boionfire81

    $counter++?

    Ok, I'm not to sure what options are available for accomplishing this. I need to set a running counter during a while loop. But I also need to echo that exact same count 4 times during the loop template. Any ideas? I'm thinking a   $counter=1; while($r=$db-fetch_row($q)) { $thiscount=$counter++; }
  6. yeah it is. Ok so what would be the preferred method?
  7. dude worked perfect (outside of the . next to WHERE). Thanks! I'mma have to read up on the NESTED queries, cause that ^ I can't even read lol. Ok, maybe not 100%. I also need to run a query to pull the last price from stocks. So code for first stock page   $q=$db->query("SELECT DISTINCT `st1`.`stockID`, `st1`.`stockNAME`, `st1`.`stockPRICE` FROM `shares` `st1` WHERE st1.stockSELL > 0 and st1.stockPRICE = (SELECT MIN(st2.stockPRICE) FROM shares st2 WHERE st2.stockID = st1.stockID) ORDER BY st1.stockPRICE ASC"); while($r=$db->fetch_row($q)) { $s=$db->query("SELECT `last` FROM `stock` WHERE `stockID` = {$r['stockID']} ORDER BY `time` ASC LIMIT 1"); $l=$db->fetch_row($s);   After quick check though my time() insert isn't working on purchase. Ok, researching now. Tried UNIX_TIMESTAMP everything I could think. The time always seems to insert as 0000-00-00 00:00:00 no matter how I write it. ONLY thing that worked is NULL... but why?
  8. The distinct I think might be more of what I need. Each member can hold several different stocks. A row is created for each user and their individual stocks. Then there is a column that sets the amount of shares they are willing to sell and how much they are willing to sell for. I need to select the lowest price of each stock. What I have now is simply displaying every single row in the table being queried.   $q=$db->query("SELECT DISTINCT `stockID`, `stockNAME`, `stockPRICE` FROM `shares` WHERE `stockSELL`> 0 ORDER BY `stockPRICE` ASC"); while($r=$db->fetch_row($q)) {
  9. I need to select 1 row for each stockID with the result being the lowest price. $q=$db->query("SELECT `stockID`, `stockNAME`, `stockPRICE` FROM `shares` WHERE `stockSELL`> 0 GROUP BY `stockID` ORDER BY `stockPRICE` ASC"); while($r=$db->fetch_row($q)) {   The where stockSELL does fine. But if there are 2 people selling the stock it list every result for that. >.< I never used group, so this is probably where the error is.
  10. lol. My bad man, I'm just now making it back to this thread. But thanks! Will let you know if it works out.
  11. boionfire81

    Time

    So yeah, this might just be going to far in depth. But unique, creative, and user-responsive design is what I am aiming for. So here's the question. How can I determine the "time/day" through php from only mysqli input to show given information based on such. (i.e. not geolocation, but strict database). A complete list of locations, timezones, and time offsets is already done. (Just need to shrink from 2 tables to 1). I have no clue with timing. What I want to do 4 things 1) An exact time (mostly for fluff actually). 2) Determine day/night time. (mostly design, but some store closing, bar open stuff) 3) Determine the day of the week (Simply to give a unique "clubbing" experience) 4) Determine the season (Used for my farming mod) I imagine exact date/time would be a simple select `offset` from locations where location = $ir['located']. And then a $truetime= time() - `offset` I could be right or wrong on that. Just guessing from what I've learned so far. Now using the above settings. Me = no clue!  
  12. Yeah, I still don't know the exact difference between mt_rand and rand. Also currently trying to find the difference between require and require_once.
  13. Ok, so I thought I'd post this here, and let everyone see how it's coming along and add comments if you want. This is probably the biggest remod I've done yet. So give it time to finish. But in the mean time.... yeah :)   $mwepdamage = ($r1['weapon'] * $mdata['strength'] / 100); if($area['stat'] === 'Agility') { $mdhitboost = (($mdata['agility'] * $area['chance']) - ($odata['speed'] * (100 - $area['chance']))); $odhitboost = (($odata['agility'] * $area['chance']) - ($mdata['speed'] * (100 - $area['chance']))); } if($area['stat'] === 'Speed') { $mdhitboost = (($mdata['speed'] * $area['chance']) - ($odata['agility'] * (100 - $area['chance']))); $odhitboost = (($odata['speed'] * $area['chance']) - ($mdata['agility'] * (100 - $area['chance']))); } $where = rand(1,5); $owepdamage = ($r2['weapon'] * $mdata['strength'] / 100); if($where == 1) { $mdefense = ($mdata['guard'] * $mdata['head'] / 100); $odefense = ($odata['guard'] * $odata['head'] / 100); } else if($where == 2) { $odefense = ($odata['guard'] * $odata['torso'] / 100); $mdefense = ($mdata['guard'] * $mdata['torso'] / 100); $place = rand(1,3); if($place == 1) { $spot = 'left side'; } else if($place == 2) { $spot = 'right side'; } else { $spot = 'stomach'; } } else if($where == 3) { $odefense = ($odata['guard'] * $odata['hands'] / 100); $mdefense = ($mdata['guard'] * $mdata['hands'] / 100); $place = rand(1,2); if($place == 1) { $spot = 'left hand'; } else { $spot = 'right hand'; } } else if($where == 4) { $odefense = ($odata['guard'] * $odata['legs'] /100); $mdefense = ($mdata['guard'] * $mdata['legs'] /100); $place = rand(1,2); if($place == 1) { $spot = 'left leg'; } else { $spot = 'right leg'; } } else { $odense = ($odata['guard'] * $odata['feet'] / 100); $mdense = ($mdata['guard'] * $mdata['feet'] / 100); $place = rand(1,2); if($place == 1) { $spot = 'left foot'; } else { $spot = 'right foot'; } }   That's just deciding the damage vs defense and random hit location/side. Weapon hit phrase like "sliced" or "clubbed" are actually defined in the sql for a more creative touch. The "area" portion is just one of the unique features I have on my game. But in the end it only applies a small portion in the attack page. Still to decide first hit, to start the hp updates, and develop armor damage/weapon breaks. Not really sure where to go with the hp thing here. Just because I hate one hitter quitters. Much nicer to torture right? lol. Just can't decide how to turn this around to atleast 2-3 hits. Overall I think this will turn out to be a nice attack page. All be it, a massive amount of work in progress. (Please hold all 'security' comments until it actually near finish!)
×
×
  • Create New...