Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2006, 06:10 AM
JimmyN JimmyN is offline
 
Join Date: Apr 2006
Location: Australia
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHP code inside template

Iam trying to get this code inside the template

So it will track my adsense ads clicks and only show every 24 hours etc.
Iv tryed doing this but i get a prase error

Does anyone now how to do this?

Thanks heaps

PHP Code:
<?php if ($_COOKIE['adsclicked'] < 2) { ?>
[Enter your AdSense Code Here]
<?php ?>


Code:
http://www.adlogger.org/

Introduction

AdLogger is an open source AdSense tracker designed for web publishers and website owners. AdLogger monitors and records all AdSense activity on your page in real time and compiles the data for you to review.

AdLogger is the result of numerous website publishers developing code to better monitor their AdSense accounts. This script contains a powerful backend to process all the data and configure various settings to make administration simple and easy. Thanks to the help of other developers, AdLogger has become a powerful processing script which you might find indespensible for your websites.

It's become a surprisingly powerful program that helps AdSense publishers monitor their accounts with the primary purpose to combat click fraud before it becomes a problem. The last thing anybody wants is to have his or her account banned due to invalid clicks. AdLogger greatly reduces the chance of this happening by giving you advanced monitoring features and automatic disabling of ads for a particular visitor if he is clicking too many.
^ TOP
Features

Detailed visitor data gives you much more information than your Google account page. For each user that clicks an ad, you can view visitor IP, hostname, operating system/web browser information, date/time of click, outgoing url clicked, ad format data, channel info, and more.

Primary security features allow you to combat click fraud by automatically disabling AdSense ads for visitors who are clicking too many within a certain time period.

You can view all activity logs and get key statistics that your Google account page never will. Sort by date, visitor, channel data, ad url clicked, and more.

Custom channels help you monitor your best and worst performing pages in terms of both page views and clicks.

Optionally, you can set up automatic email alerts. The script can send you an email every time a visitor clicks an ad. Also, AdLogger recognizes potential click attacks and can send you an email after mulitple clicks.
^ TOP
How does AdLogger work?

AdLogger uses a short javascript code placed on all of your AdSense pages that records page views and click information for all AdSense ads. It then processes that information to a PHP page where a large amount of information regarding that click is stored into a MySQL database.

Unlike competing commercial products, AdLogger runs on your own server, giving you complete control over all aspects of the script. Commercial tracking sites have access to your sensitive click statistics and confidential business information. Running both the frontend (javascript) and backend (PHP and MySQL) is the most secure and stable way to run your tracking script. Data is compiled right at the source and you are able to view the statistics through an administration page on your own site.

AdLogger's click-fraud defense sets a cookie everytime a Google ad is clicked. When a visitor clicks a certain number of ads within a set time period, AdSense ads will be disabled for that visitor and an optional email can be sent to you warning you of the possible click attack so you can investigate further.
Reply With Quote
  #2  
Old 06-07-2006, 06:36 AM
SaintDog SaintDog is offline
 
Join Date: Nov 2001
Location: Tennessee
Posts: 1,975
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vBulletin doesn't allow standard PHP coding within the templates, you'll need to use the vBulletin conditional system to enter the coding into the template.

Try using:

PHP Code:
<if condition="$_COOKIE['adsclicked'] < 2">

AdSense Code Here

<else />

&
nbsp;

</if> 
Reply With Quote
  #3  
Old 06-07-2006, 06:39 AM
JimmyN JimmyN is offline
 
Join Date: Apr 2006
Location: Australia
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you very much, i will try and give it a go, ill let u know how i got

Update: i tryed it but the ads are not now showing up bit unsure why now any ideas?

thanks
Reply With Quote
  #4  
Old 06-07-2006, 08:20 AM
SaintDog SaintDog is offline
 
Join Date: Nov 2001
Location: Tennessee
Posts: 1,975
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure right off hand, the conditional I provided is a mimick of the standard PHP conditional you provided in the first thread.

You could try removing the else clause and simply try using:

PHP Code:
<if condition="$_COOKIE['adsclicked'] < 2">

AdSense Code Here

</if> 
Not sure that would make all that much of a difference, though I've never used the program/script.
Reply With Quote
  #5  
Old 06-07-2006, 08:50 AM
JimmyN JimmyN is offline
 
Join Date: Apr 2006
Location: Australia
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well great news, it works and its awsome, thanks for this
Reply With Quote
  #6  
Old 06-10-2006, 09:52 PM
SaintDog SaintDog is offline
 
Join Date: Nov 2001
Location: Tennessee
Posts: 1,975
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, glad it worked out for you .
Reply With Quote
  #7  
Old 10-16-2006, 12:42 AM
mpage mpage is offline
 
Join Date: Aug 2006
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is an old post but could the same thing be used for the adlogger php rapper?

eg:
Quote:
<?php if (!isset($ad_check)) { $ad_check = file_get_contents("http://www.ai-stockmarketforum.com/adlogger/ad_check.php?visitor_ip=$_SERVER[REMOTE_ADDR]&durelog=$_COOKIE[durelog]"); } if ($ad_check == 'y') { ?>

[Enter your AdSense Code Here]

<?php } ?>
and use:
Quote:
<if condition="!isset($ad_check)">
- not sure how to put the rest of the php in an "then statement"
<if condition="$ad_check == 'y' ">

[Enter your AdSense Code Here]

</if> </if>
sorry im new to php and vbulletin code
Reply With Quote
  #8  
Old 04-13-2008, 06:46 PM
arena's Avatar
arena arena is offline
 
Join Date: Oct 2006
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SaintDog View Post
Not sure right off hand, the conditional I provided is a mimick of the standard PHP conditional you provided in the first thread.

You could try removing the else clause and simply try using:

PHP Code:
<if condition="$_COOKIE['adsclicked'] < 2">

AdSense Code Here

</if> 
Not sure that would make all that much of a difference, though I've never used the program/script.
The code for postbit_legacy?
Reply With Quote
  #9  
Old 04-14-2008, 01:38 AM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by arena View Post
The code for postbit_legacy?
This thread has been around for about 2 years. Most likely the content is for a version you are not using. There was no need to bump this thread.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04192 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete