Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
bowyersw
New Member
New Member


Joined: Jan 09, 2005
Posts: 22

PostPosted: Tue Jun 07, 2005 1:53 pm Reply with quote

Here is what I am trying to post.

Code:
<?php


$content = <<<_MVP_
<sty le>
TABLE.standings { border: solid 1px #000060; width: 100%;
margin-bottom: 5px; border-collapse: collapse }
TABLE.standings TD, TABLE.standings TH { font-family: Verdana;
text-align: center; white-space: nowrap; padding: 1px 2px; font-size:
xx-small }
TABLE.standings TD.team, TABLE.standings TH.team { text-align: left;
width: 170px; padding-left: 3px }
TABLE.standings TD.rank, TABLE.standings TH.rank { text-align: right;
font-style: italic; color: #808080 }
TABLE.standings TR.divHeader TD { font-size: xx-small; font-weight:
bold; text-align: center; background: #FFCC33; color: #000000; }
TABLE.standings TR.statHeader TH { font-size: 55%; padding: 0px 3px
0px 3px; background: #bbbbbb }
</sty>
echo <scr ##  ipt language="JavaScr ## ipt" type="text/javascr ## ipt"
src="http://www.leaguedaddy.com/leagues/standings/?lid=1168&format=client&columns=2"></scr>
 _MVP_;
?>


Now of course the "##" arent supposed to be there, and on my sheet they are not, with just one space seperating the word script. Can anyone tell me what it is I am doing wrong?

I appreciate your help.
 
View user's profile Send private message Visit poster's website AIM Address
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Tue Jun 07, 2005 2:47 pm Reply with quote

When using the WHEREDOC syntax, you don't use any PHP commands, like "echo". Just use plain html, style, js, etc. the only exception is that you can use php variable references like $var_name Smile
 
View user's profile Send private message
bowyersw
PostPosted: Tue Jun 07, 2005 9:43 pm Reply with quote

Now I have this:

Code:
<?php


$content = <<<_MVP_
<sty le>
TABLE.standings { border: solid 1px #000060; width: 100%;
margin-bottom: 5px; border-collapse: collapse }
TABLE.standings TD, TABLE.standings TH { font-family: Verdana;
text-align: center; white-space: nowrap; padding: 1px 2px; font-size:
xx-small }
TABLE.standings TD.team, TABLE.standings TH.team { text-align: left;
width: 170px; padding-left: 3px }
TABLE.standings TD.rank, TABLE.standings TH.rank { text-align: right;
font-style: italic; color: #808080 }
TABLE.standings TR.divHeader TD { font-size: xx-small; font-weight:
bold; text-align: center; background: #FFCC33; color: #000000; }
TABLE.standings TR.statHeader TH { font-size: 55%; padding: 0px 3px
0px 3px; background: #bbbbbb }
</sty>
<scr ##  ipt language="JavaScr ## ipt" type="text/javascr ## ipt"
src="http://www.leaguedaddy.com/leagues/standings/?lid=1168&format=client&columns=2"></scr>
 _MVP_;
?>


I still get nothing. Everything from <st yle> on down is showing up in my Content page. I have also tried to add a block using this code, and it didn't work. I am lost on this.

Any ideas?
 
bowyersw
PostPosted: Tue Jun 07, 2005 9:56 pm Reply with quote

Now when I put that in, I am getting the lovely:

The html tags you attempted to use are not allowed
 
Raven
PostPosted: Tue Jun 07, 2005 11:15 pm Reply with quote

I'm confused. What exactly are you trying to do? If this is a block or module, please post all of the code.
 
Dauthus
Worker
Worker


Joined: Oct 07, 2003
Posts: 211

PostPosted: Tue Jun 07, 2005 11:59 pm Reply with quote

This doesn't work? Remove the space in the syntax.

Code:


<?php
$Variable = <<<_CODE_
<s tyle>
TABLE.standings { border: solid 1px #000060; width: 100%;
margin-bottom: 5px; border-collapse: collapse }
TABLE.standings TD, TABLE.standings TH { font-family: Verdana;
text-align: center; white-space: nowrap; padding: 1px 2px; font-size:
xx-small }
TABLE.standings TD.team, TABLE.standings TH.team { text-align: left;
width: 170px; padding-left: 3px }
TABLE.standings TD.rank, TABLE.standings TH.rank { text-align: right;
font-style: italic; color: #808080 }
TABLE.standings TR.divHeader TD { font-size: xx-small; font-weight:
bold; text-align: center; background: #FFCC33; color: #000000; }
TABLE.standings TR.statHeader TH { font-size: 55%; padding: 0px 3px
0px 3px; background: #bbbbbb }
</s tyle>
echo <s cript language="JavaS cript" type="text/javas cript"
src="http://www.leaguedaddy.com/leagues/standings/?lid=1168&format=client&columns=2"></s cript>
_CODE_;

echo $Variable;
?>


By the way, that's a fairly LARGE 2 tables for a center block.

_________________
Only registered users can see links on this board! Get registered or login!
Vivere disce, cogita mori 
View user's profile Send private message Visit poster's website
bowyersw
PostPosted: Wed Jun 08, 2005 7:36 am Reply with quote

Raven wrote:
I'm confused. What exactly are you trying to do? If this is a block or module, please post all of the code.


What you see above is every bit of the code I was given. The javascript code comes from LeagueDaddy, and you use it as a way to follow your league at your home site.

I know that the tables would be big, and I am not too worried about that now. I am just trying to get them to work first. I have tried putting the code into a created block, and I have also tried adding the code into a content page. When doing it as a content page, I get the "The html tags you attempted to use are not allowed" page.

Dauthus, I also tried your code, and didn't get anywhere. Although when I put yours into a content page, I did get a line through everything...

Any help, ideas?
 
Raven
PostPosted: Wed Jun 08, 2005 8:03 am Reply with quote

That's why your original code did not work. I misassumend that you were using this in a block and so you did not need to "echo" $content.

Is this what you are trying to do? Only registered users can see links on this board! Get registered or login!


Last edited by Raven on Wed Jun 08, 2005 3:14 pm; edited 1 time in total 
bowyersw
PostPosted: Wed Jun 08, 2005 11:12 am Reply with quote

Exactly.

How can I get it into either a content page, a block, or a module?
 
Raven
PostPosted: Wed Jun 08, 2005 3:21 pm Reply with quote

- Create a folder in modules called Standings.
- Create a file in modules/Standings called index.php and place this code in it.

Note: There are spaces in <scr ipt> </scr ipt> <sty le> </sty le> tags that must be closed.
Code:
if ( !defined('MODULE_FILE') )

{
   die("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
//get_lang($module_name);

$pagetitle = "- $module_name";
include("header.php");
OpenTable();
echo <<<_MVP_
<sty le>
TABLE.standings { border: solid 1px #000060; width: 100%;margin-bottom: 5px; border-collapse: collapse }
TABLE.standings TD, TABLE.standings TH { font-family: Verdana; text-align: center; white-space: nowrap; padding: 1px 2px; font-size:xx-small }
TABLE.standings TD.team, TABLE.standings TH.team { text-align: left; width: 170px; padding-left: 3px }
TABLE.standings TD.rank, TABLE.standings TH.rank { text-align: right; font-style: italic; color: #808080 }
TABLE.standings TR.divHeader TD { font-size: xx-small; font-weight:bold; text-align: center; background: #FFCC33; color: #000000; }
TABLE.standings TR.statHeader TH { font-size: 55%; padding: 0px 3px 0px 3px; background: #bbbbbb }
</sty le>
<scr ipt language="JavaScript" type="text/javascript"
src="http://www.leaguedaddy.com/leagues/standings/?lid=1168&format=client&columns=2"></scr ipt>
_MVP_;

CloseTable();
include("footer.php");
?>
 
Dauthus
PostPosted: Wed Jun 08, 2005 7:20 pm Reply with quote

I thought this might also work by putting all the ORIGINAL code into a blank notepad document, then saving it as whatever.txt.

Then I just created a file called whatever.php and put the following code in it:

Code:
<?php include("whatever.txt"); ?>


So the end result for a module should look something like this:

Code:


if ( !defined('MODULE_FILE') )
{
   die("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
//get_lang($module_name);

$pagetitle = "- $module_name";
include("header.php");
OpenTable();

include("whatever.txt");

CloseTable();
include("footer.php");
?>


I didn't actually check it, but I think it should work. But you should remember, Raven is actually the expert. I just like to look at alternatives.

Very Happy
 
Raven
PostPosted: Wed Jun 08, 2005 7:25 pm Reply with quote

That way should always work. Thanks for adding that in Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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 ©