Unable to get ad code to display ads from a file. Please help?

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
WWu777
Registered User
Posts: 556
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Unable to get ad code to display ads from a file. Please help?

Post by WWu777 » Sat Aug 17, 2019 6:38 am

Dear Support,
I'm trying to get ads to display from a file using this code below. But the code given to me by one of my advertisers doesn't seem to work. Does anyone here know why? Is there a way to alter or edit this code to get it to work on an html template file? Perhaps this code was designed to work with a php file only? However, phpbb forums use html templates, so the codes need to be in html right? If so, do any of you have any idea how to make it work and display ads correctly from the URL defined within? Here's the code:

Code: Select all

<?php/
$ad = file_get_contents('https://www.loveme.com/contentads/events_160.shtml');
echo $ad;
?>
Thanks,
Winston

User avatar
Lumpy Burgertushie
Registered User
Posts: 66565
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Unable to get ad code to display ads from a file. Please help?

Post by Lumpy Burgertushie » Sat Aug 17, 2019 7:05 am

you have to go into the admin panel of your board and turn on php in templates.
security settings down at the bottom of the left menu.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

WWu777
Registered User
Posts: 556
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: Unable to get ad code to display ads from a file. Please help?

Post by WWu777 » Fri Aug 23, 2019 4:50 am

Lumpy Burgertushie wrote:
Sat Aug 17, 2019 7:05 am
you have to go into the admin panel of your board and turn on php in templates.
security settings down at the bottom of the left menu.

robert
I've already done that. Is there anything wrong with the code?

I tested it in this HTML tester and it doesn't produce anything:

http://www.csgnetwork.com/htmlcodetest.html

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1087
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: Unable to get ad code to display ads from a file. Please help?

Post by mrgoldy » Sun Aug 25, 2019 12:26 pm

You're allow_url_open might be disabled in your php.ini
Or file_get_contents() might be in your disabled_functions in your php.ini

User avatar
Lumpy Burgertushie
Registered User
Posts: 66565
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Unable to get ad code to display ads from a file. Please help?

Post by Lumpy Burgertushie » Sun Aug 25, 2019 3:29 pm

<?php/
is that truly what you have in the php?

if so, try removing the slash after the <?php
that should not be there.
I don't know if that is the problem but it could be.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
warmweer
Registered User
Posts: 2647
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Unable to get ad code to display ads from a file. Please help?

Post by warmweer » Sun Aug 25, 2019 5:13 pm

Lumpy Burgertushie wrote:
Sun Aug 25, 2019 3:29 pm
<?php/
is that truly what you have in the php?
Good catch.
Am I correct in thinking that echo didn't even excute? If that was the case then that would have pointed to php code not being exectuted.
My board's not broken, it just went peculiar

Post Reply

Return to “phpBB Custom Coding”