Denote New Item (Red Circle) Tutorial

Got an idea for a tutorial ? Share it here.
Post Reply
wale89
Posts: 8
Joined: Wed May 23, 2012 4:43 pm

Denote New Item (Red Circle) Tutorial

Post by wale89 »

Hi Jacek,

Really thank full for yr all effort on making these good tutorial so far. It's helps me a lot.. :D
But if possible, i really need your help on making tutorial for "denotes new item" things. The idea is like whenever there is something new (update) , the system will notify the users by denoting some red circle color besides the new things.

I give you the real situation.
For example, I have this upload & download function. Supervisor can upload doc and student can download it..and vice versa. So, this denotes new item will actually help the student/supervisor to see whether there is any new document has been uploaded or not.

I have google this kind of tutorial, but there is none. So, I really appreciate if you could make one as you are all expert in this lang.

Thanks so much.. :)
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Denote New Item (Red Circle) Tutorial

Post by Temor »

He's already done this as a part of the private message system tutorials.
What you need to do is set a value in your database to signify that there is a new upload available. Lets say a 1 is equal to new and a 0 is equal to old. Whenever the user downloads the new file, set the value back to 0.

After that it's as easy as one if statement.
[syntax=php]<?php

if($new_download == 1){
echo " New Download Available ";
}

?>[/syntax]
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Denote New Item (Red Circle) Tutorial

Post by jacek »

I think I actually based it on some timestamps but the principle is the same :)
Image
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Denote New Item (Red Circle) Tutorial

Post by Temor »

jacek wrote:I think I actually based it on some timestamps but the principle is the same :)

Oh, right. Totally forgot :)
Post Reply