PDA

View Full Version : Need to modify custom template for click stats


vinyl-junkie
10-03-2004, 10:02 AM
I noticed in the default phpdig template the following code just below the </style> tag:<phpdig:js_for_clicks/>All of my header stuff for my template is in a php object, which I think would treat that as a literal rather than parsing it, so I started looking around for where js_for_clicks is defined (which is in search_function.php) and added the following code to my template header just below my CSS file definition:

<script language="JavaScript">
<!--
function clickit(cn,clink) {
if(document.images) {
(new Image()).src="clickstats.php?num="+cn+"&url="+clink+"&val=".urlencode($js_string)
}
return true;
}
//-->
</script>However, the click stats still aren't getting logged. What am I missing? I don't understand a lot of javascript, so I don't know if the above code is incorrect or if it's something else that is the problem.

Thanks in advance.

Charter
10-04-2004, 10:08 AM
The $js_string variable doesn't seem like it gets passed a value. Look at the HTML and search for clickit in the search result page links and also search search_function.php for clickit to see what is being passed.

vinyl-junkie
10-04-2004, 07:34 PM
OK, I think I see what's happening. I have a set of parameters that is getting passed into my Template class, but $js_string isn't one of those values. Boy, that's going to be a royal pain to add! :( Well, I've done that before. I guess I can do it again. *sigh*