Jump to content


Photo

Help with EOF; help Skinning a free Script!


  • Please log in to reply
2 replies to this topic

#1 dylanjones

dylanjones
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 September 2006 - 06:34 PM

Hello Everyone!

Hey,

Well I am trying to skin a free script, you can find here;

http://www.freephpdirectoryscript.com/

They have some weird Template system for it, and the template php looks like this;

<?
// HEADING LABELS: [CATEGORY_NAME] [CATEGORY_DESCRIPTION]

$TEMPLATE["HEADING"] = <<<EOF
    <HTML>
    <HEAD>
    <TITLE>[CATEGORY_NAME] - [CATEGORY_TITLE]</TITLE>
    <META NAME="description" CONTENT="[CATEGORY_DESCRIPTION]">
    <META NAME="keywords" CONTENT="[CATEGORY_DESCRIPTION]">
    <STYLE>
    BODY {margin: 5% 12%}
    BODY, TD {font-family: Arial; font-size: 12px; color: #666666}
    H1 {font-size: 22px; color: #666699; padding-bottom: 10px; border-bottom: 1px solid}
    A:link {color: #666699}
    A:visited {color: #666699}
    A:hover {color: #9999CC}
    FORM {margin: 0px}
    INPUT {width: 300px; font-family: Arial; font-size: 12px; color: #666666; background: white; padding: 1px 3px 0px; margin-right: 10px}
    SELECT {width: 300px; font-family: Arial; font-size: 12px; color: #666666; margin: 1px 0px; margin-right: 10px}
    TEXTAREA {width: 300px; height: 70px; font-family: Arial; font-size: 12px; color: #666666; padding: 1px 3px 0px; margin-right: 10px}
    P {margin-top: 15px}
    HR {height: 1px; color: #DDDDDD; margin: 10px 0px}
    .BUTTON {width: auto; background: #dddddd}
    </STYLE>
    <BODY>
    <H1>[CATEGORY_NAME]</H1>
    <FORM ACTION="search.php">
    <INPUT TYPE="text" NAME="q" SIZE=80>
    <INPUT TYPE="submit" VALUE="Search" CLASS="BUTTON">
    </FORM>
    <HR SIZE=1 COLOR="#DDDDDD">
EOF;

// PATH:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// PATH:CURRENT_CATEGORY LABELS: [CATEGORY_NAME]

$TEMPLATE["PATH"]["HEADING"] = <<<EOF

EOF;
$TEMPLATE["PATH"]["CATEGORY"] = <<<EOF
    <A HREF="[CATEGORY_URL]">[CATEGORY_NAME]</A>
EOF;
$TEMPLATE["PATH"]["CURRENT_CATEGORY"] = <<<EOF
    [CATEGORY_NAME]
EOF;
$TEMPLATE["PATH"]["SEPARATOR"] = <<<EOF
     :
EOF;
$TEMPLATE["PATH"]["FOOTER"] = <<<EOF

EOF;

// CATEGORIES:HEADING LABELS: [NUMBER_CATEGORIES] [CATEGORY_NAME]
// CATEGORIES:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// CATEGORIES:NO_CATEGORIES LABELS: [CATEGORY_NAME]

$TEMPLATE["SUBCATEGORIES"]["HEADING"] = <<<EOF
    <P>
EOF;
$TEMPLATE["SUBCATEGORIES"]["BEFORE_COLUMNS"] = <<<EOF
    <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
    <TR>
    <TD WIDTH=260 VALIGN=top>
EOF;
$TEMPLATE["SUBCATEGORIES"]["CATEGORY"] = <<<EOF
    <LI><A HREF="[CATEGORY_URL]"><B>[CATEGORY_NAME]</B></A>
EOF;
$TEMPLATE["SUBCATEGORIES"]["BETWEEN_COLUMNS"] = <<<EOF
    </TD><TD WIDTH=20>&nbsp;</TD><TD WIDTH=260 VALIGN=top>
EOF;
$TEMPLATE["SUBCATEGORIES"]["AFTER_COLUMNS"] = <<<EOF
    </TD>
    </TR>
    </TABLE>
EOF;
$TEMPLATE["SUBCATEGORIES"]["FOOTER"] = <<<EOF
    <HR SIZE=1 COLOR="#DDDDDD">
EOF;
$TEMPLATE["SUBCATEGORIES"]["NO_CATEGORIES"] = <<<EOF
    <HR SIZE=1 COLOR="#DDDDDD">
EOF;

// SUBMISSION_LINK LABELS: [SUBMISSION_URL] [CATEGORY_NAME]

$TEMPLATE["SUBMISSION_LINK"] = <<<EOF
    <A HREF="[SUBMISSION_URL]"><B>Add Url to [CATEGORY_NAME]</B></A>
    <HR SIZE=1 COLOR="#DDDDDD">
EOF;

// PAGES:HEADING LABELS: [STARTING_PAGE_NUMBER] [ENDING_PAGE_NUMBER] [TOTAL_PAGES] [CATEGORY_NAME]
// PAGES:PAGE LABELS: [PAGE_TITLE] [PAGE_DESCRIPTION] [PAGE_URL] [PAGE_DOMAIN]
// PAGES:FEED_PAGE LABELS: [PAGE_TITLE] [PAGE_DESCRIPTION] [PAGE_URL]
// PAGES:PAGINATION:PREVIOUS AND PAGES:PAGINATION:NEXT LABELS: [PAGINATION_URL]
// PAGES:PAGINATION:NUMBER LABELS: [PAGINATION_NUMBER] [PAGINATION_URL]
// PAGES:PAGINATION:CURRENT_NUMBER LABELS: [PAGINATION_NUMBER]
// PAGES:NO_PAGES LABELS: [CATEGORY_NAME]

$TEMPLATE["PAGES"]["HEADING"] = <<<EOF
    Results [STARTING_PAGE_NUMBER] - [ENDING_PAGE_NUMBER] of  [TOTAL_PAGES] found in [CATEGORY_NAME]:
EOF;
$TEMPLATE["PAGES"]["PAGE"] = <<<EOF
    <P><A HREF="[PAGE_URL]"><B>[PAGE_TITLE]</B></A><BR>
    [PAGE_DESCRIPTION]<BR>
    [PAGE_URL]
EOF;
$TEMPLATE["PAGES"]["FEED_PAGE"] = <<<EOF
    <P><A HREF="[PAGE_URL]" ONMOUSEOVER="window.status='[PAGE_DOMAIN]';return true" ONFOCUS="window.status='[PAGE_DOMAIN]';return true" ONMOUSEOUT="window.status=''"><B>[PAGE_TITLE]</B></A><BR>
    [PAGE_DESCRIPTION]<BR>
    [PAGE_DOMAIN]
EOF;
$TEMPLATE["PAGES"]["FOOTER"] = <<<EOF
    <HR SIZE=1 COLOR="#DDDDDD">
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["HEADING"] = <<<EOF
    <P>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["PREVIOUS"] = <<<EOF
    <A HREF="[PAGINATION_URL]">Previous</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["NEXT"] = <<<EOF
    <A HREF="[PAGINATION_URL]">Next</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["NUMBER"] = <<<EOF
    <A HREF="[PAGINATION_URL]">[PAGINATION_NUMBER]</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["CURRENT_NUMBER"] = <<<EOF
    [PAGINATION_NUMBER]
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["FOOTER"] = <<<EOF

EOF;
$TEMPLATE["PAGES"]["NO_PAGES"] = <<<EOF
    No results found in [CATEGORY_NAME]
    <HR SIZE=1 COLOR="#DDDDDD">

EOF;

$TEMPLATE["FOOTER"] = <<<EOF
    <!--//
    ##################################################  ##################

    REMOVING THE LINKS BELOW WITHOUT A FULL LICENSE IS AN ILLEGAL ACTION

    ##################################################  ##################
    //-->
    Powered by the <A HREF="http://www.freephpdirectoryscript.com/">Free PHP Directory Script</A>
EOF;
?>

that above is the template_index.php file, and where you code in the template.

Now I dont know to use this EOF stuff, and Here is the design I am trying to integrate;

http://designcanada....y/template.html

I almost figured out how to integrate the design but it will only renders until the div I put the stuff into, and doesnt render the rest of the 2 columns; This can be seen here;

http://designcanada.net/directory/

The code is here (same template_index.php as above,but with my design in it)

<?php
// HEADING LABELS: [CATEGORY_NAME] [CATEGORY_DESCRIPTION]

$TEMPLATE["HEADING"] = <<<EOF
	<HTML>
	<HEAD>
	<TITLE>[CATEGORY_NAME] - [CATEGORY_TITLE]</TITLE>
	<META NAME="description" CONTENT="[CATEGORY_DESCRIPTION]">
	<META NAME="keywords" CONTENT="[CATEGORY_DESCRIPTION]">
	<link href="css/main.css" rel="stylesheet" type="text/css" />

	<style type="text/css">
<!--
.style1 {
	color: #999999;
	font-size: 12px;
}
-->
</style>
<body>
<div id="MainWrapper">
<div id="HeaderWrapper">
<div id="HeaderLogo">
<img src="images/logo.gif" width="348" height="81" />
</div>
<div id="HeaderNav">
	<div id="HeaderEmail">ADVERTISE@URDIRTECTORYS.CO.UK      </div>
<ul>
		<li><a href="index.php">Home</a></li>
		<li>|</li>
		<li><a href="news.php">News</a></li>
		<li>|</li>
		<li><a href="index.php">Categories</a></li>
		<li>|</li>
		<li><a href="contact.php">Contact</a></li>
	  </ul>
	  
</div>
</div>

<div id="MainContentWrapper">

<div id="ResultsAreaWrapper">
<div id="ResultsHeader">
<img src="images/urdirectory.gif" /></div>
<div id="ResultsMainWrapper">
<div id="ResultsMainTitle">[CATEGORY_NAME]
</div>
<div id="ResultsMainCates">
EOF;

// PATH:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// PATH:CURRENT_CATEGORY LABELS: [CATEGORY_NAME]

$TEMPLATE["PATH"]["HEADING"] = <<<EOF

EOF;
$TEMPLATE["PATH"]["CATEGORY"] = <<<EOF
	<A HREF="[CATEGORY_URL]">[CATEGORY_NAME]</A>
EOF;
$TEMPLATE["PATH"]["CURRENT_CATEGORY"] = <<<EOF
	[CATEGORY_NAME]
EOF;
$TEMPLATE["PATH"]["SEPARATOR"] = <<<EOF
	 :
EOF;
$TEMPLATE["PATH"]["FOOTER"] = <<<EOF

EOF;

// CATEGORIES:HEADING LABELS: [NUMBER_CATEGORIES] [CATEGORY_NAME]
// CATEGORIES:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// CATEGORIES:NO_CATEGORIES LABELS: [CATEGORY_NAME]

$TEMPLATE["SUBCATEGORIES"]["HEADING"] = <<<EOF

</div>
</div>

<div id="ResultsLowerAd">
<img src="images/bottomad.gif" width="502" height="304" /></div>

<div class="style1" id="LegalStuff">
Urdirectorys.co.uk 2006 . All rights reserved . Site designed by www.scr33n-raider.co.uk</div>
</div>
</div>

<div id="AdWrapper">

	<div id="AdOneWrapper">

	<div id="AdOneHeader">
	<img src="images/advertise.gif" width="97" height="28" />	</div>
	<div id="AdOneContent"></div>
	</div>
	<div id="AdTwoWrapper">
	<div id="AdTwoHeader"></div>
	<div id="AdTwoContent"></div>
	</div>
	<div id="AdThreeWrapper">
	<div id="AdThreeHeader"></div>
	<div id="AdThreeContent"></div>
</div>
</div>

<div id="SearchWrapper">
	<div id="SearchHeader">
	<img src="images/search.gif" />
	</div>
		<div id="SearchContent">
		
			<div id="SearchHead">
			<img src="images/searchheader.gif" />
			</div>
		
		<div id="SearchFrom">
		<FORM ACTION="search.php">
	<INPUT TYPE="text" NAME="q" SIZE=40>
	<br /><br />
	<INPUT TYPE="image" VALUE="Search"  src="images/enter.gif">
	</FORM>
	</div>
	
		</div>
		
		<div id="PricesWrapper">
				<div id="PriceHeader">
				<img src="images/prices.gif" width="74" height="28" />				</div>
			<div id="PricesOne">
			  <a href="#"><img src="images/adone.gif" width="262" height="73" border="0" /></a> </div>
			
			<div id="PricesTwo">
			  <a href="#"><img src="images/adtwo.gif" width="262" height="73" border="0" /></a> </div>
			
			<div id="PricesThree">
			<img src="images/adthree.gif" width="262" height="73" />	
			</div>
			
	</div>
  </div>

</div>

</div>
</div>
</div>
<H1>[CATEGORY_NAME]</H1>
	<FORM ACTION="search.php">
	<INPUT TYPE="text" NAME="q" SIZE=80>
	<INPUT TYPE="submit" VALUE="Search" CLASS="BUTTON">
	</FORM>
	<HR SIZE=1 COLOR="#DDDDDD">
EOF;

// PATH:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// PATH:CURRENT_CATEGORY LABELS: [CATEGORY_NAME]

$TEMPLATE["PATH"]["HEADING"] = <<<EOF

EOF;
$TEMPLATE["PATH"]["CATEGORY"] = <<<EOF
	<A HREF="[CATEGORY_URL]">[CATEGORY_NAME]</A>
EOF;
$TEMPLATE["PATH"]["CURRENT_CATEGORY"] = <<<EOF
	[CATEGORY_NAME]
EOF;
$TEMPLATE["PATH"]["SEPARATOR"] = <<<EOF
	 :
EOF;
$TEMPLATE["PATH"]["FOOTER"] = <<<EOF

EOF;

// CATEGORIES:HEADING LABELS: [NUMBER_CATEGORIES] [CATEGORY_NAME]
// CATEGORIES:CATEGORY LABELS: [CATEGORY_URL] [CATEGORY_NAME]
// CATEGORIES:NO_CATEGORIES LABELS: [CATEGORY_NAME]

$TEMPLATE["SUBCATEGORIES"]["HEADING"] = <<<EOF
	<P>
EOF;
$TEMPLATE["SUBCATEGORIES"]["BEFORE_COLUMNS"] = <<<EOF
	<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
	<TR>
	<TD WIDTH=260 VALIGN=top>
EOF;
$TEMPLATE["SUBCATEGORIES"]["CATEGORY"] = <<<EOF
	<LI><A HREF="[CATEGORY_URL]"><B>[CATEGORY_NAME]</B></A>
EOF;
$TEMPLATE["SUBCATEGORIES"]["BETWEEN_COLUMNS"] = <<<EOF
	</TD><TD WIDTH=20>&nbsp;</TD><TD WIDTH=260 VALIGN=top>
EOF;
$TEMPLATE["SUBCATEGORIES"]["AFTER_COLUMNS"] = <<<EOF
	</TD>
	</TR>
	</TABLE>
EOF;
$TEMPLATE["SUBCATEGORIES"]["FOOTER"] = <<<EOF
	<HR SIZE=1 COLOR="#DDDDDD">
EOF;
$TEMPLATE["SUBCATEGORIES"]["NO_CATEGORIES"] = <<<EOF
	<HR SIZE=1 COLOR="#DDDDDD">
EOF;

// SUBMISSION_LINK LABELS: [SUBMISSION_URL] [CATEGORY_NAME]

$TEMPLATE["SUBMISSION_LINK"] = <<<EOF
	<A HREF="[SUBMISSION_URL]"><B>Add Url to [CATEGORY_NAME]</B></A>
	<HR SIZE=1 COLOR="#DDDDDD">
EOF;

// PAGES:HEADING LABELS: [STARTING_PAGE_NUMBER] [ENDING_PAGE_NUMBER] [TOTAL_PAGES] [CATEGORY_NAME]
// PAGES:PAGE LABELS: [PAGE_TITLE] [PAGE_DESCRIPTION] [PAGE_URL] [PAGE_DOMAIN]
// PAGES:FEED_PAGE LABELS: [PAGE_TITLE] [PAGE_DESCRIPTION] [PAGE_URL]
// PAGES:PAGINATION:PREVIOUS AND PAGES:PAGINATION:NEXT LABELS: [PAGINATION_URL]
// PAGES:PAGINATION:NUMBER LABELS: [PAGINATION_NUMBER] [PAGINATION_URL]
// PAGES:PAGINATION:CURRENT_NUMBER LABELS: [PAGINATION_NUMBER]
// PAGES:NO_PAGES LABELS: [CATEGORY_NAME]

$TEMPLATE["PAGES"]["HEADING"] = <<<EOF
	Results [STARTING_PAGE_NUMBER] - [ENDING_PAGE_NUMBER] of  [TOTAL_PAGES] found in [CATEGORY_NAME]:
EOF;
$TEMPLATE["PAGES"]["PAGE"] = <<<EOF
	<P><A HREF="[PAGE_URL]"><B>[PAGE_TITLE]</B></A><BR>
	[PAGE_DESCRIPTION]<BR>
	[PAGE_URL]
EOF;
$TEMPLATE["PAGES"]["FEED_PAGE"] = <<<EOF
	<P><A HREF="[PAGE_URL]" ONMOUSEOVER="window.status='[PAGE_DOMAIN]';return true" ONFOCUS="window.status='[PAGE_DOMAIN]';return true" ONMOUSEOUT="window.status=''"><B>[PAGE_TITLE]</B></A><BR>
	[PAGE_DESCRIPTION]<BR>
	[PAGE_DOMAIN]
EOF;
$TEMPLATE["PAGES"]["FOOTER"] = <<<EOF
	<HR SIZE=1 COLOR="#DDDDDD">
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["HEADING"] = <<<EOF
	<P>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["PREVIOUS"] = <<<EOF
	<A HREF="[PAGINATION_URL]">Previous</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["NEXT"] = <<<EOF
	<A HREF="[PAGINATION_URL]">Next</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["NUMBER"] = <<<EOF
	<A HREF="[PAGINATION_URL]">[PAGINATION_NUMBER]</A>
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["CURRENT_NUMBER"] = <<<EOF
	[PAGINATION_NUMBER]
EOF;
$TEMPLATE["PAGES"]["PAGINATION"]["FOOTER"] = <<<EOF

EOF;
$TEMPLATE["PAGES"]["NO_PAGES"] = <<<EOF
	No results found in [CATEGORY_NAME]
	<HR SIZE=1 COLOR="#DDDDDD">

EOF;

$TEMPLATE["FOOTER"] = <<<EOF
	<!--//
	####################################################################

	REMOVING THE LINKS BELOW WITHOUT A FULL LICENSE IS AN ILLEGAL ACTION

	####################################################################
	//-->
	Powered by the <A HREF="http://www.freephpdirectoryscript.com/">Free PHP Directory Script</A>
EOF;

?>

I basically want all the of the script to be in the <div id="ResultsMainCates"> but also render the other divs after that.

I would love some help! I have never worked with EOF; before, and I dont understand how to do this.

You can get the html from the template.html, and the code (the first code) and try and them together if you want.

I really would love some help, I dont want to hire a contractor to help me on a small problem.

Thanks soo much!

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 19 September 2006 - 06:38 PM

You might want to checkout the PHP manual on heredoc:
http://dk.php.net/ma...ypes.string.php

#3 dylanjones

dylanjones
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 September 2006 - 06:50 PM

I read the part about heredocs, and I still dont get it.

I have never used them before, and I couldnt find EOF in the manual either, only EOD and EOT I think.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users