Previous Thread
Next Thread
Print Thread
Hop To
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
Hi Guys:

OK, transferred servers. On the new box, all the javascript that was part of my custom islands (rotating ads) would display on the Main index, but not on any sub-pages. Any URL than had any info after /ubbthreads.php would not display the javascript. I dunno.

OK, so I have the option of using php instaed of Java, and so I generated THAT code. Put it into the header and footer ... poof, no problem. Now the ads are displaying again. I can live with php.

BUT, when I try to make it work in the custom islands, no can do. I have some pretty important ad zones there, and I can't get them to display, either with javascript OR with php.

OK, so how do I make this php code, display in a custom island:


<?php
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:13', 0, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>


It displays fine outside the island.

If you prefer to see the javascript, I'll post that too.

Gotta display ads to pay the bills ...

Thanks all ...


Rick
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Don't quote me on this but I think you need to move
"echo $phpAds_raw['html'];"
to be in between the EOF tags
So just place $phpAds_raw inside the eof tags don't use echo.
Not sure about the ['html'] part.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
How about the

}
?>

Leave it up top, or not?

Off to play.

rb


Rick
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
Parse error: syntax error, unexpected '<' in /home/XXXXXXXXXXXXX/public_html/ubbthreads/cache_builders/custom/portal_box_10.php on line 3

frown


Rick
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Okay when dealing with the islands you omit the php tags
Such as <?php or ?>
They are placed by the island script.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
I see Giz is here now maybe he can give some input.
Also Giz maybe it is time to post a how do I for islands.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
Ok, tried that.

This code:

/* PHP CODE HERE, IF NECESSARY */
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:13', 0, '', '', '0', $phpAds_context);
/* DO NOT CHANGE THE LINE BELOW */
$body = <<<EOF
echo $phpAds_raw['html'];
EOF;
/* DO NOT CHANGE THE LINE ABOVE */


gave me this:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/XXXXXXXXXXXX/public_html/ubbthreads/cache_builders/custom/portal_box_10.php on line 8


Rick
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
I think that

Code
<?php
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:13', 0, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>

Should end up:
Code
/* PHP CODE HERE, IF NECESSARY */
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:13', 0, '', '', '0', $phpAds_context);
}

/* DO NOT CHANGE THE LINE BELOW */
$body = <<<EOF
echo $phpAds_raw['html'];
EOF;
/* DO NOT CHANGE THE LINE ABOVE */


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
And you're getting that error because you didn't close your if statement.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
OK, Giz.

I copied the code from your second box there, and pasted it into my custom island, and got this:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/XXXXXXXXXX/public_html/ubbthreads/cache_builders/custom/portal_box_10.php on line 10


Rick
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Found something on using your script with vbulletin.
HERE
So it looks like the island should look something like:
Code
/* PHP CODE HERE */
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:13', 0, '', '', '0', $phpAds_context);
}


/* BODY HERE */
$body = <<<EOF
$phpAds_raw[html]
EOF;


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
BINGO!!!!!

What did you do? I have a couple other islands to change. NICE JOB DUDE!!!!!

rb


Rick
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
lol yeh, was just about to post "well it should parse without the echo" and refresh to see ruben did just that...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Just searched for phpad news .
It looks like you need to remove the quote inside the [html] part. According to the tech note I found for vbulletin.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
You guys rock. Thanks!!!!!!!!!!!!


Rick
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
One last question: How to center it?

Any place I put <center> and </center> breaks it again.


Rick
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
Really? It should just center if you:

Code
$body = <<<EOF
<center>
$phpAds_raw[html]
</center>
EOF;


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
That did it.

Dang, you have helped me finish off a grind of a week, in which every part of a server change went screwy, with some straight, effective answers that worked.

In case no one has said it lately, I APPRECIATE IT! NICE JOB! If only everyone could be as on it as the folks on this Board.

I've been with UBB since 2000, and I ain't going nowhere!


Rick
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
Hey Rick, in case someone else has a similar question in the future, could you post your final version of your custom island for reference?


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
We both thank you.
But remember we are just users just like you.
So it would be nice if you provide feed back once in a while to other users like we do.
Or at least reply, to help you received so others can read the resolution and see if it worked.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
Guys:

I readja loud and clear. It's just that I only know enough to be dangerous. wink

OK, here's the entire php code in my custom island:



/* PHP CODE HERE */
if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:24', 0, '', '', '0', $phpAds_context);
}

$body = <<<EOF
<center>
$phpAds_raw[html]
</center>
EOF;





Rick
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Dangerous is our business.
Happy it worked for you.
Took a while to figure it out though.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Nov 2006
Posts: 93
2
journeyman
journeyman
2 Offline
Joined: Nov 2006
Posts: 93
Not really ....

You should have seen my week and the server transfer. You guys are zippy. Just ducky. wink

rb


Rick

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
2 members (Gizmo, 1 invisible), 901 guests, and 169 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240501)