Re: drupal php google analytics [message #171014 is a reply to message #171013] |
Wed, 15 December 2010 02:28 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 12/14/2010 9:01 PM, Magno wrote:
> On 12/14/2010 10:05 PM, Jerry Stuckle wrote:
>> On 12/14/2010 5:39 PM, Magno wrote:
>>> On 12/14/2010 07:05 PM, The Natural Philosopher wrote:
>>>> Magno wrote:
>>>> > On 12/14/2010 06:08 PM, Jerry Stuckle wrote:
>>>> >> On 12/14/2010 2:25 PM, canajien wrote:
>>>> >>> It has been a very long time since I have had to do any php
>>>> >>> programming, so please bear with me as I haven't been able to
>>>> >>> find an
>>>> >>> answer to this problem after several searches.
>>>> >>>
>>>> >>> There is a line of code in a drupal template that generates a
>>>> >>> link to
>>>> >>> download a file:
>>>> >>>
>>>> >>> <?php print $node->field_report_file[0]['view'] ?>
>>>> >>>
>>>> >>> this will generate something like this
>>>> >>>
>>>> >>> <a href="filename.pdf">filename</a>
>>>> >>>
>>>> >>>
>>>> >>> We are using google analytics with the website and we would like to
>>>> >>> track how many times people download a file as well, normally to
>>>> >>> track
>>>> >>> a link you would write the code to look like this:
>>>> >>>
>>>> >>> <a href="filename.pdf"
>>>> >>> onclick="pageTracker._trackPageview('filename.pdf");">filename</a>
>>>> >>>
>>>> >>> my problem is modifyng the drupal code to include the onclick, I
>>>> >>> have
>>>> >>> tried
>>>> >>>
>>>> >>> <?php print $node->field_report_file[0]['view'] print onclick=
>>>> >>> \"pageTracker._trackPageview('$node->field_report_file[0]['view']\");?
>>>> >>>
>>>> >>>
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> >>> and several variations, but I know there is something wrong with my
>>>> >>> syntax and I can't simply insert print onclick=
>>>> >>> \"pageTracker._trackPageview('$node->field_report_file[0]['view']\");
>>>> >>>
>>>> >>> into the original command
>>>> >>>
>>>> >>> can someone point me in the write direction?
>>>> >>>
>>>> >>> thanks
>>>> >>
>>>> >> Try the Drupal site - they have a lot of people who are quite
>>>> >> knowledgeable about drupal and can help you.
>>>> >>
>>>> >> TNP's suggestion is mediocre, at best. It fails if, for instance,
>>>> >> people
>>>> >> have javascript turned off - which includes robots which spider your
>>>> >> site.
>>>> >>
>>>> >
>>>> > I have always wondered why the troll keeps this much hatred against
>>>> > TNP. And everytime he can, he calls him mediocre, clueless, and such
>>>> > things.
>>>> >
>>>> > Anyone here knows?
>>>>
>>>>
>>>> I showed him up on at least three occasions to not have a clue about
>>>> that which he spouts. Quoting his beloved manuals that he studies at
>>>> night back to him.
>>>>
>>>> Jerry doesn't like to be shown to be an ignorant pompous asshole. If
>>>> you
>>>> grovel at his feet, he will graciously feed him tidbits of wisdom.
>>>>
>>>> If you dare contest his ownership of the group, you are the spawn of
>>>> the
>>>> devil.
>>>>
>>>> It's a psychological condition he has. Right Man syndrome.
>>>>
>>>> He wants desperately to be a Guru, but he's not good enough so he
>>>> *acts*
>>>> like he is one, and hopes no one will come along who can see through
>>>> him.
>>>>
>>>> Sadly I did.
>>>>
>>>> What pains him worse, is that I don't even want to be a guru. Its
>>>> somehow makes his puny ambitions seem like..puny ambitions.
>>>>
>>>> I mean. look at the response above. The guy wants to know how to frame
>>>> an onclick statement to call up some javascript in a drupal framwork.
>>>>
>>>> Jerry says 'no one would ever use javascript, and that's typical of
>>>> TNP'
>>>> But sadly the OP wanted to know how to use javascript.
>>>>
>>>> He has to change the subject and set up a straw man to recover his
>>>> godlike status. In his own eyes.
>>>>
>>>> to anyone else, he just makes himself look like what he is. From
>>>> time to
>>>> time I goad him a little so everyone with any intelligence can see the
>>>> asshole for what he is: the rest still think he wonderful, but then
>>>> they
>>>> deserve him.
>>>>
>>>> I killfiled him years ago.I never even as a PHP beginner found anything
>>>> he said was not said better, more helpfully and more politely by
>>>> someone
>>>> else. In my lurking here, he has criticised everybodies code. I never
>>>> saw him post a line of his own. He is I believe a one man IT training
>>>> consultant. You can look up his company records and see how much he has
>>>> earnt in the last few years. Its very sad.
>>>
>>> I would have killfiled him too, but I don’t like beginners being
>>> misguided by him or PointedEars.
>>> Well, anyone can be a Guru if they want, but part of the learning
>>> process is learning to be a respectful and clear person to communicate
>>> with.
>>> Reading the answer he just put to this post, I clearly see your point
>>> now.
>>>
>>> Greetings.
>>
>> Lol, you and TNP are one of a kind. No surprise you get along so well.
>
> Ya, people with brain use to be nice to each other.
>
>> And you haven't showed me better. As for posting code - just look back
>> through the history of this newsgroup.
>
> Remember, Jerry just wants to help and never do anything for ego or for
> competing against others.
>
>> Of course, you wouldn't know good code if you saw it, either.
>
> Then perhaps that is the reason why all your code seems shitty to me.
>
>> Come to think of it, I now suspect you are just another 'nym for TNP.
>
> Now shows how you don’t even understand the usenet headers.
>
Oh, I understand usenet headers, all right. But unlike you, I also
understand how to make them look like you're from almost anywhere in the
world.
>> Neither one of you is brave enough to use your real name!
>
> No, I am so afraid of mentally ill people to see my real name. what
> could happen? one never knows. ;)
There are only two mentally ill people around here - you and TNP.
But I do have some good news for you. You are NOT paranoid. The whole
world really IS out to get you!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|