TinyPortal

Development => Support => Topic started by: mattrat on August 19, 2007, 09:47:54 PM

Title: HTML in an article
Post by: mattrat on August 19, 2007, 09:47:54 PM
I have a custom action which displays a HTML table. I would like for that table to also be displayed in an article. I can copy and paste the code into the article and it works ok. But this would require me to update both tables. I want to be able to update only the one used in the custom action and it display the updates in the article.

What HTML code would I use in the article?
Title: Re: HTML in an article
Post by: JPDeni on August 19, 2007, 11:04:45 PM
Where is the code for the custom action stored? If it's in a database table, you would be able to read the code from the table in a php article.
Title: Re: HTML in an article
Post by: mattrat on August 20, 2007, 02:23:56 AM
Its  a HTML file in a folder in the root directory.

Can you show me what code?
Title: Re: HTML in an article
Post by: JPDeni on August 20, 2007, 02:57:23 AM
Oh, I see. Your custom action is an html file. I thought it was php.

I'm not sure how to copy html into an article. I tend to avoid duplication whenever possible. Is there no way that you could dispense with the custom action and the html file and just use an article?
Title: Re: HTML in an article
Post by: mattrat on August 20, 2007, 03:07:31 AM
To make sure we are on the same page........

The custom action is here

http://arkhssports.net/index.php?action=scoreboard (http://arkhssports.net/index.php?action=scoreboard)

The article is here

http://arkhssports.net/index.php (http://arkhssports.net/index.php)

I have pasted the html into the article. this leaves me to edit two files. I would like for the atricle to display the file at http://arkhssports.net/scoreboard/index.html that is the same file that the action uses.
Title: Re: HTML in an article
Post by: IchBin on August 20, 2007, 03:19:24 AM
In your php article include your html file.

include('path/to/your/file.html');
Title: Re: HTML in an article
Post by: qw3r7yju4n on February 23, 2008, 06:55:22 PM
I get this error when i use your method there IchBin

Parse error: syntax error, unexpected $end in /nfsn/content/resurgence/public/SMForum/Sources/Load.php(1735) : eval()'d code(209) : eval()'d code on line 1

does this have something to do with the fact it is an excel sheet saved for web?

i am very new to using php...
Title: Re: HTML in an article
Post by: JPDeni on February 23, 2008, 07:07:16 PM
Please paste the exact code you are using in your php article, so we can see what the problem is. My guess is that you didn't end your line with a ; but I can't be sure until I see it.
Title: Re: HTML in an article
Post by: qw3r7yju4n on February 24, 2008, 03:54:51 AM
im trying to take a premade .HTML file and just put it in an article so it is actually in the portal, not a link to a nasty looking .html

all i used in the php-article was

include('path/to/your/file.html');

exactly... nothing else included.. is there something more i have to add since its not really html IN php?
Title: Re: HTML in an article
Post by: Ken. on February 24, 2008, 11:07:35 AM
Try changing it to this to see if it works:

include("http://www.the_site/folder/page.html");

Point is this... a few times I've had to play around with the command to get it to pull the page.