WebsiteBaker Community Forum

General Community => Off-Topic => Topic started by: peachey on September 19, 2006, 10:21:59 AM

Title: how would i add this into a page
Post by: peachey on September 19, 2006, 10:21:59 AM
i want to inculde this into my page in the row under the "lastest News:"
the code i want:
Code: [Select]
<!--P
$number=1;
$category=1;
include("/home/peachey/public_html/cutenews/show_news.php");
-->

and my current page is this:
Code: [Select]
<p><table style="WIDTH: 100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td><p align="center"><font size="5"><strong>Welcome to the <em>Hut Of Peachey</em>.</strong></font></p></td></tr><tr><td></td></tr><tr><td><strong><u>Latest News:</u></strong></td></tr><tr><td>td></tr></tbody></table></p>
Title: Re: how would i add this into a page
Post by: peachey on September 21, 2006, 10:23:42 AM
the code is php btw
Title: Re: how would i add this into a page
Post by: ruebenwurzel on September 21, 2006, 10:28:43 AM
Hello,

sorry for not answering. I don't understand exactly what you wanna do with this code. Can you please explain what result you wanna have on your page.

Matthias
Title: Re: how would i add this into a page
Post by: peachey on September 21, 2006, 10:36:50 AM
it displays the cutenews output into a page (sort of like an iframe)
Title: Re: how would i add this into a page
Post by: ruebenwurzel on September 21, 2006, 11:35:36 AM
Aaaaah,

now i understand. Ok there are different abilitys.

1. You wanna have the news only on one page
Go in WB admin interface to the edit page section and the page where you wanna have the news. On top right you see "manage section". Go to this and add a code section. Insert in this code section the php code without "<?php" at the beginning and "?>" at the end. The code should look like the one you posted

Didn't work on my test enviroment

2. You wanna have the news on every page at the same place (header or footer or wherever).
Edit the index.php of your template and the code where you wanna have it. From your example it should the look like
Code: [Select]
<td>
     <strong><u>Latest News:</u></strong>
     <?php
     
<!--P
     $number
=1;
     
$category=1;
     include(
"cutenews/show_news.php");
     -->
     
?>

</td>

Not tested but it should work

Matthias
Title: Re: how would i add this into a page
Post by: peachey on September 26, 2006, 05:25:38 AM
sorry for taking so long to reply, i just want it on the front page in the table cell.
Title: Re: how would i add this into a page
Post by: ruebenwurzel on September 26, 2006, 06:21:25 AM
Hello,

not nice but a working workaround:

Make a copy of your template. Change folder and name in the info.php. Add the code to the index.php of this template. Install this template and set this template for the first page as the default template.

this way you have on every page the same layout, only on the firstpage you have the additional cutenews. Bad thing is when you make changes on your template you have to do this twice.

Matthias