|
Joined: Nov 2006
Posts: 93
journeyman
|
journeyman
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
journeyman
|
journeyman
Joined: Nov 2006
Posts: 93 |
How about the
} ?>
Leave it up top, or not?
Off to play.
rb
Rick
|
|
|
|
Joined: Nov 2006
Posts: 93
journeyman
|
journeyman
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
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
journeyman
|
journeyman
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
|
Joined: Jun 2006
Posts: 16,300 Likes: 116 |
I think that
<?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: /* 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 */
|
|
|
|
Joined: Jun 2006
Posts: 16,300 Likes: 116
|
Joined: Jun 2006
Posts: 16,300 Likes: 116 |
And you're getting that error because you didn't close your if statement.
|
|
|
|
Joined: Nov 2006
Posts: 93
journeyman
|
journeyman
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: /* 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
journeyman
|
journeyman
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
|
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...
|
|
|
|
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
journeyman
|
journeyman
Joined: Nov 2006
Posts: 93 |
You guys rock. Thanks!!!!!!!!!!!!
Rick
|
|
|
|
Joined: Nov 2006
Posts: 93
journeyman
|
journeyman
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
|
Joined: Jun 2006
Posts: 16,300 Likes: 116 |
Really? It should just center if you: $body = <<<EOF
<center>
$phpAds_raw[html]
</center>
EOF;
|
|
|
|
Joined: Nov 2006
Posts: 93
journeyman
|
journeyman
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
|
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?
|
|
|
|
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
journeyman
|
journeyman
Joined: Nov 2006
Posts: 93 |
Guys: I readja loud and clear. It's just that I only know enough to be dangerous. 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
journeyman
|
journeyman
Joined: Nov 2006
Posts: 93 |
Not really .... You should have seen my week and the server transfer. You guys are zippy. Just ducky. rb
Rick
|
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
3 members (Nightcrawler, Stovebolt, 1 invisible),
923
guests, and
147
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|