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: 3048
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

|
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: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Tue Dec 16, 2008 7:31 pm |
|
The last line needs to be |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
sek-sports

|
Posted:
Tue Dec 16, 2008 8:23 pm |
|
thanks, now at least the box shows up but no content. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
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 |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
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: 17088
|
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

|
Posted:
Tue Dec 23, 2008 4:35 pm |
|
Yeah, what he says...  |
|
|
|
 |
|