View Full Version : Php problem - ...
noooze
09-25-2003, 11:50 AM
ok here goes again
my script list all the links by a- b- c ect. so its impossible to tell what link is new and what link is old. any way to add a lille line that puts a "new" after a link that has been added lastest..
or something ?
I know some of you are very bright in here so I hope i can get some help. My free linklist script isnt that good but I really dont have any money to invest in a script... so i guess i have to manage
cheers
noooze
If your database has a field for date added then you can, otherwise i'd say you're in trouble...
Without looking at what you've got you'll need to do three things:
1. check the date of the link addition. how you do it depends on whether you're using a database or txt file.
2. check the current date eg:
$current_date = gmstrftime('%m/%d/%y', strtotime("0 days"));
that needs to be modified depend on how the date is recorded for the added links.
3. create an if statement to compare the two dates and check if the date is within a certain timeframe eg. 7 days.
Unfortunately it's not going to be that easy for you to implement something like that nooze...
Good Luck!
Matt
I wish I know a whole lot more PHP. At most I can go in and change a few things on a script.
Anyway, a long time ago I had a tiny bit of php code that would display an image for a certain amount of days and then expire. You could put it on anything, like new links, and set it to expire after so many days just by changing a number in it. It was just one short line of code.
noooze
09-26-2003, 02:46 AM
see that wouldt be nice!
You dont remember where and when cleo ?
noooze
09-27-2003, 10:06 AM
Ok - Cleo seems not to remember where so did find that code so here a question to you very gifted programmers.
How do I put a new after a new submission?
Is there a way to add a little code that adds a "new" or a gif after a listing and then count like 4 days or 7 days and then remove it ?
My mind tells me that it couldt be done, but as i only remember very little of my programming skills, and I only learned java, I have NO idea how
please help me out here
cheers
noooze
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.