Page 1 of 1

Whois (GPL) integration

Posted: Mon 14. Mar 2005, 06:55
by cyaneo
I try tho integrate the open source script "topdog whois"

The script
PS: download both, 3.0 and 3.1.1

Demo

The script works with 4 files:
- index.htm (input form = HTML Article in phpWCMS)
- topdog_whois.php
- results.htm (output, just a placeholder: <!--DOMAIN RESULTS--> )
- signup.php (optional form, should be a mailform in phpWCMS)


The problems:
How to get the $domain.$ext (=domain.com) into a field of the mailform in phpWCMS?
The result still is outside of phpwcms - possible to get it inside?


--------------------------------------------------------------------------------------

Ich habe ein passendes Whois script, welches ich gerne in phpWCMS nutzen möchte.
Teilweise funktioniert das schon (wenn auch über Umwege)


Das Scrip benötigt 4 Dateien:
- index.htm (Eingabe form = HTML Artikel in phpWCMS)
- topdog_whois.php
- results.htm (Ausgabe, ist nur ein Platzhalter drin: <!--DOMAIN RESULTS--> )
- signup.php (Übergabe der Domäne, soll an ein Feld eines Formulares in phpWCMS übergeben weden)

Für mich unlösbare Aufgaben:
- Das Script schreibt das Ergebnis der Whois- Abfrage - per print Befehl und Platzhalter - in eine HTML Datei rein (somit ausserhalb von phpWCMS) - wie bekomme ich das in phpWCMS rein
- der Name und die Erweiterung der Domäne wird per "signup.php?domain=WERT übergeben. In einer php Datei bekomme ich das Ergebnis, aber wie bekomme ich das in ein Feld eines von phpWCMS generierten Formulares?


Demo

Das Script

Re: Whois (GPL) integration

Posted: Mon 21. Mar 2005, 15:39
by Neelix
cyaneo wrote: The script
Ich habe mir das Ding mal angesehen:
Der Code ist für eine Anpassung einfach zu schlecht!
...
Wenn es nicht unbedingt dieses Script sein soll:

look here :arrow: http://www.php-free.de/Internet-Utilities/
Ich habe nur einen kurzen Blick auf http://www.shat.net/php/nqt/
geworfen, aber es kann mehr und ist einfacher anzupassen?!

Posted: Mon 21. Mar 2005, 16:20
by cyaneo
It can be any other (or better) script, but the script you offer does not fullfill my needs:
A script, wher user can check if the choosed domain is availlable or not
If not: you cannot register the domain
If yes: go to register form (where the domainname is then automatic given to the form for registration)

Thank you

---------------------------------------------------------------------------------------
Es muss nicht unbedingt dieses script sein, aber das von Dir vorgeschlagenene Tool hat nichts mit dem zu tun, was ich benötige:
Ein Tool, welches abfragt ob der eingegebene Domainnale verfügbar ist oder nicht (keine Whois Auswertung als Ergebnis)
Wenn nein: Registrierung nicht möglich
Wenn ja: weiter zr Registrierung mit übergabe des Domainnamens an das Mailformular.

Danke trotzdem für den Tip.

Posted: Tue 22. Mar 2005, 08:05
by brans
vielleicht baust du einfach folgendes Script aus:
http://traum.vpn-server.de/forum/showthread.php?t=52355

Ich denke dir wird im TP sicher auch bei der Entwicklung geholfen.

RE

Posted: Tue 22. Mar 2005, 11:59
by Neelix
On problem I found / solved:
- the handover of your $_GET / $_POST - values:
- but it's an Hack :roll:
look in your backend->create your e-mail-formular but set the default-value like here:

IT|vorname|1|Vorname:&nbsp;|40,100|_vorname|300
_ is here the flag for me: THIS IS AN REQUEST-VALUE
-> open the frontend and open the article with this Formular-> copy the link

Code: Select all

phpwcms/index.php?id=0,22,0,0,1,0
open your (whois-)script an search the <form> tag:
action="..." fill the link like here

Code: Select all

<form action="phpwcms/index.php?id=0,22,0,0,1,0">
Hack: it's mybe not the best place, but I fount only this...

Code: Select all

#
#---[open]---
#
 include/inc_front/content/cnt10.article.inc.php (email form)
#
#---[find]---
#
switch($cfield[0]) {
//INPUT TEXT
case "IT":
#
#---[Add]---
#
$v= (preg_match("/^_/", $cfield[5])?'value="'.$_REQUEST[substr($cfield[5],1)].'"':'value="'.trimhtml($cfield[5]).'"');
//${$cfield[5]} - will not run :(
#
#---[find]---
#
														$content["main"] .= ... value= ...
#
#---[repace with]---
#
$content["main"] .= '<input type="text" name="'.$cfield[1].'" '.$v.' size="'.$cfield_length.'" ';
=========================
Idea: if the sript found underline-values, it will be replace with the values from the $_REQUEST array ...
-----------------------
the sript @brans: in my next post... :wink:

next step

Posted: Tue 22. Mar 2005, 16:32
by Neelix
1'st:
!install the $_REQUEST-HACK see above!
!Warning! THIS IS AN HACK - using without warranty!
Backup:
include/inc_front/content/cnt10.article.inc.php
- the goal is like that: index.php?id=0,22,0,0,1,0&url=www.blablabla.tld
----------------------------------------

create 2 article (or edit one):

->for the whois-script: (content: html)
(switch to source)
#
#---[add]---
#
{PHP:./whois.php}

->for the the email-form
...
Subject: whois-test
...
IT|url|1|Domain:&nbsp;|40,100|_url|300
...
--------------------------
look in the frontend an copy the link 4 your email-article and whois-article
you will need it later.
--------------------------
->download the script: http://traum.vpn-server.de/forum/showthread.php?t=52355
-> copy to your phpwcms-root (!or in your own - but edit then the script-call to!)
#
#---[open]---
#
whois.php

#
#---[find]---
#
if($domain->is_available())
{
echo 'Dieser Domain-Name ist noch frei!<br>';
}
#
#---[replace]---
#
# look in the frontend an copy the link 4 your email-article:
# in the example: index.php?id=0,22,0,0,1,0

if($domain->is_available()) //Neelix: if Domain available: here can you insert an link to your email-form
{
echo 'Dieser Domain-Name ist noch frei!<br><a href="index.php?id=0,22,0,0,1,0&url='.urlencode("www.".$_GET['url'].$_GET['endung']).'">Send E-Mail</a>';
}

#
#---[find]---
#
<FORM action="<? $PHP_SELF ?>" >
#
#---[replace]---
#
# look in the frontend an copy the link 4 your whois-article
# in the example: index.php?id=0,27,0,0,1,0
# strange behaviour: after an break - don't work anymore.
# solution:
#<FORM action="index.php">
# <INPUT type="hidden" name="id" value="0,27,0,0,1,0">

# can anybody say way? - easter egg by php? - forget to save? - X-Files?

<FORM action="index.php?id=0,27,0,0,1,0" >

Posted: Tue 22. Mar 2005, 22:01
by cyaneo
OK- after some try: this hack does'nt work for me cause mod_rewrite (I think).

Additional, I don't like hack into core files for extension, so I try another, working solution (but it use the topdog script - Maybe some of the experts out there can switch this to the whois.php above...)

I'm a noob in php but can read text...:wink: ...so some of the following may be not logical to some php experts.

OK - let's go:

1. create article (index.php?id=26,23,0,0,1,0) for domain check:
content: HTML

Code: Select all

<form method="post" action="topdog_whois.php">
    <input type="text" name="domain" size="20">
    <select size="1" name="ext">
    <option selected value="at">.at</option>
    <option value="co.at">.co.at</option>
    <option value="or.at">.or.at</option>
    <option value="de">.de</option>
    <option value="com">.com</option>
    <option value="net">.net</option>
    <option value="org">.org</option>
    <option value="info">.info</option>
    <option value="biz">.biz</option>
    <option value="us">.us</option>
    <option value="co.uk">.co.uk</option>
    <option value="dk">.dk</option>
    <option value="it">.it</option>
    <option value="ws">.ws</option>
    <option value="be">.be</option>
    <option value="name">.name</option>
    </select>
    <input type="hidden" name="option" value="check"><br/><br/>
    <input type="submit" value="weiter" class="button">
</form>
2. create article for order form (index.php?id=26,24,0,0,1,0)
content: (the new) email contact form
field for Domain:
type: hidden
name: domain
label: none
value: [PHP]include('signup.php');[/PHP]

3. in topdog_whois.php (line 296)
search for

Code: Select all

                        print   "\n<!-----------------\n";
                        print        "\tPOWERED BY\n\n";
                        print        "\tTOPDOG WHOIS & DOMAIN CHECK SCRIPT\n";
                        print   "\t&copy; KISSA ANDREW COLIN\n";
                        print        "\tkissandrew@yahoo.com\n";
                        print        "\twww.topdog-software.com\n";
                        print        "\n------------------->\n";
                print   "<table width=\"100%\" border=\"0\" cellPadding=2 class=font1l>";
                print   "<tr><td><b>Domain query Results for \"$domain.$ext\"</b></td></tr>";
                print   "<tr><td><hr></td></tr>";
                print   "<tr><td>The domain is available <a href=\"$registerlink?domain=$domain.$ext\">register</a> it now</td></tr>";
                print   "</table>";
replace with

Code: Select all

//                        print   "\n<!-----------------\n";
//                        print        "\tPOWERED BY\n\n";
//                        print        "\tTOPDOG WHOIS & DOMAIN CHECK SCRIPT\n";
//                        print   "\t&copy; KISSA ANDREW COLIN\n";
//                        print        "\tkissandrew@yahoo.com\n";
//                        print        "\twww.topdog-software.com\n";
//                        print        "\n------------------->\n";
               print   "<table width=\"440px\" border=\"0\" cellPadding=2 class=font1l>";
//                print   "<tr><td><b>Domain query Results for \"$domain.$ext\"</b></td></tr>";
//                print   "<tr><td><hr></td></tr>";
                print   "<tr><td>The Domain <b>$domain.$ext</b> is available - you can register it <a href=\"index.php?id=26,24,0,0,1,0&domain=$domain.$ext\">here</a></td></tr>";
                print   "</table>";
4. create file signup.php
content:

Code: Select all

<?php
$html = '
"phpwcmsForm145" id="phpwcmsForm145" action="index.php?id=26,24,0,0,1,0" method="post">
Your Domain: <input class="domain" type="text" name="domain" width="180px" value="'.$_GET['domain'] .'
';
echo($html);
?>
NOTE: the phpwcmsForm145 I've taken from the source of my webbrowser and the input name ist the "name" of the hidden field

5. create results.htm
content: <!--DOMAIN RESULTS--> (AND optional the code of your page cause lookalike the results is "in" your page)

6. again in topdog_whois.php
set these settings (line 73 + 77):
$template = "results.htm";
$registerlink = "";

7. you can also copy these 3 files (to reduce time) to your root directory;
topdog_whois.php
signup.php
results.htm