Jump to content

mentalist

Members
  • Posts

    291
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mentalist

  1. At the moment your scraping, the good old brute force method. To do it any other way you'd need to access the the site api. For facebook see here... http://developers.facebook.com/
  2. I'm wondering about the size you specify in your page... <iframe src="http://api.recaptcha.net/noscript?k=6LdNkboSAAAAAFuLR2KYj2gqLrcKX9E3OlIvYzUO " height="300" width="500" frameborder="0"></iframe> try width="300px"
  3. The easiest way to demonstrate this is with a touch of code: <div style='width:400px;background-color:#aff;font-size:16px;'> This should be about the right width...............<br /> <br /> <!--<table width='100%'><tr><td>--> <div style='background-color:#faf;font-size:16px;'><pre>This is an extra long piece of text which will need to overflow onto the next line or push out...</pre></div> <br /> <div style='background-color:#faf;font-size:16px;overflow-x:scroll;'><pre>This is an extra long piece of text which will need to overflow onto the next line or push out...</pre></div> <br /> <div style='background-color:#faf;font-size:16px;overflow-x:scroll;white-space:pre;'>This is an extra long piece of text which will need to overflow onto the next line or push out...</div> <br /> <!--</td></tr></table>--> </div> As is the code should do what it's supposed to do. But if you remove the quotes and wrap the divs in a table then they inherit width from somewhere and push out of the container... Any suggestions as to how to restrain them? Cheers! P.S. I can't stop these overflow divs from not being placed within tables, so just removing the table is not enough.
  4. I'm playing with twitter. I'm receiving an xml document and using preg_match_all on it. What i'm wanting to do is split it on the <user> tags. This is the code i'm trying... preg_match_all('#<user>([.\s\n]*)</user>#',$s,$matches); I've tried variations, all to no avail. I'm actually unsure about the hash / pound 's at either end, but the example I got it from uses them... Not sure if it's the angle brackets and such that's playing up... Thanks for any help!
  5. Hi, I'm just playing with creating my own functions, see http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html But i'm wondering how to only create the function if it doesn't already exist...
  6. hmmm, this seems to show the way... http://r937.com/keyword_relevance.html Obviously not as quick as full-text searching, but once refined performs fairly well and does precisely what it says on the tin...
  7. Hi When I say counting matches, I mean from within text. Say I do a REGEXP on a piece of text, can I receive how many matches? Say something similar to the return value of PHP's 'preg_match_all'? Cheers...
  8. Hi, I can work many aspects of full-text searching, however what 'they' call the 50% threshold still kicks me every time. Say I construct data in a table which is all very relevant / similar, then the returned results are either none, or the relevance's are all the same. Say here's a table definition: CREATE TABLE test_search (id int not null primary key auto_increment, title varchar(128), info text, FULLTEXT(title,info) ) And into I put the following data: INSERT INTO test_search VALUES ('','One','jelly fish'), ('','Two','jelly fish jelly fish'), ('','Three','jelly fish jelly fish jelly fish'), ('','Four','jelly fish jelly fish jelly fish'), ('','Five','jelly fish jelly fish jelly fish jelly fish jelly fish'), ('','Six','jelly'), ('','Seven','jelly welly'), ('','Eight','jelly boot') Then a query of: SELECT title, info, MATCH(title, info) AGAINST('fish') AS relevance FROM test_search WHERE MATCH(title, info) AGAINST('fish') yields absolutely no results... On the other hand if I initially set the table data to: INSERT INTO test_search VALUES ('','One','jelly fish'), ('','Two','jelly fish jelly fish'), ('','Six','jelly'), ('','Seven','jelly welly'), ('','Eight','jelly boot') then I get two results, each with the same relevance, even though one result should be twice as good as the other... WHY? HOW? PLEASE!
  9. ok, me bein im elsewhere... :'( cookie particulars: host: 10.0.0.55 path: http://10.0.0.55/cmstmp/onebigsofa/cmsmonkey.0.4.1/ typical page calls... (mod rewrite always passes to index?). http://10.0.0.55/cmstmp/onebigsofa/cmsmonkey.0.4.1/ http://10.0.0.55/cmstmp/onebigsofa/cmsmonkey.0.4.1/index?feedback=Welcome%20back http://10.0.0.55/cmstmp/onebigsofa/cmsmonkey.0.4.1/index.phtml http://10.0.0.55/cmstmp/onebigsofa/cmsmonkey.0.4.1/site/special.html a typical use of setcookie: setcookie(_CMS_COOKIE_NAME,'012',time()+31536000,$site_data['site_addr'].$site_data['dir_path']); in the debug bit... This code... $sret .= $_COOKIE[_CMS_COOKIE_NAME]."<br />\n"; //$sret .= $HTTP_COOKIE_VARS[_CMS_COOKIE_NAME]."<br />\n"; print_r($_COOKIE); // Print all cookies yeilds: Notice: Undefined index: stayin in /var/www/html/cmstmp/onebigsofa/cmsmonkey.0.4.1/monkey/debug.php on line 60 Array ( [phpSESSID] => g59u7239lh9046v5ca0v44smu2 ) what, where, when, who, why and how the blazes...
  10. ive also just got this issue, a 'Undefined Index', but cookie is in firefox and opera, no access to it from php from google they say to wrap name in quotes, still no
  11. Why not set it to NULL, then if at a later date you want to update/change it's association, then just check to see if it's NULL, else use ID. Or, if there always to be the same (redundant data use), then why not try setting both columns to 'auto inc', (not that i've ever tried it, might have to drop the 'primary' bit though).
  12. So, you want two columns that are identical?
  13. I'm lost! Are you saying that both the values should be the same? Are you trying: mysql_query("INSERT INTO `table` (`ID`, `SecondID`) VALUES ('', ID)"); Is the ID column defined as auto increment ? (in whichever table you wanting it from)
  14. Ah, well then, in reality it hasn't taken place, because the function mysql_insert_id is technically called (expanded) before the query is made... If your trying to do what I think you are, why not use an 'auto increment' column? But unless it's the last insert query that you really want, I can't see the point...
  15. oooh, I like the look of that, thanks... Here's where it's at at the moment... but still just testing... seeing what weights what and goes where... $s = "SELECT *, MATCH(title,info) AGAINST ('".$searchy."') AS score, LOCATE('".$searchy."', title) AS score_locate_title, LOCATE('".$searchy."', info) AS score_locate_info, (title REGEXP '".$searchy."') AS score_regex_title, (info REGEXP '".$searchy."') AS score_regex_info, STRCMP(title, '".$searchy."') LIKE 0 AS score_strcmp FROM test_search WHERE LOCATE('".$searchy."', title) || LOCATE('".$searchy."', info) Cheers...
  16. I seem to be able to go this way though... [code STRCMP(title, '".$searchy."') LIKE 0 as score_strcmp Which gives me either 0 or 1 results...
  17. Is there any way of doing maths in the ORDER section? ... ORDER BY score_strcmp if = 0
  18. This is just part of the set of clause and order bys. It's a bit of a search thing and i'm after adding an extra weight if the title is an exact match. So a sort by 'title' would give nonsensical ordering. Even though, i'm not sure if any of it's results would be of any use other than if it were 0... hmmm
  19. So does that work then? $id = mysql_insert_id(); mysql_query("INSERT INTO `table` (`ID`, `SecondID`) VALUES (NULL, '".$id."')"); If so, it'll be something to do with how the statement is evaluated internally (probably by php rather than mysql).
  20. Just a hunch, but if mysql uses an internal 'global' pointer to the last insert id, then as it's starting the insert, it'll reset the id to null (0). But technically i'd say that mysql_insert_id() should be returning a result before that statement is sent to mysql. Therefore i'd have to ask if the previous insert was successful and do you print out the result to prove the fact? $id = mysql_insert_id(); echo 'id: '.$id.'<br />'; mysql_query("INSERT INTO `table` (`ID`, `SecondID`) VALUES (NULL, '".$id."')");
  21. Here's a quick guess.. $query = "SELECT * FROM user_ach LEFT JOIN cat_order on user_ach.cat = cat_order.cat WHERE user_id = $cookie AND ach_id = $counter ORDER BY cat_order.id";
  22. Hi, Here's a simplified version of my statement: SELECT *, STRCMP(title,'word') as result FROM table ORDER BY result The docs for STRCMP state: No matter if I use ASC or DESC, the results aren't really in order... e.g. ASC: -1, 0, 1 DESC: 1, 0, -1 I don't want to use a WHERE clause because I want all the results. Any ideas? Is there a way to dynamically reassign the results, e.g. 'if -1 then 2' ? ? ? Cheers...
  23. I've just updated most of my menu generation functions to incorporate 'div' wrappers so they can be managed by CSS easier / better. However even though the menu's are still correct, the way they align within their respective page blocks is all defunct. Please... What's the easy way to centre and right align div's within div's? P.S. I'm just off for a cup o' char so I might add an example in a little while...
  24. So there's no way to make the width as small as possible for a dynamic element. As usual i've fallen back to html, wrapped it in a table and hey presto, exactly what I want... But i'm not supposed to be using tables...
  25. no, that's right. I'd like it to snugly wrap the inner contents, which will be dynamically generated, so size is unknown, well sometimes it'll contain 3 elements, others 5, but they can vary in content, (it's for pagination).
×
×
  • 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.