Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How to EXCLUDE the last post from include code?

 
Reply to topic    Forum Index » Help View previous topic
View next topic
How to EXCLUDE the last post from include code?
Author Message
afxback



Joined: 11 Nov 2005
Posts: 123

Post How to EXCLUDE the last post from include code? Reply with quote
Hello,
Anybody could help me if there is a solution to Exclude the last post automaticly from include code?
This is because I generally have multiple includes from the same categories in the same page as below, for example:

Include code 1
<?
$number = "1";
$template = "Default";
$category = "1,2,3,4,5,6";
include $cutepath.'/show_news.php';
?>

Include code 2
<?
$number = "5";
$template = "Headlines";
$category = "1,2,3,4,5,6";
include $cutepath.'/show_news.php';
?>
I want the first include display the last post only in normal order with Default template and short story...
While, the second include must show just "Headlines" from last (5) number of posts. So I dont want the last post shown repeatedly on one page and col...
How could you solve this?
Thanks in advance
Thu Jul 10, 2008 11:48 pm View user's profile Send private message
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1808
Location: US

Post Reply with quote
You mean the lasts posts from your entire news database? If so I think you need $sort = array('date', 'ASC'); to sort from Oldest to Newest and then you need to use include codes similar to this:

Include code 1:
Code:
<?
$number = "1";
$template = "Default";
$sort = array('date', 'ASC');
$category = "1,2,3,4,5,6";
include $cutepath.'/show_news.php';
?>


Include code 2
Code:
<?
$number = "5";
$skip = "1";
$template = "Headlines";
$sort = array('date', 'ASC');
$category = "1,2,3,4,5,6";
include $cutepath.'/show_news.php';
?>


That should show the oldest post with default template, then show 5 headlines excluding the very last one (so no news repeats) because of the $skip variable Wink

I hope I understood and answered you correctly Embarassed

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Jul 11, 2008 1:29 am View user's profile Send private message Visit poster's website AIM Address
afxback



Joined: 11 Nov 2005
Posts: 123

Post Reply with quote
Thank you dear Scottdallas,
I do not want the "oldest" post shown in any of my includes. I need both includes show the latest and newest posts from the selected categories. I tried your solution but in my first include code, it displays the oldest post from 4 years ago!
I just want to exclude the latest post from being shown repeatedly in the second include. I mean the second include code must display 5 latest posts except the "newest" one!
again thank you.
any other solution will be appreciated.

[b]UPDATE:[/b]
Solved! I really did not know the very functions of "skip".
It works without any change in the sortings...
Thank you dear scott.
Fri Jul 11, 2008 7:34 am View user's profile Send private message
robp07



Joined: 15 Jun 2008
Posts: 21

Post Reply with quote
Hey,

Is it possible to have a {big-avatar} along with the normal size {avatar}. So the 1st news item shows this big image, but when it isnt new any more goes back to the normal {avatar} size.

It would be easy-enough in the templates, but what code would I need to change to implement it?

Cheers!
Sun Jul 13, 2008 10:40 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1808
Location: US

Post Reply with quote
Quote:
Solved! I really did not know the very functions of "skip".


ah yes Wink good i'm glad you figured out what you need!

And robp07, good question although I don't think it is relevant to this thread. Can you post it again in the Help section? You'll probably get a better response.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Mon Jul 14, 2008 12:41 am View user's profile Send private message Visit poster's website AIM Address
robp07



Joined: 15 Jun 2008
Posts: 21

Post Reply with quote
It is slightly relevant Razz

But yeh it will probaly be seen more in its own thread!
Mon Jul 14, 2008 11:23 am View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.