Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.9
Author Message
sek-sports
Hangin' Around



Joined: Jul 18, 2007
Posts: 49

PostPosted: Tue Dec 16, 2008 4:14 pm Reply with quote

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 Laughing
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>

?>
 
View user's profile Send private message
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Tue Dec 16, 2008 4:19 pm Reply with quote

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.
 
View user's profile Send private message
sek-sports







PostPosted: Tue Dec 16, 2008 4:36 pm Reply with quote

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

PostPosted: Tue Dec 16, 2008 7:31 pm Reply with quote

The last line needs to be
Code:
$content  .= "";

_________________
"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. 
View user's profile Send private message
sek-sports







PostPosted: Tue Dec 16, 2008 8:23 pm Reply with quote

thanks, now at least the box shows up but no content.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Dec 18, 2008 6:30 am Reply with quote

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! 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Dec 18, 2008 9:35 am Reply with quote

I would also view the page source in your browser to make sure the javascript is making it to the page.
 
View user's profile Send private message Send e-mail
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Dec 20, 2008 1:03 am Reply with quote

Actually I would recode your block like this. It works perfectly for me Smile

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>';
?>
 
View user's profile Send private message
montego







PostPosted: Tue Dec 23, 2008 4:35 pm Reply with quote

Yeah, what he says... Laughing
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.9

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©