Jump to content

PHP Include?


Guest ace5p1d0r

Recommended Posts

Guest ace5p1d0r

I am trying to simply PHP Include something into my store.

It is coded in PHP, why doesent it work?

Simple example: Try to include a .txt document into index.tpl to display on all pages. I know the .tpl file does not support PHP, but that only goes into a PHP file doesent it?

Thanks in advance

Alec

Link to comment
Share on other sites

Version of Xtemplate system used in CubeCart 3.0.x doesnt support this in template. You have to use additional template variable with content of the desiderd file in appropriate php file. Add this new template variabale to a template.

Link to comment
Share on other sites

Guest ace5p1d0r

Thanks convict I looked closely at both of those.

However its not really what I'm looking for. I just want a very simple way of including a .txt document in a .tpl file. Just like PHP Include but that doesent work, so what will?

Link to comment
Share on other sites

Guest ace5p1d0r

Ah right. Thats this:

<!-- BEGIN: body -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>

<title>{META_TITLE}</title>

<meta http-equiv="Content-Type" content="text/html; charset={VAL_ISO}">

<meta name="description" content="{META_DESC}">

<meta name="keywords" content="{META_KEYWORDS}">

<link href="skins/{VAL_SKIN}/styleSheets/layout.css" rel="stylesheet" type="text/css">

<link href="skins/{VAL_SKIN}/styleSheets/style.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/support.js"></script>

<script language="javascript" src="js/jslibrary.js" type="text/javascript"></script>

</head>

<body>

<div id="pageSurround">

<div id="subSurround">

<div id="topHeader">

<div style="padding-top: 72px;">{SEARCH_FORM}</div>

<div>{SESSION}</div>

</div><div>

<div class="colLeft">

<div class="boxTitleLeft">Shop by Type</div>

<div class="boxContentLeft">

<li class="bullet"><a href="index.php" class="txtDefault">Homepage</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=12" class="txtDefault">Portrait Paintings</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=10" class="txtDefault">Subject</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=11" class="txtDefault">Style</a></li>

</div>

<div class="boxTitleRight">Our Company</div>

<div class="boxContentRight">

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=14" class="txtDefault">About Us</a></li>

<li class="bullet"><a href="java script:popUp('http://www.worldpaintinggallery.com/contact/')" class="txtDefault">Support</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=5" class="txtDefault">F A Q</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=13" class="txtDefault">How To Order</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=6" class="txtDefault">Terms & Conditions</a></li>

<li class="bullet"><a href="http://www.worldpaintinggallery.com/index.php?act=viewDoc&docId=15" class="txtDefault">Partners</a></li></div>

{CATEGORIES}

{MAIL_LIST}</div>

<div class="colMid">

{PAGE_CONTENT}

</div><div class="txtSiteDocs">

<div align="center"><img src="../../../../images/secure.gif" alt="Secure Purchasing 100% Guaranteed" width="140" height="55" vspace="3" /></div></div>

<div class="colRight">

<div class="boxTitleRight">Showcase</div>

<div class="boxContentRight">

<div align="center"><img src="http://www.worldpaintinggallery.com/images/anim.gif" alt="World Painting Gallery"><br>

</div></div>{SHOPPING_CART}

{POPULAR_PRODUCTS}

{SALE_ITEMS}

<div class="boxTitleRight">Support</div>

<div class="boxContentRight">

<div style="text-align: centre">

<div align="center"><a href="java script:popUp('http://www.worldpaintinggallery.com/contact/')"><img src="http://www.worldpaintinggallery.com/contact/help.gif" alt="Contact WPG" width="140" height="57" border="0"></a><br>

</div></div></div>

{INFORMATION}

{CURRENCY}

{LANGUAGE}

</div></div>

<div align="center"><br clear="all" />

{SITE_DOCS}

<span class="txtSiteDocs">Site Development By: <a href="http://www.acedesign.org" target="_blank">AcE Design</a> | Proudly Hosted By: <a href="http://www.bluehost.com/track/ace5p1d0r/text1" target="_blank">BlueHost</a></span><br /><img src="../../../../images/payments.gif" alt="We Accept:" width="390" height="22" /></div></div></div></body></html>

<!-- END: body -->

Thanks again.

Link to comment
Share on other sites

Guest shandaman

yup

to surround it in another content box simply put it inside of

<div class=boxContent">

Put Content Here!!

</div>

Link to comment
Share on other sites

Guest ace5p1d0r

yup

to surround it in another content box simply put it inside of

<div class=boxContent">

Put Content Here!!

</div>

shandaman I am aware of how to use DIV tags :sourcerer: .

Like it says above, I want a way to grab a .txt file from another location. Just like PHP Include.

Link to comment
Share on other sites

Guest shandaman

well im sure here is but there hasnt been one mentioned yet, you could add it in like a previous post by creatign a tpl file and linking to it.

Link to comment
Share on other sites

Guest ace5p1d0r

In that .tpl file would there be a way of grabbing the text file?

I have the ability to automatically edit the text file. I just need it displayed automatically now.

Link to comment
Share on other sites

Guest ace5p1d0r

THIS page explains grabbing it using Javascript. However the .txt file cannot only include the text I want to show (which it must).

Javascript seems to be the most plausible option... I just cant find out how =[

Link to comment
Share on other sites

Guest shandaman

sorry i havent replied yet, i couldnt find any other way then the link you gave me. you could always use a inline frame to do it this would be a mod and you can pm me for details on how it would work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...