PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   Need to modify custom template for click stats (http://www.phpdig.net/forum/showthread.php?t=1411)

vinyl-junkie 10-03-2004 10:02 AM

Need to modify custom template for click stats
 
I noticed in the default phpdig template the following code just below the </style> tag:
Code:

<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:

Code:

<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*


All times are GMT -8. The time now is 02:16 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.