Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-20-2022, 12:23 AM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Change page content order based on the month?

So, I have a block of text (list of months with description below) on a page that I'd like to update dynamically based on the month of the year for example, presently it looks like this:

January | February | March
April | May | June
July | August | September
October | November | December

What I'd like to happen, is for this month (September), the page to look like this, and every month the current month cycles to the first position:

September | October | November
December | January | February
March | April | May
June | July | August

What is the best way to achieve this please?

Presently the page itself is hard-coded, no database involved, but if its needs to go into a DB that isnt a problem, I'm just not sure what the best way to achieve this would be, i'm guessing I will end up having to use something to do with the php date function ("F")?

Any advice or suggestions greatly appreciated.

Thanks!
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2022, 08:55 AM   #2
baodb
Confirmed User
 
Industry Role:
Join Date: Jan 2021
Posts: 103
It depends a lot on how your page works. Is this dynamically built with PHP, Static rendered, spa?
baodb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2022, 10:13 AM   #3
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
You get the current month of the year as a number with date("m").
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2022, 11:20 AM   #4
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,057
Quote:
Originally Posted by redwhiteandblue View Post
You get the current month of the year as a number with date("m").
Once you have the current month you can just loop through to make your list in the order you need it in.

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-20-2022, 05:41 PM   #5
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Awesome, thank you
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
month, page, september, march, june, january, april, july, october, achieve, december, presently, november, august, february, based, greatly, guessing, appreciated, php, date, function, suggestions, advice, update
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.