Jump to content

erv

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

erv's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello We have a series of sites that use Google API to serve locations stored in local DB, that show google maps from within given PHP pages within our sites (these pages also have other db driven content we wish to keep.... Each 'member' in our sites, they each have a google map shown on each page present for their 'location' menu tab... These calls to the google map API, often goes over our daily allotment of freebie map presentations from the google API It is SE and other Bots that run these view numbers off the charts and prevent the google maps from loading the actual maps - we get a google map err message - advising that maximum views have been reached... (we see this in our server error logs) Thoughts on how i can serve this map code to only legit http requests (human eyes) or at least reduce the burden of bot crawl requests to the google API? here is the code we use to call the maps - We need to encapsulate Google Map Display in a snippet that will block it from getting hit by bots.... Huge Thanks! <form target="_blank" method="GET" action="http://maps.google.com/maps"> <input type="hidden" name="daddr" value="<? echo "$address, $city, $state $zip $country" ?>"> <?php display_tooltip("Please enter your starting point in the form address, city, state zip country or simply enter your city", "mapdir");?> <input type="text" name="saddr" value="your starting point" onfocus=this.select()> <input class="clickableL" type="submit" value="Map and Directions"> </form>
  2. ok.. i will review this.... now, how will i add these start and end times to db? what i was able to edit, now is this showing the the field 0000-00-00 00:00:00 how do i get the start and end times for each message into db?
  3. here is link to a script that did all of this manually for a radio station... http://www.dynamicdrive.com/forums/archive/index.php/t-15561.html this is the sort of overall, fianal goal i have.... but to control it from my database with input for whatever hours of the day desired, and by day of week... should i set this up for 'days' then have time messages for each day? thursdays we have in house 2 for 1 sale in afternoons - drive home - stop in get 2 for one (we have a flower shop) but for me, where day was thinking to to suppliment the current time displayed message... ... ??? am i maybe presenting this wrong in db table when i need seperate messages, by times, for each day of the week? many thanks
  4. changed the 2 fields to TIMESTAMP messiag id is way to keep trask of these? there could be several different times of the day... who knows up to 10 if intended message display ia as cuch... maybe we will want to show for an hour of the day, only that message 'Sale for this hour, order now and save, we give Coupon code , then that message expires we do need days we close early on saturday and sunday... so we would like to show supplimental info for days of the week... frinday - please ger your order in for the weekend... and so on... i found a person that had set up something similar to show DJ's at a radio station - images when they were on line -- but that was a static script as well... they had that set op on a 7 day calender - then showed time display based on >day then time of day... this is the sort of think i wish for - but we will have messages...
  5. -->Are the data already in the DB? yes -- aahh - ii se it #
  6. -->To use a DB is simple. Do you know how to connect to a database and run SQL statements? not really -- i need to start to learn how this is done... everything is my site connects thru a central cfg file... i looked for 'code' buttons in the post to forum -- i do not see them? i can manually add them from now on
  7. many thanks but what i am asking.... how do i now use this or some new code to make use of data stored in db? as we will have start and end times for each occasion... also we may want an additioanl time display -- so this list has to be made on the fly, bases on data and qualifications in table -- (example friday set to 'Y') this is what i am having a hard time with... making the display page --
  8. ok... thank you for the time snippets i am finally making some progress..... but not really at the same time in regards to the message display i have this basic display working and day works <? $saturday = " content"; $afternoon = "content"; $late_afternoon = "Content $content "; $evening = "Content"; $late = "Content "; $morning = "content "; $thursday = " >>>>>> content -- $content <<<<<"; //No need to edit any further //Get the current hour $current_time = date(G); //Get the current day $current_day = date(W); // Adjust time zone offset below. use $current_time == 1 && $h >= $h = $h-2; //12 p.m. - 330 p.m. if ($current_time >= 12 && $current_time <= 14) { echo $afternoon; } //12 a.m. - 7 a.m. elseif ($current_time >= 15 && $current_time <= 18) { echo $late_afternoon; } // 330 p.m. to 11 p.m. elseif ($current_time >= 19 && $current_time <= 24) { echo $evening; } //12 a.m. - 7 a.m. elseif ($current_time >= 1 && $current_time <= 6) { echo $late; } // 7 a.m. to 11 a.m. elseif ($current_time >= 7 && $current_time <= 11) { echo $morning; } //If its Friday, display a message //if ($current_day = "Friday") { //echo $friday; //} //If its Saturday, display a message if ($current_day = "Thursday") { echo $thursday; } ?> hpw do i go about converting this for use, to use data stored in the messages table? `msg_id` int(32) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `content` text NOT NULL, `start_time` varchar(255) NOT NULL, `end_time` varchar(255) NOT NULL, `week_day` text NOT NULL, `notes` varchar(1) NOT NULL, PRIMARY KEY (`msg_id`) any help to get me going in good direction will be greatly appreciated erv
  9. -->So do you mean 12 is missing as in it's showing up as a 0? exactly -- all other hours seem to display properly
  10. ok... so far have server time displaying for refrence -- but at noon hour, the 12 is missing? what might be wrong here? current server time is actually 12:13 pm -- this displays current server time: 04/30/2009, 0:13 p.m. <?php $ct=date("m-d-Y-H-i"); $str=explode("-",$ct); $cmo=$str[0]; $cda=$str[1]; $cye=$str[2]; $cho=$str[3]; $cmi=$str[4]; echo "$cmo/$cda/$cye, "; if($cho==12 && $mi=="00") { echo $cho.":".$cmi; } elseif($cho > 11) { $cho=$cho - 12; echo $cho.":".$cmi." p.m."; } elseif($cho < 12) { echo $cho.":".$cmi." a.m."; } ?>
  11. hello i am a complete NOOB at trying to actually do my own php/mysql coding i have a genreal understanding of things and have been able to hack my way thru things... so far - but not for this Now i need help .............................. on my web site, i would like to display a welcome message that will change 5 times a day, based on time settings for given messages and have ability ot show suplimental display for day of the week after initial 'time slot' message ............................... i have table set that has these fields ................................................ `msg_id` int(32) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `content` text NOT NULL, `start_time` varchar(255) NOT NULL, `end_time` varchar(255) NOT NULL, `week_day` text NOT NULL, `notes` varchar(1) NOT NULL, PRIMARY KEY (`msg_id`) ......................................................... this table will hold data that have 5 messages for now, with titles 'morning, afternoon, late_afternoon, evening, and late' and content for message display to be shown time for use - 'morning "name field" ' message to display "content field" start_time "tells when to start to display message - server time" end_time "tells when to stop message - server time" ... in table for each message plus add day -"week_day field" with qualifer "Y" for additonal mesage display, to run concurrently with each of the 5 as above sunday monday tuesday and so on for weeks worh of days display ........................ goal is to display this, so these messages run, based on server time -- and message start and end times, concurently, and allow for added day after time slot message - we have Y on field notes for use day for qualifer... morning message afternoon message late_afternoon message evening message late message ................................ how would such a display be assembled using php/mysql and actually run, displaying all as above? .............................. many thanks erv in minneapolis
×
×
  • 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.