Login

Member statsTotal: 206Latest: CcardinGuests online: 7Members online: 0
EmailLogin here

Location
ForumSuggestions • Variable amount of news per page

Access: Member
Total posts: 12

Status: Offline
Variable amount of news per page Quote 

Hi Chris,
I know you can set a global amount of news articles per page, but it would also be nice to be able to locally set how many articles are displayed per page through the include.
i.e.
$newscount = '5';

I ask this because I use my old news system not only for news postings, but as my actual website content editor and it works great for this purpose.  Your version looks great and with the SQL backend, it makes things a lot easier and manageable.  Great job on this project. :cool2:

-SlinkySam
10:26pm 21st Aug 08  
Access: Admin
Total posts: 174

Status: Offline
Re: Variable amount of news per page Quote 

Hey Sam,

I'll certainely add this in the next version, for now you can easily add this functionality by making a small change to the index.php file

around line 302~ you'll see the following code

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

simply change that to

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

then when including your news simply specify the amount you want to show by adding

PHP Code:
<?php
$nppage
= '10';
include
'news/index.php';
?>
12:00am 22nd Aug 08
_______________
Chris - Network-13
Access: Member
Total posts: 12

Status: Offline
Variable amount of news per page Quote 

Chris,
That is freaking crazy.  It would take me a week to come up with that mod. You have some mad skills and I appreciate your time putting this all together.  Just don't get burned out on it all because your work is very clean and appreciated.

By the way, do you have a "donate" button somewhere so I can at least give back a little something?  I have fun tweaking and playing with code stuff, but I have very little to offer in that realm.

-SlinkySam
01:55am 22nd Aug 08  
Access: Admin
Total posts: 174

Status: Offline
Variable amount of news per page Quote 

Hey Sam,
I don't have a donate button and I certainely would never ask for donations. But if you really want to (I'm not going to stop you :tongue:) my paypal account is vbchris@gmail.com
06:37am 22nd Aug 08
_______________
Chris - Network-13
Access: Member
Total posts: 4

Status: Offline
Variable amount of news per page Quote 

Oh I think I have found exactly what I'm after. Thanks for this, I will be adding this right away!!

Definitely something that should be added in the next release, especially if it is simple like that! =]
03:14pm 29th Sep 08  
Post a reply!