Hello!

That's nice! Jerry, can you create a tar file with click.php3 and
little README on script installation and usage? We will upload it
to our site in "Download" - "Front-ends & Utilities".

Thanks.


Jerry Allen wrote:
> 
> Rambling Thoughts...
> 
> It would be great if we could track both the querys
> and the clicks... I have a simple click.php3
> that does this, what I would like to see
> is some additional smarts in udm...
> 
> Track the clicks on urls, in the url record,
> and be able to "weight" the urls based on clicks
> along with content etc. during search.
> 
> The following example only tracks the 1st click search
> specs, but updates the click hits on additional clicks
> it could be modified to track every click seperately
> but it would most likely over load a busy site.
> 
> click.php3
> <?
> // control the caches and Netscape/IE
> Header("Cache-Control: must-revalidate");
> $offset = -1;
> $ExpireString = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) .
> " GMTHeader($ExpireString);
> // lets not throw out any errors, just redirect the user
>   error_reporting(0);
>   $dbase="udmsearch";
>   $table="clicks";
>   mysql_pconnect("localhost","YOUR_DB","YOUR_PW");
>   $url=$site;
> // test to see if url has been clicked, update old
>   $result=mysql("$dbase","select * from $table where url='$url'");
>   if(mysql_numrows($result)>0):
>     $count = mysql_result($result,0,"count");
>       $count++;
>     mysql("$dbase","update $table set count=$count where url='$url'");
>     $string=$count;
>   else:
> // insert new
>  $count="1";
>  mysql("$dbase"," INSERT INTO $table values('','$url','$count','$spec')");
>  endif;
>  header ("Location: $url\n\n");
> ?>
> 
> database structure
> 
> # Table structure for table 'clicks'
> #
> CREATE TABLE clicks (
>   uid int(12) DEFAULT '0' NOT NULL auto_increment,
>   url varchar(128),
>   count int(12) DEFAULT '0' NOT NULL,
>   spec varchar(128),
>   PRIMARY KEY (uid),
>   KEY uid (uid),
>   UNIQUE uid_2 (uid)
> );
> #
> 
> Modify your template:
> Look for $DU
> make it like below, the url and search specs are
> passed back to the web server via user click, and
> logged for future ref.
> <DL><DT>
> <b>$DN.</b> <a href="./click.php3?site=$DU&spec=$q" \
> TARGET="_self"><b>$DT</b></a> [<b>$DR</b>]<DD>
> $DX...<BR>

-- 
Alexander Barkov
IZHCOM, Izhevsk
email:    [EMAIL PROTECTED]      | http://www.izhcom.ru
Phone:    +7 (3412) 51-32-11 | Fax: +7 (3412) 78-70-10
ICQ:      7748759
______________
If you want to unsubscribe send "unsubscribe udmsearch"
to [EMAIL PROTECTED]

Reply via email to