28, May 2012

Listing Latest Entries in Homepage - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Listing Latest Entries in Homepage
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Listing Latest Entries in Homepage  (Read 3829 times)
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« on: Nov 15, 2007, 01:39:44 am »

How can I list my latest articles, located in different directories, in my homepage? Is there a php script for it? What is it called?


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Nov 15, 2007, 09:37:05 am »

I think you need to query your database, how? depends on your database structure.

You should start with simple php/mysql tutorials (google is full of them)

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #2 on: Nov 15, 2007, 10:52:27 am »

i dont use mysql.


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Nov 15, 2007, 11:10:57 am »

i dont use mysql.
how are the listings stored? text files?

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #4 on: Nov 15, 2007, 11:27:04 am »

just .php files


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Nov 15, 2007, 11:35:56 am »

just .php files
but what do you want sort the date of this files?

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #6 on: Nov 15, 2007, 11:41:36 am »

yeah. i wish i could show a link to the newest file in each directory in my homepage. like a list of ten newest articles.
« Last Edit: Nov 15, 2007, 11:43:46 am by vbignacio »


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Nov 15, 2007, 11:46:44 am »

yeah. i wish i could show a link to the newest file in each directory in my homepage. like a list of ten newest articles.

you need to play with the directory class, this snippet is just an example how to do that:
http://www.finalwebsites.com/snippets.php?id=26

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #8 on: Nov 15, 2007, 11:58:16 am »

thanks for your time olaf.


Last blog : Bingag Beach, Bohol, Philippines
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #9 on: Nov 15, 2007, 03:07:31 pm »

this is what i need, but instead of the oldest file, which line do i have to change so it would get the newest file? thanks!


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Nov 15, 2007, 03:10:04 pm »

this is what i need, but instead of the oldest file, which line do i have to change so it would get the newest file? thanks!

check this function http://nl2.php.net/manual/en/function.rsort.php

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #11 on: Nov 15, 2007, 03:22:14 pm »

based on the examples, does this mean that the asort function sorts an array from oldest to newest and rsort does it in reverse?


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: Nov 15, 2007, 03:39:17 pm »

based on the examples, does this mean that the asort function sorts an array from oldest to newest and rsort does it in reverse?
yep

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #13 on: Nov 15, 2007, 11:52:51 pm »

thanks. that does it for me. what if there are multiple files that have the same time stamp? how would the script decide which file to choose? would it do it alphabetically?


Last blog : Bingag Beach, Bohol, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Nov 15, 2007, 11:54:37 pm »

thanks. that does it for me. what if there are multiple files that have the same time stamp? how would the script decide which file to choose? would it do it alphabetically?
from the same second? do you checked the manual for this info?

Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #15 on: Nov 16, 2007, 01:43:33 am »

yes, my articles are generated in batches of ten at a time so i guess they have the same time stamp up to the last second. it doesnt say in the manual. i think i will make a test page to find out.

thanks for pointing me to the right direction. i dont know what to look for to begin with.


Last blog : Bingag Beach, Bohol, Philippines
Bill Gates is my home boy
*****
Gender: Female
Posts: 710
4449 credits
Members referred : 2



« Reply #16 on: Nov 16, 2007, 05:33:46 pm »

Keep in mind I don't know anything on php programming, but couldn't you use an RSS feed of some sort - it would seem that would ensure the last listing would be used from each directory?

www.yourmessageconsultant.com, providing online content and printed marketing materials.
www.helpforwebbeginners.com, Tutorials and how to's for new  webmasters.
www.CraftyTips.com, a unique Arts & Crafts Directory
www.nocans.com - Pet Food Recipe Site
www.petsiteguides.com - A New Pet Directory

Last blog : Spring Cleaning at Crafty Tips
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #17 on: Nov 16, 2007, 06:09:02 pm »

That would require writing a script, much like the one used, to create the RSS feed first. The site is just a collection of separately stored pages without the use of some CMS that has RSS feeds integrated.


Last blog : Are You Stumbling Yet?
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #18 on: Nov 17, 2007, 12:01:55 am »

... couldn't you use an RSS feed of some sort...

thanks for your suggestion, ma'am, but Nico is right. my article site is not on cms. actually its a "frankenstien" site of pieced together-scripts.


Last blog : Bingag Beach, Bohol, Philippines
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7377
Tags : php script site navigation Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Listing Latest Entries in Homepage
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 08:44:06 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.