| Author |
Message |
sek-sports Hangin' Around

Joined: Jul 18, 2007 Posts: 49
|
Posted:
Tue Dec 16, 2008 4:14 pm |
|
Can someone help me with a block I am attempting to make? I am wanting it as a center block but everytime I activate it, it jacks my main page all up.
Here is what I have concocted
| Code: | <?php
if (eregi("block-maxpreps.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
<script type="text/javascript" src="http://widgets.maxpreps.com/includes/js/widget/teams.js" >
</script>
<script type="text/javascript" >
<!--
ShowTeamsWidget('29190e90-bccb-dd11-9246-001cc494dda6');
//-->
</script>
?> |
|
|
|
|
 |
jakec Site Admin

Joined: Feb 06, 2006 Posts: 3028 Location: United Kingdom
|
Posted:
Tue Dec 16, 2008 4:19 pm |
|
Unfortunately you can't just paste in HTML like that. There are a number of ways of doing it and if you do a search here you should find the answer. |
|
|
|
 |
sek-sports Hangin' Around

Joined: Jul 18, 2007 Posts: 49
|
Posted:
Tue Dec 16, 2008 4:36 pm |
|
Ok can you tell me where I went wrong with it this time?
| Code: |
<?php
if (eregi("block-maxpreps.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content .= "<script type=\"text/javascript\" src=\"http://widgets.maxpreps.com/includes/js/widget/teams.js\" >";
$content .= "</script>";
$content .= "<script type=\"text/javascript\" >";
$content .= "<!--";
$content .= " ShowTeamsWidget('29190e90-bccb-dd11-9246-001cc494dda6');";
$content .= "//-->";
$content .= "</script>";
$content .= "
?>
|
|
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
|
Posted:
Tue Dec 16, 2008 7:31 pm |
|
The last line needs to be |
|
|
|
 |
sek-sports Hangin' Around

Joined: Jul 18, 2007 Posts: 49
|
Posted:
Tue Dec 16, 2008 8:23 pm |
|
thanks, now at least the box shows up but no content. |
|
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
|
Posted:
Thu Dec 18, 2008 6:30 am |
|
I would also either make your first $content just be
$content = "....
or, you should add a line above your first $content line to initialize $content to be empty:
$content = "";
Now, this has nothing to do with your block not having content. You might want to throw in a JavaScript alert function in there just to see if your block is working properly or a document.write |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6300 Location: Vsetin, Czech Republic
|
Posted:
Thu Dec 18, 2008 9:35 am |
|
I would also view the page source in your browser to make sure the javascript is making it to the page. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16976 Location: Kansas
|
Posted:
Sat Dec 20, 2008 1:03 am |
|
Actually I would recode your block like this. It works perfectly for me
| Code: | <?php
if (eregi('block-maxpreps.php',$PHP_SELF)) {
Header('Location: index.php');
die();
}
$content = '';
$content .= '<script type="text/javascript" src="http://widgets.maxpreps.com/includes/js/widget/teams.js">';
$content .= '</script>';
$content .= '<script type="text/javascript">';
$content .= 'ShowTeamsWidget("29190e90-bccb-dd11-9246-001cc494dda6");';
$content .= '</script>';
?> |
|
|
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
|
Posted:
Tue Dec 23, 2008 4:35 pm |
|
Yeah, what he says...  |
|
|
|
 |
|
|
|
|