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 Help & Support amount of headlines to show
1 2
Corneliusw
Posted on 13 Jul 2009, 01:19:15

Access: Member
Total Posts: 16
Joined: 2008-10-15

Is there a way to limit the amount of news headlines you want to show. For example I will have news, editorials and results category showing on main page. I would want only 10 news headlines, 5 editorial headlines, and 8 results headlines showing. How do I limit the amount of headlines that will show within the display code?
#616
Chris
Posted on 13 Jul 2009, 01:56:46

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

You can only set the $nppage variable which determines the amount of news overall to show, it's not possible to show different amounts for each category.
#617
Hackerzlab
Posted on 25 Sep 2009, 11:03:59

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

i thought this is possible with this tutorial u have given below:
http://network-13.com/thread/ddb88a9de351f135
My homepage will have 3-4 different categories in various part of the layout. is this really not possible to show the number of headlines/articles according to their category?
#884
Chris
Posted on 25 Sep 2009, 15:11:58

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

Hackerzlab,

See this thread for instructions on how to use multiple includes.
#887
Hackerzlab
Posted on 25 Sep 2009, 21:33:02

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

i downloaded your index.php and multiple categories work great but there's one thing that's left out:

your tutorial here http://network-13.com/thread/ddb88a9de351f135 to display different amounts of news per category doesn't work anymore! i want to display different number of news for different categories on the home page.

Quote:
By adding the ?cat=something to the address bar you are actually viewing the news for that category.

To display different amounts of news per category, if you open index.php and find the lines

Code:
$sql = "SELECT nppage FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$nppage = mysql_result($query,0);


and change them to

Code:
if(!$nnpage){
$sql = "SELECT nppage FROM `$newsoptions` WHERE 1";
$query = mysql_query($sql);
$nppage = mysql_result($query,0);
}


now when you are including your news using the include function put $nnpage = 5; just before it.

Code:
$nnpage = 5;
include ('n13news/index.php');


i can't find those codes in the new index.php file to replace it. please help.
#894
Last edited by Hackerzlab at 2009-09-25 21:34:18 Reason:
Chris
Posted on 25 Sep 2009, 21:39:35

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

You may be overcomplicating things. This is how you set the amount of news to show for each individual include

Code:
<?php
#this is the first include
$nppage = '5'; #show 5 news posts
$cat[] = "cat1"; #show posts assigned to cat1
include 'news/index.php';
?>

<hr />

<?php
#this is the second include
$nppage = '10'; #show 10 news posts
$cat[] = "cat2"; #show posts assigned to cat2
include 'news/index.php';
?>
#895
Last edited by Chris at 2009-09-25 21:40:12 Reason:
Hackerzlab
Posted on 25 Sep 2009, 22:16:39

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

u r the best :)

thank you.
#896
Hackerzlab
Posted on 26 Sep 2009, 06:21:35

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

there's one big problem though. could you please get me out of this.

when i click on the 'comments' or the 'read full story', it shows up with the news and the comment box but it has the same news repeated again with two comment boxes! could you please help.

here's an example of the full story after i replace the above index.php:
----------------------

Code:
[shows the full story] [shows the comments posted by the users] [comment box]

[shows the comments posted by the users] [comment box]
[shows the comments posted by the users] [comment box]

the comments and the comment box is shown twice again! how should i remove that?
#897
Chris
Posted on 26 Sep 2009, 06:24:22

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

Can you post a link to teh site so I can get a better idea of what exactly is happening?
#898
Hackerzlab
Posted on 26 Sep 2009, 06:31:08

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

i just signed up for a free server but its NOT allowing the modules to be uploaded!! the file format isn't allow in the free server. i haven't bought a host yet!

i dont know what to do :(

EDIT: check my next post please.
#899
Last edited by Hackerzlab at 2009-09-27 07:44:56 Reason:
1 2
Network-13.com © 2013