Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Need some clarification on a few of the rules.. 1) Do you mean replace commas between say pounds and pence (£1.99) or between large numbers (£1,999.99)? 3) What about numbers like £1,999.99? 4) What about numbers like 5.5, does the padded 0 count as a digit?
  2. It's because you're trying to increment a variable that hasn't been defined. Set $iCountFiles to 0 before the loop: (...) {$sP_Smilies = ''; $iCountFiles = 0; while (false !== ($sFile = readdir($rHandle))) {if (preg_match("/^([sa-zA-Z0-9]+){3}(:?\.gif|\.jpg)$/", $sFile))(...)
  3. Start doing exercise a couple of times a week. Once you get into that routine you'll start feeling more motivated, and ultimately find it easier to discipline yourself when it comes to work.
  4. Not many will speak German (?) here.
  5. The exclamation mark doesn't mean anything in a URL. Most likely a particular site has some kind of dependency on it..
  6. This query looks a mess. I haven't wrapped my head around it properly yet, but the DK ratio case statement- aren't you repeating the logic? The sub-query already works out the ratio and returns it as "killdeathratio". Assuming we can remove that, you then have ($scoreFormula) as totalscore - you're injecting a variable into the query so that you can select it? That makes no sense. Assuming we can remove that, you're then just selecting * from a sub-query. Remove the outer query then and you have a simpler query to deal with. Add some indentation and you're left with: SELECT gp.name as name , bans.name as banname , avg(dp.courierkills) as courierkills , avg(dp.raxkills) as raxkills , avg(dp.towerkills) as towerkills , avg(dp.assists) as assists , avg(dp.creepdenies) as creepdenies , avg(dp.creepkills) as creepkills , avg(dp.neutralkills) as neutralkills , avg(dp.deaths) as deaths , avg(dp.kills) as kills , count(*) as totgames , case when (kills = 0) then 0 when (deaths = 0) then 1000 else ((kills*1.0)/(deaths*1.0)) end as killdeathratio , SUM(case when(((dg.winner = 1 and dp.newcolour < 6) or (dg.winner = 2 and dp.newcolour > 6)) AND gp.`left`/ga.duration >= $minPlayedRatio) then 1 else 0 end) as wins , SUM(case when(((dg.winner = 2 and dp.newcolour < 6) or (dg.winner = 1 and dp.newcolour > 6)) AND gp.`left`/ga.duration >= $minPlayedRatio) then 1 else 0 end) as losses FROM gameplayers as gp LEFT JOIN dotagames as dg ON gp.gameid = dg.gameid LEFT JOIN dotaplayers as dp ON dg.gameid = dp.gameid AND gp.colour = dp.colour AND dp.newcolour <> 12 AND dp.newcolour <> 6 LEFT JOIN games as ga ON dp.gameid = ga.id LEFT JOIN bans ON bans.name = gp.name WHERE dg.winner <> 0 GROUP BY gp.name having totgames >= $games ORDER BY $order $sortdb, name $sortdb LIMIT $offset, $rowsperpage Does this work? Probably be easier for you to edit in future if so. To your original question, where are you wanting to add that SQL?
  7. First thought; I have no idea where to look. It's hard to distinguish what's an advert and what's not. The website lacks any clear navigation or structure. It looks like you've just tried to ram as much data in there as you can without any thought to readability or accessibility. I don't even know what the site is exactly? Big 'click here to share' roll-overs keep appearing over images; why would I want to share 'it' without having seen what 'it' is? Not just that but I have to log-in first before I can see it. How will search engines crawl the content? Profile images are full-size instead of thumbnails, which means the user has to download the entire image before the browser can resize it. This' resulted in a slow loading time, and also causes the page to react slowly when for example switching between tabs. Not just that but it's a waste of bandwidth. Sorry to say but there's a lot of problems with the site, before even venturing into the source. I'd take a look at other sites similar to your own and think about the navigation they have, the way they're laid out and structured, how they make it easier to read without over facing the user with information.
  8. What do you mean by "discrete" values?
  9. I'm not sure how this can be done using just HTML, but with JavaScript it can be done like this: function parentTop(){ parent.window.location.hash = '#top';} "#top" needs to match the name of your anchor.
  10. Create an anchor within the body of your parent frame: <a name="top"></a> Then reference that within the child frame, specifying the target "_top" frame: <a href="#top" target="_top">Top of parent frame</a> ------- Sorry no, that won't work. Give me a minute..
  11. json_decode returns an object by default. You need to set the second parameter 'true' to return an array: $data = json_decode($db_data, true); The problem with your method of typecasting the object will have been within the conversion, but I'm not sure what exactly.
  12. Clue's in my previous post.. id isn't defined in the setOpacity() function. You need to make sure you pass the element's ID between every function: <script type="text/javascript"> function setOpacity(id, value) { document.getElementById(id).style.opacity = value / 5; document.getElementById(id).style.filter = 'alpha(opacity=' + value * 5 + ')'; } function fadeInMyPopup(id) { for( var i = 0 ; i <= 100 ; i++ ) setTimeout( 'setOpacity("' + id + '", ' + (i / 5) + ')' , 8 * i ); } function fadeOutMyPopup(id) { for( var i = 0 ; i <= 100 ; i++ ) { setTimeout( 'setOpacity("' + id + '", ' + (5 - i / 5) + ')' , 8 * i ); } setTimeout('closeMyPopup("' + id + '")', 200 ); } function closeMyPopup(id) { document.getElementById(id).style.display = "none" } function fireMyPopup(id) { setOpacity(id, 0); document.getElementById(id).style.display = "block"; fadeInMyPopup(id); } </script> You do realise though that jQuery has a .fadeIn() method that can do all this for you?
  13. I'm not really sure what you're trying to do here, but you won't be able remove (just) them as a single node. As you said you could use regex, which to match it would require: / \| \[b\]<a href\="javascript:parent\.window\.do_reject\(\*\*\*\)">busy<\/a><\/td>/ Then you could use the .replace() method to remove the string: var td = document.getElementsByTagName('tr')[4].getElementsByTagName('td')[0].innerHTML; td.replace(/ \| \[b\]<a href\="javascript:parent\.window\.do_reject\(\*\*\*\)">busy<\/a><\/td>/, ''); Not tested, but you should be able to tweak it to get it working.
  14. Doesn't work form me at all. Where's id defined in the function below? function setOpacity( value ) { document.getElementById(id).style.opacity = value / 5; document.getElementById(id).style.filter = 'alpha(opacity=' + value * 5 + ')'; }
  15. Using the .length property: if ($('#claim_num').length >= 7 ||
  16. Very strange. Could you provide us with the full file so we can test ourselves? Perhaps there is something in there forcing that to happen..
  17. In addition to that, if JavaScript is required to navigate around then search engines will be unable to crawl your site.
  18. Implode the IDs within an IN condition in the query, then order by the first name: $sql = "select id, first_name from users where id in ('" . implode("', '", $ids) . "') order by first_name";
  19. You can control how you want the page to look visually using CSS rules with the media type "print". To include an external print media style sheet you can use: <link rel="stylesheet" type="text/css" href="path/to/print-styles.css" media="print" />
  20. It's generally considered bad practise for a web site to depend upon JavaScript and/or cookies in order to function, so I doubt there's a "standard" place to put such a message. Why not put this effort into getting it working without though? Why does it actually need them in the first place?
  21. Was "Law Abiding Citizen". Anybody seen it?
  22. Been trying to find this film for past or so but can't remember who's in it. It was out probably 6 months ago or something, and plot's roughly based on someone causing havoc around the city. A memorable part of it is they have him locked up or something and it's still continuing? Sorry that's a bit vague... just all I can remember.
  23. Ah sorry. Okay give this a try.. <form name='myform' method='post' action=''> <select id='yearID' name='years'> <option value='2010'>2010</option> <option value='2009'>2009</option> <option value='2008'>2008</option> </select> <input type='button' onclick='requestActivities2("includes/get_monthly.php?year="+document.getElementById("yearID").value);' value='Submit' /> </form> I'd definitely recommend moving such logic to a function though.
  24. Try this: onclick='requestActivities2("includes/get_monthly.php?year="+this.value);'
  25. Just set the .style.border property of the image object then.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.