Hi, in order to add a column to indicate if a visitor has downloaded a file, I've made a little change in the file visitorinfo.module. I did try to use View without luck, I wasn't able to link visitor info to download count or vice-versa.
It requires to have already installed the Download_count module.

It works like that:
- try to get the current looped IP ($data->ip) from the {download_count} table, field ip_address,
-> if found I try to get the referrer if it exists, and the file ID.
-> I also take the filename from {files} by comparing file ID.

- if no referrer is found, I only take the filename.

They are a lot of ways to present it, adapt the little code below to your needs.
I decided to show a little icon in a newly created 'DL' column, only if a file was downloaded, if a referrer is found I add a red dot next to this icon. Then icon's title tooltip contains eventual referrer and filename.
I add an alternative where icon changes it's color depending if external, internal or no referrer is found.



Into file visitorinfo.module SEARCH _visitorinfo_get_origin() function (line 155) then:

SEARCH
if ($cols['ip']) {$visitor_table .= "<td>IP</td>";} (line 171)

INSERT BEFORE (title of the column)
$visitor_table .= "<td>DL</td>";

SEARCH
if ($cols['ip']) {$visitor_table .= "<td>" . $data->ip . "</td>";} (line 191)

INSERT BEFORE (version with red dot when there is a referrer and a generic download icon)

<?php  $sourceip = $data->ip;
	  $dlresult = db_query("SELECT ip_address,referrer,fid FROM {download_count} WHERE ip_address = '".$sourceip."' LIMIT 1");
	  $dldata = db_fetch_object($dlresult);
	  	if($dldata->ip_address == $sourceip){
			$filenresult = db_query("SELECT fid,filename FROM {files} WHERE fid = '".$dldata->fid."'");
			$filenamedl = db_fetch_object($filenresult);
			$visitor_table .= "<td><img src='/sites/default/files/pictures/misc/download_small.png' width='16px' height='16px' title='".$filenamedl->filename."";
			if($dldata->referrer){
				$visitor_table .= " depuis ". $dldata->referrer ."' /><span style='color:red;'><b>.</b></span></td>";
			}
			else{
				$visitor_table .= "' /></td>";
			}
		}
		else{
                     $visitor_table .= "<td></td>";	
		}
 ?>



OR INSERT BEFORE (version which makes a difference between internal (green icon), external (blue icon) or no referrer (grey icon), so no need for red dot.)

<?php
$sourceip = $data->ip;
	  $dlresult = db_query("SELECT ip_address,referrer,fid FROM {download_count} WHERE ip_address = '".$sourceip."' LIMIT 1");
	  $dldata = db_fetch_object($dlresult);
	  	if($dldata->ip_address == $sourceip){
			$filenresult = db_query("SELECT fid,filename FROM {files} WHERE fid = '".$dldata->fid."'");
			$filenamedl = db_fetch_object($filenresult);
			$visitor_table .= "<td><img src='/sites/default/files/pictures/misc/";
				if(!$dldata->referrer){
					$visitor_table .= "download_null_small.png'"; //no referrer
				}
				elseif(strpos($dldata->referrer, "http://".$_SERVER['SERVER_NAME']) === FALSE){
					$visitor_table .= "download_ex_small.png'"; //external referrer
				}
				else{
					$visitor_table .= "download_small.png'"; //internal referrer
				}
			$visitor_table .= " width='16px' height='16px' title='".$filenamedl->filename."";
			if($dldata->referrer){
				$visitor_table .= " depuis ". $dldata->referrer ."' /></td>";
			}
			else{
				$visitor_table .= "' /></td>";
			}
		}
		else{
			$visitor_table .= "<td></td>";	
		}
?>



Don't insert PHP tags (<? php and ?>), I only add them for the code to be colored in the quote.

You'll then have to:
- modify 'depuis', which means 'from' into your langage.
- if 1st code part is choosen: upload an image to make this work and modify this path accordingly: /sites/default/files/pictures/misc/download_small.png
-if 2nd code part is choosen:
- upload 3 different icons,
- adapt this line to your site address <?php elseif(strpos($dldata->referrer, "http://".$_SERVER['SERVER_NAME']) === FALSE){ ?>
It is possible that you need to remove the "http://". if your site is accessible with or without www.

That's it, now you'll get something like in the attached files, depending on column you choose to show (I erased IP for privacy).



twooten, I don't know if it is possible, but perhaps you could take this idea and really insert it into Visitor Info module, by adding this new column the way you add the others (selectable in admin panel), and some checks to see if download module is installed. Also, it would be nice that several sources for download count are accessible, not only Download_count module.
But perhaps it is totally not in the spirit or theme of the module, I don't know...


If it is, another nice thing would be to add this check before map calculation and then change marker colors if the location has also downloaded a file, in order to have a more visual region's view than with the list.
I didn't get how to put different markers (Gmarker & GIcon), but I succeed in removing IP infos from JS array (to be able to show publicly the map without divulging personal visitor's info via the common JS console) and add the filename and referrer to the marker's tooltips.
If I succeed with custom markers I'll come back to give the code chunk here.

edit: removed the dot before the path.

CommentFileSizeAuthor
DC into VI v2.png24.27 KBAvvAdeh
DC into VI.png15.1 KBAvvAdeh