PDA

View Full Version : How to place digital coop ad network code


westhaven
07-17-2005, 02:51 PM
Hi,
i wann install digital coop ad network on my site where i have installed phplinkdirectory script.
i have tried it but didn't work,i have added this code
<?php
ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include ('ad_network_320.php');
echo $ad_network;
?>

to just footer.tpl
now tell me will i have to add this code any other pages and which are those pages.

thanks in advance

Ap0s7le
07-17-2005, 06:23 PM
I personally would first try this in place of what you're currently using.

{include file="/path/to/ad_network_320.php"}

Let me know

later

minstrel
07-17-2005, 09:37 PM
I'm not sure that will work, Casey.

From "Instructions for phpBB 2.x":

Content visible to registered users only.

David
07-17-2005, 09:42 PM
Thanks, Minstrel
You are helping me to learn Smarty! :)

minstrel
07-17-2005, 09:48 PM
Content visible to registered users only.
LOL! Really?

I wish I were helping ME to learn Smarty! :D

Ap0s7le
07-17-2005, 10:08 PM
I don't have access to the code the ad network uses, so I can't test it so I don't truly know if it would/wouldn't work.

Can you explain to me why that wouldn't work?

I'm always up to be taught :)

Thanks

minstrel
07-17-2005, 10:38 PM
I'm not sure that it WON'T work either. Perhaps I'll give it a shot on my own directory -- it's just a matter if setting up a new account at the Coop and adding in the code.

I'll try your solution first and report back.

minstrel
07-17-2005, 10:51 PM
Added in footer.tpl:

Content visible to registered users only.


Error message:

Content visible to registered users only.

minstrel
07-17-2005, 11:03 PM
Here's the coop code for that ad_network_xxx.php file:

Content visible to registered users only.

minstrel
07-17-2005, 11:22 PM
This question really isn't a PHPLD issue, though. It should probably be asked in the DP Coop forum.

Ap0s7le
07-17-2005, 11:32 PM
Thanks :)

The code you gave them wouldn't work anyhow.

assign_vars isn't a valid method within PHPLD, that's why I was going ??? haha

You would actually do that along these lines.

Content visible to registered users only.

That assumes ad_file.php will always output the '$ad_network' variable.

Then you would access that in your header/main/footer templates with
Content visible to registered users only.

later

westhaven
07-18-2005, 10:48 AM
In DP forum we can't ask...i know how to place coop code and in which file files for my other sites and coop ad network is working in my sites . Now here i asked you that in which files of phplinkdirectory i should include this code. Not even a single file or page should be left. As i don have any idea except footer.tpl and i have already placed the code there. But when i try to validate then it says no active links are found on the site.
Tell me does footer.tpl understand the .php
this is the code which i have placed in footer.tpl :
<?php
ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include ('ad_network_272.php');
echo $ad_network;
?>

minstrel
07-18-2005, 03:07 PM
westhaven, when you use that code in footer/tpl, what do you see at that location on your pages? Can you see any ads? Do you see an error message? Do you see anything at all?

The Coop validation process uses a random page from your site/subsite to verify ad display -- if the ads are not showing on all pages and the validator happens to choose a page where they're not displayed, you'll get the validation error. But step 1 is to determine whether the ads are showing on ANY page.

Also, not sure what you mean when you say, "In DP forum we can't ask"... there is a Coop forum there about setup questions.

westhaven
07-18-2005, 06:26 PM
the reason for not asking in dp forum is they are not aware about the phplinkdirectory files they don know in which file we will have to place the code.

when i place the code in footer.tpl i can't see any active link on the page and get no error but in digitalpoint site i get an error which says no active link found on the site. Sometimes reason could be that we haven't placed the code in all the pages of the sites. Thats why i am asking that i have to add the code in just footer.tpl or there are some other files.

David
07-18-2005, 06:57 PM
You might want to phrase the question in the DP forum like this:
How do I add the code to a Smarty template footer file?

westhaven
07-20-2005, 10:01 AM
Content visible to registered users only.

i aksed in dp forum but no one has any answer to it

i guess people in dp forum has no idea about .tpl........David can you sort out this prob if possible?

yktan
07-20-2005, 10:45 AM
Content visible to registered users only.[/quote]

Minstrel you almost got it right. Do this instead:
Content visible to registered users only.

As you can see, to include a php script in a Smarty template, you need to use the command: include_php instead of include.

Tell me if this solves the problem for you guys.

Regards,
YK

minstrel
07-20-2005, 07:18 PM
Now I get this error:

Content visible to registered users only.
BTW, the permissions for the file in question are 755.

yktan
07-21-2005, 03:47 AM
Content visible to registered users only.

Sorry minstrel, my fault. I didn't look at your path properly. The path for the include statement cannot be in the http:// format.

If your script is located in a folder called phpbb in the web root, do this:

Content visible to registered users only.

minstrel
07-21-2005, 05:06 AM
Okay, if I use either

Content visible to registered users only.
or

Content visible to registered users only.
I avoid all error messages but no ads are displayed...

see footer at psychlinks.ca/directory/index.php

David
07-21-2005, 05:10 AM
First, please don't regard me as an expert here but...
http://www.psychlinks.ca/phpbb/ad_network_222.php
...I see a blank page there.
So if you include it, wouldn't it be blank. :)

yktan
07-21-2005, 05:58 AM
Content visible to registered users only.

This is what I was about to say. I tested the script by entering the url directly, and it's giving me this as the response:
Content visible to registered users only.

Is the script actually outputing anything?

minstrel
07-21-2005, 06:52 AM
The ads are delivered from the Coop server via an account I have set up.

You can see them (a row of 5 test ads) at the bottom of the page at http://www.psychlinks.ca/phpbb/index.php (they are in the overall_footer template just above the phpBB copyright line).

minstrel
07-21-2005, 07:02 AM
By the way, I should clarify here:

I'm not really concerned one way or another about the coop ads on the directory pages -- I use them on my forum and that's enough. For me, it's more a curiosity because I don't see why they wouldn't work.

There are more important issues that you guys are working on, IMO -- I wouldn't spend a whole lot of time worrying about this one.

I may play with it a bit more when I get time but I just d0on't see it as a priority personally.

yktan
07-21-2005, 11:45 AM
I'm really curious on how the coop works. I've include some php files to test the output and they worked fine. Would it be possible for you to post the php file that you're including?

undieshosting
07-21-2005, 04:01 PM
I got it to work. You can see it in place at linkthemusic.com

In footer.tpl I added:

Content visible to registered users only.

(This was added just below the phpLD link)

in index.php I added:

Content visible to registered users only.

(this was added just above this line)

Content visible to registered users only.

undieshosting
07-21-2005, 04:02 PM
ahh...one more thing. If you do what I did above the ads will show up twice. At the bottom of the ad_network.php file comment out or delete the line that has

Content visible to registered users only.

yktan
07-21-2005, 04:56 PM
That will work but the downside is you have to change all the php scripts that include the footer to include the code
Content visible to registered users only.

Have you tried simply putting this code in the footer.tpl?
Content visible to registered users only.
You might have to specify a fully qualified path for network.php though. I've tested the include_php directive to include a couple of php scripts and they seem to work fine for me. I'm really curious why it doesn't work for other people.

undieshosting
07-21-2005, 11:26 PM
No there is no downside. I added it to index.php

that's all there is

The include that you suggest does not work. It was suggested previously in this thread, i tried it, and it does not work.

however, as I showed in my link above, the changes I made do work.