Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 9, 2014 6:53:41 GMT -8
Would it be possible to create a plugin to generate a random, unique, five-digit number for each created account? It doesn't need to bed editable by anyone, so long as the ID is generated.
Things I'd like:
- display ID for $[current_user] (globally) - display ID for $[user] (mini-profiles only) - be able to position the information at select locations in the template, for example using a span or div like: <div id="random_id_current"></div> and <div id="random_id"></div>
If anyone's familiar with pokemon, these are supposed to emulate the unique trainer IDs on the player's trainer card.
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 10, 2014 0:01:26 GMT -8
This is doable in a few lines of code. I could put it together for you, subject to a few caveats:
1. Inserting a user's display ID would be done using an empty <span displayid></span> tag, and would only be accessible within mini-profiles. The current user's display ID would be inserted using an empty <span mydisplayid></span> tag, and would be accessible anywhere.
2. You would have to let me know what the current user's display ID would show up as for guests.
3. You would have to let me know the specific format of the display ID. Do you mean a 5-digit number from 10000-99999 inclusive, a 5-digit number from 00001-99999 inclusive with leading zeroes, or an up-to-five-digit number such as 308, 4591, 90210?
If you get back to me on 2-3, I can complete the request for you in short order.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 10, 2014 0:54:21 GMT -8
thanks for the reply!on my kindle at the moment so please excuse any typos.
fine with caveat 1.
for the second, guests do not need an id. current user id would only show if user is a member. sorry, should have specified that.
five digit, 10000-99999 inclusive would be best.
as a side note will the id's stay consistent? as in, once you're assigned an id, that's your id forever?
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 10, 2014 11:34:22 GMT -8
OK. I'll make it so that the <span mydisplayid></span> will contain no text for guests.
As for the IDs staying consistent: yes, they will. Proboards automatically assigns a static user ID to every user on your board. The ID isn't random (IDs are assigned serially, starting at 1 for the superadmin), but can converted into unique random-looking numbers using an LCG or similar algorithm.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 10, 2014 11:40:09 GMT -8
That's absolutely perfect for me. Thank you so much. (:
|
|
inherit
168679
0
Nov 18, 2012 17:03:07 GMT -8
Virgil Sovereign
Latet anguis in herba.
686
July 2011
syonidv
|
Post by Virgil Sovereign on Feb 10, 2014 20:56:57 GMT -8
I've attached the plugin to this post. For mini-profiles, you can insert a member's display ID using <span class="displayid"></span>. You can insert the current member's display ID anywhere using <span class="mydisplayid"></span>. The plugin is editable. Feel free to move the code into other plugins to free up space, if needed. The display IDs are unique, random, and member-specific. Note that the IDs range from 10000 to 99986 inclusive. If you have more than 89986 users on your board, display IDs will no longer all be unique. Let me know if there are any problems. Attachments:Dig5.pbp (897 B)
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Feb 10, 2014 21:25:05 GMT -8
well Kami.. cross your fingers you stay under that 89986 member limit.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 11, 2014 1:13:21 GMT -8
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 11, 2014 11:44:15 GMT -8
Kami I was wondering if I could use this to do the SHIELD IDs? I know you're the one who requested the plugin originally hence wanting to ask
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 11, 2014 12:03:28 GMT -8
Kami I was wondering if I could use this to do the SHIELD IDs? I know you're the one who requested the plugin originally hence wanting to ask Go ahead I guess? I mean, a) I can't stop you and b) it'd be kind of mean for me to say no :X I'm not particularly thrilled about it tbh, you know how it is, wanting to have your forum really unique and all, but I won't make a fuss. (:
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 12, 2014 2:25:58 GMT -8
No no that's understandable - I'd not be doing it totally the same but as I say if you want to use it just on yours I'll respect that quite happily (That's why I asked)
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 12, 2014 6:45:59 GMT -8
I would prefer not so if you're okay with that that's fantastic! But like I said, I won't make a fuss either way (:
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Feb 12, 2014 6:57:24 GMT -8
I'm a fan of asking before taking in terms of things that could be a unique thing for one site so of course I'll be okay with you wanting to keep a feature unique for your site, I wish you luck with it
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Feb 12, 2014 7:08:31 GMT -8
Thanks! :> Best of luck with yours too!
|
|