Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums How To Multiple Includes
Chris
Posted on 15 Oct 2009, 04:14:15

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

With 3.3 you can now include the script multiple times within the same page. Each include can show different amounts of news or entirely different categories/authors depending on what you specify.

In this example we'll use 2 includes for simplicity's sake.

Imagine a page split into 2 columns

Code:
<table width="100%" style="borer: 1px solid #000000">
<tr>
<td width="50%">left column</td>
<td width="50%">right column</td>
</tr>
</table>


In the left column we want to show some headlines that when clicked, will open up within the right column. To do that we make the left column Static like so

Code:
<table width="100%" style="borer: 1px solid #000000">
<tr>
<td width="50%">
<?php
$static 
= true; #this is the important part
include 'news/index.php';
?>
</td>
<td width="50%">
<?php
include 'news/index.php';
?>
</td>
</tr>
</table>


You can only have 1 include that isn't static. For example if you have 4 includes on the same page, 3 of them have to be static otherwise there'll be problems.
#950
Last edited by Chris at 2009-12-26 15:11:15 Reason:
Neotomaz
Posted on 04 Feb 2010, 19:23:17

Access: Member
Total Posts: 3
Joined: 2010-02-01

Hi,
how to show only last news ?
I would like to hawe on 1st page only last news and on page archive all news.
#1815
Chris
Posted on 04 Feb 2010, 19:26:13

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You can control what order your news gets displayed in using the $newsorder variable like so

Code:
<?php
$newsorder 
= 'ASC'; #this can be either ASC or DESC
include 'news/index.php';
?>


To show your archived news posts use the $archives variable

Code:
<?php
$newsorder 
= 'DESC';
$archives = true;
include 
'news/index.php';
?>
#1816
Hackerzlab
Posted on 26 Mar 2010, 20:05:10

Access: Member
Total Posts: 31
Joined: 2009-09-25

when i use multiple includes, the "full story" remains on the same page! this distorts the entire layout.

i want the full story to be shown on a different page and not on the homepage. is that possible?

EDIT: something is seriously wrong with this multiple include. the full story is shown on the same page! the problem would be solved if its shown in a new page, i believe.
#2143
Last edited by Hackerzlab at 2010-03-27 23:34:51 Reason:
Chris
Posted on 28 Mar 2010, 00:15:35

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You'll have to show me what you mean for me to be able to fix this.
#2156
Hackerzlab
Posted on 28 Mar 2010, 06:49:21

Access: Member
Total Posts: 31
Joined: 2009-09-25

okay. i'm actually trying out on localhost. i'll upload it somewhere later and show it to you then...

i think you could try using the above code you mention for multiple include and see it for yourself.. the "full-story" is shown on the same page.
#2157
Hackerzlab
Posted on 29 Mar 2010, 12:34:50

Access: Member
Total Posts: 31
Joined: 2009-09-25

Solved.
http://network-13.com/thread/2161-1-full-story-to-be-shown-on-a-different-new-page
#2163
Network-13.com © 2013