Jump to content

View a site document inside a box


Guest Baj

Recommended Posts

My client is a weapons-grade idiot.

I have tried to make things simple for him.

He wanted a box with a list of products he has in the pipeline but not available yet.

I created two files: soon.inc.php and soon.tpl

soon.inc is as follows (after the usual header licence stuff and the no poking about code)

$incdoc = file_get_contents('./soon.txt', true);

$incdoc = nl2br($incdoc);







$box_content=new XTemplate("skins/".$config['skinDir']."/styleTemplates/boxes/soon.tpl");



$box_content->assign("LANG_DISCOUNT_PROMO_TITLE",$lang['front']['boxes']['discount_promo']);

$box_content->assign("SOON_TEXT",$incdoc);

	

$box_content->parse("coming_soon");



$box_content = $box_content->text("coming_soon");




This takes a text file in the root (the easiest place for him to find) and parses it through to a box for CC to deal with.



soon.tpl is simply:


<!-- BEGIN: coming_soon -->

<div class="content2">

	

  <div class="CS_text">

{SOON_TEXT}

</div>

</div>



<!-- END: coming_soon -->

Simple. It works fine.

Genius client however still cannot get to grips with this so I would really like to creat a site documet he can use instead so instead of including the text file I can just point at the document number. However it aint that simple.

Any pointers?

I am guessing I will probably have to pull the data from the db directly using the id#?

Link to comment
Share on other sites

Baj,

in time, you'll realise that its not professional to describe clients like this. I'm sure you're happy to take his money?

To add a siteDoc, basically look at the viewDoc.inc.php script, this should detail how to get the site doc from the database.

As this is a change to the core functionality, any further discussion needs to be over at CubeCartForums.org

Regards,

Jason

Link to comment
Share on other sites

Cheers. Will look into it.

I have been doin this for more years than I care to remember. Every now and again you get one, nice enough as he is, who just does not get it.

Yes I am happy to take his money. Yes if I charged correctly for the work I have done to date I would be calling Bill Gates poor.

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