Jump to content

termn8r

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

termn8r's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I use the "include_path" a lot for multiple websites to use the same core include files and I recently thought it would be nice if I could also do the same thing with php files. For instance if I have 8 websites that all need an items.php would there be a way to have a global path like include_path so all sites use the one file? Right now i am using symbolic links but I have to create them every time I add a new site. Would be nice that if the file didn't exist in the directory it would grab it from elsewhere. I am betting I could do this in a Rewrite condition in apache as well but I figured there had to be a simple way to do this in php.ini. Any suggestions? Termn8r
  2. If I have 50,000+ items in a MySQL database and I want to give the option of the viewer to show the items by price breakdown (like tigerdirect etc). What do I do to make sure I have a good breakdown? I have taken the min and max prices and using float in a calc I can break the price rangers into 5 groups but sometimes a group will have 0 items due to price variances. Other times one group will have 500 items while another group has 1. I also tried to take number of items and divide it by the number of options I want but again it doesn't give me a very good response. I feel like I am missing something. I dont want all the price groups to have the same number of items but I also dont want there to be 500 in one group and 3 in another. I tried requiring 15-25% in each group and this helped some but I feel like there should be a mathematical way do this either in PHP or MySQL that is simple. say min price is $0.10 and max price is $600 but most items in this category are $14. I would want it to do something like $0.10-$10.99 (23) $11.00-19.99 (31) $20.00-$500.00 (12) and if min price was $2.99 and max was $22.99 $2.99-$5.99 (14) $6.00-$9.99 (22) $10.00-$15.99 (12) $16.00-$22.99 (5) where minimum price range groupings is 3 and max is 5 (I am showing 3 and 4 in my examples) Thanks in advance for any help on this. I have been working on it for several days now with minimal results.
  3. I have a client that would like a list of locations using maps.live.com. I have tried to go through their SDK info and I am at a loss to get something working. Does anyone know where I can start? I really prefer to be able to feed it the exact address instead of lat/long and I can build the page with the needed info and list the locations below. I have seen some sites doing this (realestate) but their coding is convoluted and all over the place. Any suggestions? I could really use some help here. Jason
  4. Adding a simple "$menu = new menu" fixed it all. Thanks guys. It will take some work but I think I can manage to add this to all my pages. Solved as far as I'm concerned.
  5. But if you want exact time. ##Last Touch is the last time the person clicked anything $seconds_ago = time() - $last_touch; ##How many Types of Time should we show? $list_number = 2; ##Month Check $months_ago = floor($seconds_ago / 2592000); if($months_ago > 0) { $seconds_left = $seconds_ago - ($months_ago * 2592000); $last_active = "$months_ago Months"; $active_length++; } ##Day Check $days_ago = floor($seconds_left / 86400); if($days_ago > 0) { $seconds_left = $seconds_left - ($days_ago * 86400); if($list_number > $active_length) { $active_length++; $last_active .= "$days_ago Days"; } } ##Hour Check $hours_ago = floor($seconds_left / 3600); if($hours_ago > 0) { $seconds_left = $seconds_left - ($hours_ago * 3600); if($list_number > $active_length) { $active_length++; $last_active .= "$hours_ago Hours"; } } ##Minute Check $minutes_ago = floor($seconds_left / 60); if($minutes_ago > 0) { $seconds_left = $seconds_left - ($minutes_ago * 60); if($list_number > $active_length) { $active_length++; $last_active .= "$minutes_ago Minutes"; } } ##Second Check if($seconds_left > 0) { if($list_number > $active_length) { $active_length++; $last_active .= "$seconds_left Seconds"; } } I just wrote this freehand, not 100% sure it is without flaw.
  6. I have done queries like this for about 8 years. It may not be the best way but it's what 90% of my websites use... When I upgraded to 5.2.4 I realized it doesn't work. while($session->db->next_record()) { $menu->id = $session->db->f('sub_id'); $menu->name = stripslashes($session->db->f('sub_desc')); $menu->link = $session->db->f('link'); $menus[] = $menu; } Normally I can call this later with a simple statement. For simplicity lets just say for($m=0;$m<count($menus);$m++) { $menu = $menus[$m]; echo "<a href=$menu->link>$menu->name</a><BR>"; } Prior to new server this would list out all menus. Currently it lists (lets say 10 rows) of the last menu line. So instead of "Home,Login,Help" I get "Help,Help,Help" I am not looking for someone to say "Why don't you just query this way" because of the severity of this issue if I update 40+ websites to PHP 5.x. Is it purely 5.2 doing this? Or something else? Maybe I was using some bug all this time in the way Array[]'s are handled now or some kind of variable setting? Any help is appreciated.
  7. I have been doing this by using a php file for years on several different tables and know this must be one of the clunkiest ways to do this and instead of researching for days to try to find the answer I thought I would just ask. I figure this is a super easy thing to do once you know how. Old_Table ID,name,category,status,details New_Table ID,name,category,status,details,date_entered,date_updated I want to update the Category of New_Table with Old_Table category IF New_Table Category = "" Another example would be: Master_Table ID,name,address,category,status,details,date_entered,date_updated,end_date Sub_Table SID,name,address,details,date_entered,date_updated,end_date I want to add to Master_Table with Sub_Table data only if the data is NEW OR status on Master (of identical address or at least 95% close) isn't set to "Never" then I want to update end_date of now. Is there a way to do these 2 queries as an actualy query? Or is my clunky way of making a php file to cross reference about the best way to check?
  8. Has anyone used the PECL IIS functions? I have spent about 3-4 hours searching the internet and the most I can find is what is on php.net and has been copied exactly onto around 50 other wesbites with zero examples. I am specifically working on iis_add_server function: [code]int iis_add_server ( string path, string comment, string server_ip, int port, string host_name, int rights, int start_server )[/code] I was hoping to find some examples of using this and a few other of the IIS functions but there are zero remarks on all of them. Thanks if anyone has used them. I have one client that requires IIS or I wouldn't even need these. Termn8r
×
×
  • 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.