Author |
Message |
bowyersw
New Member
Joined: Jan 09, 2005
Posts: 22
|
Posted:
Tue Jun 07, 2005 1:53 pm |
|
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. |
|
|
|
|
Raven
Site Admin/Owner
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Jun 07, 2005 2:47 pm |
|
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 |
|
|
|
|
bowyersw
|
Posted:
Tue Jun 07, 2005 9:43 pm |
|
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
|
Posted:
Tue Jun 07, 2005 9:56 pm |
|
Now when I put that in, I am getting the lovely:
The html tags you attempted to use are not allowed |
|
|
|
|
Raven
|
Posted:
Tue Jun 07, 2005 11:15 pm |
|
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
Joined: Oct 07, 2003
Posts: 211
|
Posted:
Tue Jun 07, 2005 11:59 pm |
|
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 |
|
|
|
bowyersw
|
Posted:
Wed Jun 08, 2005 7:36 am |
|
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
|
Posted:
Wed Jun 08, 2005 8:03 am |
|
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? http://www.ravenphpscripts.com/modules.php?name=Standings |
Last edited by Raven on Wed Jun 08, 2005 3:14 pm; edited 1 time in total |
|
|
|
bowyersw
|
Posted:
Wed Jun 08, 2005 11:12 am |
|
Exactly.
How can I get it into either a content page, a block, or a module? |
|
|
|
|
Raven
|
Posted:
Wed Jun 08, 2005 3:21 pm |
|
- 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
|
Posted:
Wed Jun 08, 2005 7:20 pm |
|
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.
|
|
|
|
|
Raven
|
Posted:
Wed Jun 08, 2005 7:25 pm |
|
That way should always work. Thanks for adding that in |
|
|
|
|
|