1
martyboy
adding google ads to wfdownloads visit.php
  • 2006/10/21 19:08

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


Hi, I want to add a google ad on wfdownloads visit.php the page that says "Your download should start in 3 seconds...please wait. If your download does not start, Click here!. " I have found the code that produces the above text:

echo "
  <h4><img src='" 
XOOPS_URL "/modules/wfdownloads/images/icon/downloads.gif' align='middle' alt='' /> " _MD_WFD_DOWNINPROGRESS "</h4>n
  <div>" 
_MD_WFD_DOWNSTARTINSEC "</div><br />n
  <div>" 
_MD_WFD_DOWNNOTSTART "n
  <a href='
$url' target='_blank'>" _MD_WFD_CLICKHERE "</a>.n
  </div>n"
;


Can i simply paste the google ad code underneath this code or do i have to do anything special because its a php file?

Thanks for your help
Michael Jackson = King Of Pop

Xoops = King Of CMS

2
irmtfan
Re: addming google ads to wfdownloads visit.php
  • 2006/10/21 19:13

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


google ads is a script and you can add it anywhere.

also in visit.php call it with echo

for example at the bottom of echo:

echo "
  <h4><img src='" 
XOOPS_URL "/modules/wfdownloads/images/icon/downloads.gif' align='middle' alt='' /> " _MD_WFD_DOWNINPROGRESS "</h4>n
  <div>" 
_MD_WFD_DOWNSTARTINSEC "</div><br />n
  <div>" 
_MD_WFD_DOWNNOTSTART "n
  <a href='
$url' target='_blank'>" _MD_WFD_CLICKHERE "</a>.n
  </div>n
  <script type='text/javascript'>
google_ad_client = 'pub-xxxxxxxxxxxxx';
google_alternate_color = '000000';
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = '468x60_as';
google_ad_type = 'text';
google_ad_channel ='';
google_color_border = 'D0BC8A';
google_color_bg = '000000';
google_color_link = 'FF6600';
google_color_text = '000000';
google_color_url = '993300';
</script><script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>"
;

3
m0nty
Re: adding google ads to wfdownloads visit.php
  • 2006/10/21 19:21

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


yep you should be able to.. use the echo command in php tho as irmtfan mentioned.

but note. you only ever see that screen when your downloads are using a remote url..

if you upload the files to your server using the browse function on the submit form, you will never see that screen when you click to download it..

4
martyboy
Re: adding google ads to wfdownloads visit.php
  • 2006/10/21 19:59

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


Thanks for your help guys

Quote:

m0nty wrote:
but note. you only ever see that screen when your downloads are using a remote url..

if you upload the files to your server using the browse function on the submit form, you will never see that screen when you click to download it..


Thanks for that monty, I didnt know that was the case, i only have a few donwloads uploaded, the most popular ones i FTP then type the url in.

Cheers.
Michael Jackson = King Of Pop

Xoops = King Of CMS

5
martyboy
Re: adding google ads to wfdownloads visit.php *solved*
  • 2006/10/21 21:44

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


I have encountered a problem, I added the code like irmtfan said but I get:
Quote:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in ****\html\modules\wfdownloads\visit.php on line 121


Line 121 is:Quote:
<script type="text/javascript"><!--


I took out the code and just put in plain text and the plain text shows up fine, not sure whats going wrong and im not sure where ',' or ';' should be within line 121, any ideas?

Thanks.
Michael Jackson = King Of Pop

Xoops = King Of CMS

6
martyboy
Re: adding google ads to wfdownloads visit.php *solved*
  • 2006/10/21 22:10

  • martyboy

  • Quite a regular

  • Posts: 256

  • Since: 2004/5/25


OK I got this one fixed, woo hoo,

after a quick search on google I realsied i was getting the T_STRING error because the original echo statement was opened with " and I had to escape out any " in the ad code with /" I tried tha however and i couldnt get it to work..so, after the original echo Quote:
/n";


I opened a new echo with Quote:
echo '
using ' instead of " i pasted the google code into this new echo and it all works fine.
Michael Jackson = King Of Pop

Xoops = King Of CMS

7
irmtfan
Re: adding google ads to wfdownloads visit.php *solved*
  • 2006/10/21 22:17

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Or instead you can change all " to ' in "google ads code" like i do!

Quote:
if you upload the files to your server using the browse function on the submit form, you will never see that screen when you click to download it..


So as m0nty mentioned why not add the code to templates like "wfdownloads_singlefile.html" that i think too much better.

Login

Who's Online

229 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits