8, January 2009

Listing Latest Entries in Homepage - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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


Philippine Beaches


« on: Nov 15, 2007, 02: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 : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Nov 15, 2007, 10: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)


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #2 on: Nov 15, 2007, 11:52:27 AM »

i dont use mysql.


Last blog : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Nov 15, 2007, 12:10:57 PM »

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


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #4 on: Nov 15, 2007, 12:27:04 PM »

just .php files


Last blog : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Nov 15, 2007, 12:35:56 PM »

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


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #6 on: Nov 15, 2007, 12:41:36 PM »

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, 12:43:46 PM by vbignacio »


Last blog : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Nov 15, 2007, 12:46:44 PM »

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 Visit through proxy


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #8 on: Nov 15, 2007, 12:58:16 PM »

thanks for your time olaf.


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


Philippine Beaches


« Reply #9 on: Nov 15, 2007, 04: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 : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Nov 15, 2007, 04: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 Visit through proxy


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #11 on: Nov 15, 2007, 04: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 : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: Nov 15, 2007, 04: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


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #13 on: Nov 16, 2007, 12:52:51 AM »

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 : Laiya Aplaya Beach, Batangas, Philippines
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6557
40174 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Nov 16, 2007, 12:54:37 AM »

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?


Last blog : Just a better Internet portal provided by Google
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #15 on: Nov 16, 2007, 02: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 : Laiya Aplaya Beach, Batangas, Philippines
Bill Gates is my home boy
*****
Gender: Female
Posts: 664
4145 credits
Members referred : 2



« Reply #16 on: Nov 16, 2007, 06: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 Visit through proxy, providing online content and printed marketing materials.
www.helpforwebbeginners.com Visit through proxy, Tutorials and how to's for new  webmasters.
www.CraftyTips.com Visit through proxy, a unique Arts & Crafts Directory
www.nocans.com Visit through proxy - Pet Food Recipe Site
www.petsiteguides.com Visit through proxy - A New Pet Directory

Last blog : After Christmas Sales - Bah Humbug!
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #17 on: Nov 16, 2007, 07: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, 01: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 : Laiya Aplaya Beach, Batangas, Philippines
Nikolas' Servant Child
*
Posts: 30
180 credits
Members referred : 0


« Reply #19 on: May 28, 2008, 04:54:18 AM »

removed...
« Last Edit: May 28, 2008, 05:06:47 AM by wineo »
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Jan 08, 2009, 10:16:11 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!


Forum Statistics
Total Posts: 38.657
Total Topics: 7.772
Total Members: 4.659
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: sardiniasarena

32 Guests, 4 Users online :

17 users online today:



Readers

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