Jump to content

Use Php In Site Doc? How?


Guest dj4life

Recommended Posts

Guest dj4life

Hi guys,

Simple question, how do i include a php page in a site doc?

I dont want to include it as an inline frame, id rather be able to enter some code into the site doc source that calls the page directly.

Cheers,

Darren

p.s everytime i use <?php and ?> to embed php in a site doc (using the 'source' option)

it changes it to <!--p and -->

How can i stop this happening or overide it?

Link to comment
Share on other sites

Guest ianleopard666

i dont think php will work in there, only html.

you could always create a page and incorperate it in cc.

what is the page you are trying to call? what does it do?

Link to comment
Share on other sites

Guest dj4life

i dont think php will work in there, only html.

you could always create a page and incorperate it in cc.

what is the page you are trying to call? what does it do?

Hi there! Nice to meet you!

The page im trying to call is in a domain sub folder, called awards.php ..... the page has been styled to fit the centre column of the classic skin (the one i use) 349 px width....

p.s i see your in cannock! small world, im just down the road in Pelsall!

Thanks again,

Darren

Link to comment
Share on other sites

Guest ianleopard666

small world indeed, :)

if you really dont want to use iframes the way i do things is to create a seperate page ie. awards.inc.php and awards.tpl, add the page to index.php in the root then add a link to it in sitedocs.tpl.

of course this really depends how confident you are with php. if its a pretty simple page i can help convert it, u can pm me here or at cubecartforums for my email address so you can pass the file onto me.

Link to comment
Share on other sites

There's a mod listed on CubeCartForums.org that will allow you to use PHP in site docs. It also does a number of other cool things, like allow you to have multiple site doc categories (each with their own box) and allows you to order them however you'd like.

Sorry, can't give a direct link as that is forbidden by the forum rules here.

Link to comment
Share on other sites

Guest dj4life

hi guys, ive nearly got it......

ive included a page in the 'includes' folder..... the file is called awards.inc.php ....... ive then included a file in the skins template folder called awards.tpl .........

i type in this URL........

http://mydomain.com/index.php?act=awards

and the awards page i want to display shows up and works fine.... but its not wrapped to fit in the middle column to display as page content.... (classic skin)

ive added this at the end of my awards.inc.php file......

--------------------

$awards->parse("awards");

$page_content = $awards->text("awards");

--------------------

but im getting the following error message.......

--------------------

Fatal error: Call to a member function on a non-object in http://mydomain.com/includes/content/awards.inc.php on line 105

--------------------------------

Can anyone please advise me how to correct this?

Cheers,

Darren

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