Jump to content

brm5017

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by brm5017

  1. I tried several different methods to drop downs, I can not get them to line up right. Anyone want to give me a hand? nav.css: <style type="text/css"> ul#list-nav { list-style:none; margin:0; padding:0; width:100% } ul#list-nav li { display:inline } ul#list-nav li a { text-decoration:none; padding:5px 0; width:110px; color:#eee; display: block; position: relative; float: left; overflow: hidden; border-left:.5px solid #fff; border-right:.5px solid#fff; font-size:1.2em; } ul#list-nav li a:hover { color:#575757; } </style> and my style.css: <style type="text/css"> /* Basic Elements */ html, body { margin: 0 auto; } body {background-image: url('../images/bg.jpg');} #container { width: 970px; margin: 0 auto; align: center; } #content { width: 900px; margin: 0 auto; font-family: serif; color: white; margin: 0 auto; border-top: 1px solid #fff; } /* column container for MAIN PAGE*/ .colmask { clear:both; float:left; width:100%; /* width of whole page */ overflow:hidden; /* This chops off any overhanging divs */ } /* common column settings */ .colright, .colmid, .colleft { float:left; width:100%; position:relative; } .col1, .col2, .col3 { float:left; position:relative; padding:0 0 1em 0; overflow:hidden; } /* 2 Column (double page) settings */ .doublepage { /* right column background colour */ } .doublepage .colleft { right:50%; /* right column width */ /* left column background colour */ } .doublepage .col1 { width:46%; /* left column content width (column width minus left and right padding) */ left:52%; /* right column width plus left column left padding */ } .doublepage .col2 { width:46%; /* right column content width (column width minus left and right padding) */ left:56%; /* (right column width) plus (left column left and right padding) plus (right column left padding) */ } /* 2 Column (double page) settings */ .doublepagemain { /* right column background colour */ } .doublepagemain .colleft { right:50%; /* right column width */ /* left column background colour */ } .doublepagemain .col1 { width:30%; /* left column content width (column width minus left and right padding) */ left:50%; /* right column width plus left column left padding */ } .doublepagemain .col2 { width:70%; /* right column content width (column width minus left and right padding) */ left:55%; /* (right column width) plus (left column left and right padding) plus (right column left padding) */ } #header { text-align: center; width: 100%; height: 160px; color: #fff; font-family: Impact, Charcoal, sans-serif; font-size: 10pt; } #navcontainer { text-align: center; font-family: Impact, Charcoal, sans-serif; color: white; font-size: 1em; width: 100%; position: relative; } #footer { width: 100%; height: 120px; clear: both; border-top: 1px solid #cecece; text-align: center; padding: 5px 0; color: #fff; font-family: "Times New Roman"; font-size: 10pt; } #slider { position:relative; display:block; width:600px; /* Change this to your images width */ height:356px; /* Change this to your images height */ background:url(images/loading.gif) no-repeat 50% 50%; } #slider img { position:absolute; top:0px; left:0px; display:block; } #slider a { border:0; display:block; } /* Additional styles */ p { padding: 10px; margin: 0; } img { border: 0; } img.centered { display: block; margin-left: auto; margin-right: auto } h1 { color: white; } a { color: #b0b0b0; text-decoration: none; } a:hover { color: white; } .imagedropshadow { padding: 5px; border: solid 1px #EFEFEF; } a:hover img.imagedropshadow { border: solid 1px #CCC; -moz-box-shadow: 1px 1px 5px #999; -webkit-box-shadow: 1px 1px 5px #999; box-shadow: 1px 1px 5px #999; } </style>
  2. Interesting. If I add echo $key . " has " . strlen($key). " characters <br>" it returns bedrooms has 17 characters fullbaths has 18 characters partialbaths has 21 characters ..etc
  3. Data source: <td></td><td>Bedrooms</td><td></td><td>1</td><td></td> foreach ($rows_feat as $id2 => $row2){ $features_raw = $scrape->fetchAllBetween('<td','</td>',$row2,true); $key=str_replace($repl_array,$repl_with,strtolower(trim($features_raw[1]))); $features_data[$key] = trim($features_raw[3]); echo $key.": ". $features_data[$key]."<br>"; //This returns fine: bedrooms: 1 $countid=$countid+1; } $house[beds]=$features_data[bedrooms]; echo '<br>beds: ' . $house[beds] ; //This returns empty data beds: "" echo '<br>beds: ' . $features_data[bedrooms] ; //This also returns empty data beds: "" I'm not sure why I can echo the correct values when within the foreach loop, but once I try to use the data located in "features_data[]" array outside of that loop, it returns null.
  4. Thanks for the help! i think this will work!
  5. Crap I meant to include the following to my code before the foreach. $data_features = trim($scrape->fetchBetween("<!-- Features Begin -->","<!-- Features End -->", $data_temp,false)); $rows_feat = $scrape->fetchAllBetween('<tr','</tr>',$data_features,true); $data_features = trim($scrape->fetchBetween("<!-- Features Begin -->","<!-- Features End -->", $data_temp,false)); $rows_feat = $scrape->fetchAllBetween('<tr','</tr>',$data_features,true); $features_data = array(); $countid=0; foreach ($rows_feat as $id2 => $row2){ $features_raw = $scrape->fetchAllBetween('<td','</td>',$row2,true); $features_data[str_replace($repl_array,$repl_with,strtolower(trim($features_raw[1])))] = trim($features_raw[3]); echo $features_raw[1]. ": " . $features_data[$countid]."<br>"; $countid=$countid+1; }
  6. I'm scraping a housing website with html source: <tr><td> </td><td> Bedrooms </td><td> </td><td >3</td><td> </td></tr> <tr><td> </td><td> Full Baths </td><td> </td><td >1</td><td> </td></tr> <tr><td> </td><td> Partial Baths </td><td> </td><td >1</td><td> </td></tr> <tr><td> </td><td> Interior Sq Ft </td><td> </td><td >1,356</td><td> </td></tr> <tr><td> </td><td> Acres </td><td> </td><td >0.16</td><td> </td></tr> What i'm trying to do is create an associative array with only the details I want from the above. I've already got a function that steps through the HTML and creates an array element for each row with the contents of each <td> statement as follows: $repl = array(" ", "(", ")"); $repl_with = array("", "", ""); foreach ($rows_feat as $id2 => $row2){ $features_raw = $scrape->fetchAllBetween('<td','</td>',$row2,true); //$features_data[str_replace($repl,$repl_with,strtolower(trim($features_raw[1])))] = trim($features_raw[3]); $countid=$countid+1; } The array produced by this would look like: features_raw[1] = Bedrooms features_raw[3] = 1 Basically, I want to take data like this: Beds 1 Baths 1 Garage Yes and create an array on the fly: House[beds]=1 House[baths]=1 House[garage]="yes" The problem is that the order of Beds, Baths and Garage changes. So on some house pages the order would be Baths, Garage, Beds.. etc. Any pointers out there? Thanks, Brett
  7. I figured it out. The DIVs were overlapping, and apparently IE7 didn't like it. Aarrgghh.
  8. www.presto-technologies.com The site works fine in FireFox, Safari and IE8 but I open the site in IE7, the Main-Content and the Sidebar Divs line up in succession, not adjacent to each other. Anyone have any idea what I'm doing wrong? I was recommended to get IE7 displaying properly, then use the tag: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> so that IE8 would work fine too. * { margin: 0; padding: 0; } body { font-size: 62.5%; background: url(../images/blackwhirl2.jpg) repeat; } p { font: 1.2em/1.8em Georgia, serif; margin-bottom: 10px; color:#cc9966; } p.forms{ font: 1.1em Georgia, serif; margin-bottom: 10px; color:#cc9966; } h1 { font: 2.0em Georgia, serif; color: #cc9966; } h2 { font: 1.5em Georgia, serif; color: #cc9966; margin-bottom: 10px; } ul { margin-left: 25px; } img { border: none; } #listinbody{ font: 1.2em/1.8em Georgia, serif; color:#cc9966; } #page-wrap { min-width: 920px; max-width: 920px; margin: 10px auto; } #page-wrap #inside { margin: 10px 10px 0px 10px; padding-top: 10px; padding-bottom: 10px; } #main-content { width:800px; padding-left: 40px; padding-top: 20px; } #header { background-image: url(../images/icons/blackwhirl2.jpg); text-align: center; } #left-sidebar { width: 150px; float: right; padding-left: 15px; padding-top: 20px; } #footer { text-align: center; padding-top: 20px; padding-bottom: 20px; color: #cc9966; } ul.option{ list-style-image: url(../images/icons/arrow-right.png); } ul.option li { font: 110% georgia, times, serif; color: #cc9966; margin: .5em 0; } a:link {color:#cc9966} /* unvisited link */ a:visited {color:#cc9966} /* visited link */ a:hover {color:white}
  9. There's a lot of redundant data in my URL's. The only parts that change are the ID numbers and the LOOT numbers. http://trend.trendrets.com:6103/platinum/getmedia?ID=70054419106&LOOT=50038672093 If I just extract the ID and LOOT from the url and store them in the database, then assign them to separate columns, this would greatly speed up the search, right?
  10. I'd like to put them on my server. I'm going to re-think this database design then post what i've come up with. Right now, I've got 2 tables Listings: (address, city, state, price, beds, bathrooms, etc.(there's 35 fields)) Listing_Pictures: (Picture URL(from the feed), PictureOrderNumber, ListingID)
  11. I'm using it for a Real Estate search function. it already takes like 4 seconds to query the database. I wonder if my database should be broken up into separate tables according to County name or City Name.
  12. Forgot to mention, i've got 5 milion URL's in my database.
  13. Ok, so I get a feed from an XML source which I've imported into my database. Within the feed, there is an image URL in the form of: http://trend.trendrets.com:6103/platinum/getmedia?ID=70054419106&LOOT=50038672093 I want to take this image url and save the image it's referring to it to a folder on my server. How do I go about doing this?
  14. I found this on PHP.net in the manual : Can anyone help me out with implementing this? For large files, consider using stream_get_line rather than fgets - it can make a significant difference. $ time yes "This is a test line" | head -1000000 | php -r '$fp=fopen("php://stdin","r"); while($line=stream_get_line($fp,65535,"\n")) { 1; } fclose($fp);' real 0m1.482s user 0m1.616s sys 0m0.152s $ time yes "This is a test line" | head -1000000 | php -r '$fp=fopen("php://stdin","r"); while($line=fgets($fp,65535)) { 1; } fclose($fp);' real 0m7.281s user 0m7.392s sys 0m0.136s
  15. Update: the script hangs on line 49: array_walk($parts,create_function('&$v','$v = mysql_real_escape_string($v);')); //Run all parts through mysql_real_escape_string() possible memory leak here?
  16. I can run in debug mode fine, when I start dealing with the insert, it comes back with the memory error.
  17. Fatal error: Out of memory (allocated 39059456) (tried to allocate 4864 bytes) in /home/mulhol/public_html/xml/media_linebyline.php(48) : runtime-created function on line 1
  18. I get an out of memory error after about 5 seconds. I checked the table in phpMyAdmin and it seems that 45k records made it in... hmm
  19. wow, thanks Aaron. Now i've just got to wait 20 minutes for this file to upload then i'll give it a go..looks like it's going to work tho!
  20. Ok here's a run down of what I'm trying to accomplish: There's a Real Estate Listing server that stores listing infomation (know as the RETS server). RETS has every house that's currently for sale along with all the details for each house. There are a few different tables, but mainly i'll be using 3 tables : PropertyDescription, PropertyMedia, & ListingAgent. The only control I have when selecting what data to download is the column names. For the ListingAgent & PropertyDescription, I simply select all from their server and export to seperate XML files. For the PropertyMedia table, I select the 3 columns which I need for the database (imgURL,ListingID,PictureOrderNumber). The PropertyMedia table is tricky, because each house could have either 1 picture or 20 pictures. Multiply that by 30,000 houses and the amount of data increases pretty quickly. As far as using simplexml, i've already had success with both the PropertyDescription and ListingAgent tables and i've imported those into my database. Perhaps XMLREADER will work with larger files? Any tips with starting this?
  21. ay ay ay.... now where do I freaking start... 5.5 MILLION records <RETS ReplyCode="0" ReplyText="V2.3.3 590: Success"> <COUNT Records="5457011" /> <DELIMITER value = "09"/> <COLUMNS> PropItemNumber PropMediaURL ListingID </COLUMNS>
  22. This all doesnt matter anyway - the xml feed that i'm downloading right now is at 520M and still going (doesn't tell me how big the file will be until its finished downloading)... ahh i'm clueless with this RETS stuff..
  23. Internal Server error 500 - i dont even know if i'm editing the htaccess right - i just pasted the code right in the middle: php_value memory_limit 112M
  24. php memory limit already set to 64M --- WEIRD! this does now make me realize that the core.* dumps that I was seeing earlier were all 64M. does simple xml inflate the file when reading from it?
  25. I got the php script to run with a 12 meg xml file ( i deleted 75% of the file). This is a problem. I get a feed every day with housing information. Now i'll have to manually edit this xml every day and chop it into smaller parts.. Is there any way for simplexml to open each line of the file one by one as it needs to? or maybe even this idea: do{ Open Media.xml as Text File; $variable1 =(first 100k lines of file) $variable2 =(2nd 100k lines of file) }until end of file then insert the variables into the simple_xml parser w/ loops. This way the server doesn't get over loaded.
×
×
  • 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.