Jump to content

Saphod

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.saphod.net

Profile Information

  • Gender
    Not Telling

Saphod's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What about this one? http://sourceforge.net/projects/phpwhois
  2. Thanks so far. Let's see what I can find. I might then post my results here.
  3. Hi and thanks for the quick answer. I just want the users to decide if they need more information by a click. Could you name some good script sites (as I do not know any)? Thanks! PS: The WHOIS on http://www.heise-online.co.uk/networks/tools/whois-query works this way, I guess.
  4. Does anyone know a PHP script for WHOIS queries of an IP, including * ARIN * APNIC * LACNIC * RIPE * InterNIC * DoDNIC that can be easily integrated into a WordPress plugin? My aim is to give the user some information of the IPs visiting his site to filter out spam. The script should query one of the above databases and automatically move on to the next one until it finds some relevant information. Even a script that can easily be modified by myself would be nice, as well as some general information on how to do WHOIS queries with PHP. Thank you!
  5. luca200 & KenDRhyD: Thanks very much to both of you! I think your explanations made things much clearer for me now. I'll keep that in mind when I have the next question. ;-)
  6. OK, I am trying to comprehend all the differences between all the JOIN statements. So, what exactly does LEFT OUTER JOIN mean? It must serve a purpose - it ain't just something that can be left out, right?
  7. Wow, that was quick... thanks, guys! I must admit I definetly understand luca200's statement better - sorry, KenDRhyD What I did not know is that you can just add another left join on the log table. So, this is basically two statements merged into one, right? I have absolutely no idea of the UNION statement... @KenDRhyD: Why would you use LEFT OUTER JOIN?
  8. Hi, I am relatively new to MySQL and I would greatly appreciate some help. I have three tables: log (id, ip, time, url, referer, user_agent) blocked_IPs (id, ip) excluded_IPs (id, ip) What I'd like to do is show all necessary information from log where NEITHER the ip is in table blocked_IPs NOR the ip is in table excluded_IPs. If I had to leave out just the ips that are blocked, I would try: SELECT ip, time, url, referer, user_agent FROM log LEFT JOIN blocked_IPs ON log.ip = blocked_IPs.ip WHERE blocked_IPs.ip is NULL Is this right? And how do I now add the 3rd table excluded_IPs to the statement so that the IPs listed there are also excluded from the selection? Or, in other words, how can I use the join on three tables? Thanks in advance!
  9. OK, nice, this gives me a single array with all the results - thanks. I also thought about doing a step-by-step regex with preg_match rather than getting everything with preg_match_all all at once: a) search for the whole "[embed_viewat(.*)]" string b) search for "width" c) search for "height" d) search for "id" e) search for "lang" I think this makes it easier even to respond with a possible error message, right?
  10. Hi, here is my problem (very detailed, but the main problem is a regex one, believe me): Viewat.org provides the possibility to embed panorama images in your blog. Unfortunately, this is based on a javascript-code which - in WordPress - is a little tricky to insert into a post. It is possible to embed it via flash directly (as the script does nothing else), but it is done via <object> and <embed> which is not XHTML-valid. For WordPress, a plugin for embedding flash movies XHTML-vaild already exists. This one is used via a pseudo-tag which is translated "on-the-fly" when the post is being shown in the browser (via WordPress filter). Therefore, I would like to write a little plugin with PHP that does the following as soon as a post is saved/published: a) Find the whole string in the post content that has the command for my plugin. Desciption: The command string I am searching for should e.g. look like this: [embed_viewat width=600 height=400 id=1234 lang=de] "width", "height" and "lang" should be optional, "id" is a must. It should not matter where after the "embed_viewat" the parameters are: width could be at the beginning, in the middle or the end, as could any other parameter (this is the trickiest thing for me and regex). b) Parse the string and extract the parameters. Desciption: I would like to have the parameter values in an array for later use. Then I test if at least an "id" is given, otherwise there will be an error message. c) Pre-write the command for the other plugin in a variable using the above parameters. d) Replace the whole string "[embed_viewat.....]" in the post contents with the command in c) and save the post. The problem is definetly the regular expressions to use with preg_replace or whatever. I have tried this one (with regextester.co.nr): ~\[embed_viewat (width=[0-9]+)|(height=[0-9]+)|(id=[0-9]+)|(lang=[a-z]+)\]~ Well, it does not really work... I tried the example under a): [embed_viewat width=600 height=400 id=1234 lang=de] This leads to the following haystack: Array ( [0] => Array ( [0] => [embed_viewat width=600 [1] => height=400 [2] => id=1234 [3] => lang=de] ) [1] => Array ( [0] => width=600 [1] => [2] => [3] => ) [2] => Array ( [0] => [1] => height=400 [2] => [3] => ) [3] => Array ( [0] => [1] => [2] => id=1234 [3] => ) [4] => Array ( [0] => [1] => [2] => [3] => lang=de ) ) whereas I think I will need something like this: ( [0] => [embed_viewat width=600 height=400 id=1234 lang=de] [1] => width=600 [2] => height=400 [3] => id=1234 [4] => lang=de ) I mean, I need the whole string AND THEN the parameters. Does that make sense? This one [embed_viewat height=400 width=600 lang=de id=1234] leads to: Array ( [0] => Array ( [0] => height=400 [1] => id=1234 ) [1] => Array ( [0] => [1] => ) [2] => Array ( [0] => height=400 [1] => ) [3] => Array ( [0] => [1] => id=1234 ) [4] => Array ( [0] => [1] => ) ) whereas I would (again) need something like this: ( [0] => [embed_viewat height=400 width=600 lang=de id=1234] [1] => height=400 [2] => width=600 [3] => lang=de [4] => id=1234 ) I also posted this in the wordpress support forum for those who are interested: http://wordpress.org/support/topic/172726 I'd be grateful for any help on this. Thanks!
  11. OK, but I do not know if Wordpress works with this, because I think it only affects strftime(), not date() or time(), right? Is there a way to configure PHP's localization in the PHP config files? I know a little bit about the usage of PHP, but I have no idea about customization/configuration at all. Same with Apache and MySQL, BTW... usage: yes, config: no idea... :-)
  12. the_time is a Wordpress function that gets certain post information about the date and time from the database. Look here in the cross reference of WP 2.5: http://phpxref.com/xref/wordpress/nav.html?wp-includes/general-template.php.source.html#l791 The way I use it is <?php the_time('F jS, Y @ H:i:s O (T)') ?> where 'T' is supposed to say CEST or CET, not the German expression. I am afraid it might be a problem with the XAMPP localization?!? Can XAMPP be already preconfigured as German?
  13. Hi! I am using WordPress (wordpress.org) on an offline XAMPP installation. When I use "the_time()" - a WP-function that is supposed to show the time and date of the post - I get a German output ('cause I am German and using a German Windows XP). So, basically it says "Westeuropäische Sommerzeit" instead of "CEST". More here (where no one could help me so far): http://wordpress.org/support/topic/169785 Any ideas?
  14. I have now tried this: (...) <?php $fp = fsockopen("http://services.digg.com", "80", $errno, $errstr); if (!$fp) { echo "Error!"; } else { fwrite($fp, "GET stories/?domain=heise.de&appkey=http%3A%2F%2Fexample.com%2fapplication&sort=digg_count-desc&count=10 HTTP/1.1\r\n"); fwrite($fp, "Host: services.digg.com\r\n"); while (!feof($fp)) { $d = fgets ($fp,2048); echo $d; } fclose($fp); } ?> (...) which leads to this: [pre] Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in ....../test.php on line 14 Warning: fsockopen() [function.fsockopen]: unable to connect to http://services.digg.com:80 in ....../test.php on line 14 Error! [/pre] I found something interesting here, maybe I will use that: http://groups.google.com/group/diggapi/... The funny thing is: there is a Wordpress plugin that actually uses fsockopen() quite successfully...
×
×
  • 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.