solved New Artist

Dazed
Dazed
@dazed
10 years ago
1,022 posts
On jr4 I used to have some code that would determine if an artist was less than or equal to 30 days from signup date. How would this look on JR5?
updated by @dazed: 09/25/14 05:37:35AM
paul
@paul
10 years ago
4,326 posts
The profile variable $_created is the time the profile was created. You can maybe use that in templates with the smarty {math} function to do things?


--
Paul Asher - JR Developer and System Import Specialist
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Thanks Paul - This does not seem to be working. Any ideas?

                        {math equation="x - (30 * 86400)" x=$smarty.now assign="dlimit"}
			{if $_created >= $dlimit}
			do something
			{/if}
Developer Networks
Developer Networks
@developer-networks
10 years ago
566 posts
               {$xxa = $smarty.now}
               {$xxb = $_user._created}

                 {$myTime = $xxa - $xxb}

                you signed up:   {$myTime|date_format:"%j"} days ago!
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Thanks B but not exactly what I am looking for. I need to identify artists that are less than or equal to 30 days old. If they are in that range, then I will do something. The below is working but pretty much everyone is showing in the range so apparently $item.user_created / $item.profile_created is not right. That or it does not like the row it is in with the loop!

                        {math equation="x - (30 * 86400)" x=$smarty.now assign="dlimit"}
			{if $item.user_created >= $dlimit}
			do this!!
			{/if}

                        {math equation="x - (30 * 86400)" x=$smarty.now assign="dlimit"}
			{if $item.profile_created >= $dlimit}

			{/if}

updated by @dazed: 08/17/14 06:20:19PM
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Try putting {debug} into your template to see which variables hold the user and/or profile created time.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
Developer Networks
Developer Networks
@developer-networks
10 years ago
566 posts
               {$xxa = $smarty.now}
               {$xxb = $_user._created}
               {$myTime = $xxa - $xxb}
                you signed up:   {$myTime|date_format:"%j"|round:"2"} days ago!
                {if $myTime|date_format:"%j" < '030'}
                 your a rookie!
                {elseif $myTime|date_format:"%j" > '030'}
                    your a veteran!
                {else}
                    Can not verify time!
                {/if}
signup.jpg
signup.jpg  •  37KB


updated by @developer-networks: 08/18/14 04:40:35AM
Developer Networks
Developer Networks
@developer-networks
10 years ago
566 posts
The above code will work if you want to show a user that is logged in he/she is a veteran on the profile menu lets say. However if your needing to populate a charts row with that data to a bunch of members you would have to spin off of what I have created by making a module that saves the membership days and then youll be able to call {$profile_memberdays} or something
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Hey Steve that is how I can up with the variables I was using but it is still not correct.

Thanks B. It is in a charts row.
douglas
@douglas
10 years ago
2,791 posts
Where are trying to add this?

I put a debug in the profile_header.tpl and neither the $item.user_created nor $item.profile_created are available.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 08/18/14 07:13:06AM
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Hey Douglas this is on the newest song row. It Is there now but not accurate hehe.
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Douglas were you able to take a look at this?
douglas
@douglas
10 years ago
2,791 posts
Is there a reason you need to use the math?

x - (30 * 86400)



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
10 years ago
1,022 posts
That was used in jr4. That established the 30 day age. 1 day equals 86400 seconds.
douglas
@douglas
10 years ago
2,791 posts
I'm not 100% sure, but it looks like profile_created and user_created are actually holding the value of when the profile or user was updated, and profile_updated and user_updated are holding the value of when the profile or user was created.... try using the updated variables and see if you get the results your looking for.

If so, we may need to get this fixed as I don't think that is suppose to be like that.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Dazed
Dazed
@dazed
10 years ago
1,022 posts
Thanks for confirming. I have seen odd results and it looks like you are seeing the same using those two variables.

Appreciate your help.
brian
@brian
10 years ago
10,148 posts
Is this in a template in a jrCore_list call?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
Yep - these are backwards for both profile_created / profile_updated and user_created / user_updated - I have that fixed for the next release.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
OK this is now fixed in the marketplace - let me know if you see any issues.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Dazed
Dazed
@dazed
10 years ago
1,022 posts
thanks for the quick fix!
brian
@brian
10 years ago
10,148 posts
No problem!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net