JustHatched Posted June 4, 2018 Posted June 4, 2018 I am interested, question though, can selected profile fields be shown on the hovercard with this? If so or if you add that ability I will happily replace what I have with this
All Astronauts Posted June 4, 2018 Author Posted June 4, 2018 What fields would you want? Understand this can get messy really really fast. With customs I can craft things as needed to the site needed. To allow all of this, and I can (with some exceptions) I'd probably have to just "make it available" in the template and then: 1) Site admins would need to edit the template for their theme(s) to display it how they wanted to - that's without help from me - you'd need to know what you are doing - similar to the Pages Categories Images mod I have where the information is available in the templates but you have to choose (and work) how to display them. 2) If I ever structurally change the template for this in a future release, everyone would need to, like updating themes between Invision Community releases, update their custom AMH template. The profile stuff is wide open - just about any field type is allowed there. It's basically Pages-lite. Right now on the default IC hovercard there is *zero* profile information brought through.
JustHatched Posted June 4, 2018 Posted June 4, 2018 53 minutes ago, All Astronauts said: What fields would you want? Understand this can get messy really really fast. With customs I can craft things as needed to the site needed. To allow all of this, and I can (with some exceptions) I'd probably have to just "make it available" in the template and then: 1) Site admins would need to edit the template for their theme(s) to display it how they wanted to - that's without help from me - you'd need to know what you are doing - similar to the Pages Categories Images mod I have where the information is available in the templates but you have to choose (and work) how to display them. 2) If I ever structurally change the template for this in a future release, everyone would need to, like updating themes between Invision Community releases, update their custom AMH template. The profile stuff is wide open - just about any field type is allowed there. It's basically Pages-lite. Right now on the default IC hovercard there is *zero* profile information brought through. Example, mine is a gamong site, we require everyone to either put their Xbox or psn id in their profile (like the location profile field) and those are displayed on the hover card. It is admin selectable which fields are shown on the card
All Astronauts Posted June 4, 2018 Author Posted June 4, 2018 Do you mean your profile pages? Otherwise you already must have a custom thing going on for those to display on the hovercards. That or you are running 3x and not 4x.
All Astronauts Posted June 5, 2018 Author Posted June 5, 2018 Gave this some thought overnight. I can pull those and make them available (within reason) and then have a blank template be toggled on/off for you to use to do what you want with those vars available there. Will be bumping this to $15 / $6 when I'm done ? Don't forget! If your users have animated coverphotos... well... ? BomAle and Tripp★ 1 1
All Astronauts Posted June 6, 2018 Author Posted June 6, 2018 95% done, just need to sleep on it and poke it in the morning with a clear head. As stated, there are limits to what I can do for people here - you'll have to manage the looks yourselves. The template I'll give you to play with with have a foreach loop on the profile fields you have selected in settings to push through here, and it displays them as field name: value, taking any formatting you've done on the fields when you set them up. That means if you ahve this stuff formatted one way for viewing on your profile pages you may need to mess with this a little on this end of things. Like I said, gonna sleep on this and see if I need to do anything else to maybe make it easier for you guys. You will be able to toggle the yearbook quote and the rep badge stuff on/off now though yearbook quote will always have that principal placement underneath the username group name bit when enabled, and also, the rep badge will have the last position - any other profile fields you enable will be placed between the two.
All Astronauts Posted June 7, 2018 Author Posted June 7, 2018 Those two (three?) who have this now - is the quote adoption already high? I ask as since I'm pulling the profile data I went ahead and set up the quote stuff in it's own db table and not on the members table. Wondering if I can get you guys to just uninstall the old version and install the new one - just means people have to enter their quotes again. It's that or I have to spend time writing a converter to move the data between tables.
AlexWright Posted June 7, 2018 Posted June 7, 2018 So far I think I'm the only one on our board that uses it. I don't mind a reinstall, @All Astronauts
Tripp★ Posted June 7, 2018 Posted June 7, 2018 4 hours ago, All Astronauts said: Is the quote adoption already high? No, most people on my site haven't set it up, probably because they use mobiles and don't see the hovercards thus they don't know that it's there.
All Astronauts Posted June 7, 2018 Author Posted June 7, 2018 (edited) I'm thinking some time tonight. Bread about to be baked, shopping to be done, and Stanley Cup tonight... So, after that? I have added a setting to toggle on/off click card functionality. This will be up to you guys whether you want this on or off or not - depends on how mobile/tablet heavy you guys are - but the option ended up being trivial to include. EDIT: Caps won! So, tomorrow ? Edited June 8, 2018 by All Astronauts
All Astronauts Posted June 8, 2018 Author Posted June 8, 2018 (edited) AMH Profile Template 101 1) You can break the template if you don't know what you are doing! 2) I can help on occasion but I'm not here to hold your hand! amhProfileFields.phtml is the template that contains any profile fields variables you select in settings to push on through to the AMH card. By default it looks like this. <div id="amh-profile-data"> {{foreach $profiledata as $fieldname=>$fieldvalue}} <span class="amh-profilefield-name">{lang="$fieldname"}</span>: <span class="amh-profilefield-value">{$fieldvalue}</span><br> {{endforeach}} </div> The template has passed to it an array of the profile field data ($profiledata) you selected to push through. It than says "for each of the things in the array, lets do something with them AND let's go through them as the array key being $fieldname and the value of that bit $fieldvalue". Conveniently, the array keys are set up to be the actual profile name language bits. That means in this foreach loop all I have to do is {lang="$fieldname"} and the name of the field is outputted (for the user's language as well as this language template helper just ends up calling the member's chosen language)! To output the actual value of the profile field IN THIS FOREACH LOOP you just insert the variable as you would with standard template syntax i.e. {$fieldvalue}. The fieldvalue is either going to be whatever it is (and it will be escaped by default) OR whatever formatting and structure you have already applied when setting up the profile field. Whatever you have done there is what gets pushed through. If you have done nothing, it just comes out as is (but escaped by default as far as I can tell). Since this is a foreach loop you don't have to worry about missing bits and pieces - it is a "safe" template construct in that it just works with whatever happens to be in there. There are some spans there with classes for you to target and format as you like. As you muck about, you can always get back to normal by overwriting your broken template with the above to get back to stock and start mucking all over again. Now, some of you want to do wondrous things. Great! But you best know what you are doing. Naturally that means wiping out the foreach structure and doing whatever you want. Note with the foreach removed we no longer are talking about $fieldname and $fieldvalue - those aren't going to be what we are working with anymore - now it is the $profiledata array directly. The two things you need to be aware of are how to get the specific array bits by themselves and to protect yourself against non-existent array keys. The actual array structure of $profiledata is this: $profiledata['core_pfield_4'] => "Whatever the value of the profile field is here", $profiledata['core_pfield_2'] => "Whatever the value of this profile field is here", etc... So, you can remove the foreach loop and just do these two things: {lang="core_pfield_4"} - this outputs the name of the field (if you want or need it). Naturally the number on the end of core_pfield_ will change based on the profile field. I list these out for you in settings to help but you can also look them up in the database directly if you like. {$profiledata['core_pfield_4']} - This outputs the value of the profile field. That's it! If this is too confusing for you study up on IPS template syntax or find someone (not me...) to help you out. However, you MUST PROTECT YOURSELF when you call these directly. What do you think happens if you customize the template to output {$profiledata['core_pfield_4']} and you (or someone else) decides to remove that profile field from being output to the AMH hovercard? The template will look for a variable that is not there and will just hang, probably with a spinner, and no errors thrown. This is stuff YOU need to account for! Do this! {{if array_key_exists('core_pfield_2', $profiledata)}} {$profiledata['core_pfield_2']} {{endif}} And be careful when you start copy/pasting things or changing the field number up on the fly in the template that you don't do something like this: {{if array_key_exists('core_pfield_2', $profiledata)}} {$profiledata['core_pfield_4']} {{endif}} Make sure those numbers match - checking for the existence of one thing but then trying to display another leads to madness and broken templates. Once you are protected as above that's it! Go crazy! Add your classes and divs and what have you and do whatcha like! Edited June 8, 2018 by All Astronauts
Tripp★ Posted June 8, 2018 Posted June 8, 2018 (edited) @All Astronauts: Just found a bug with the latest update, if you go to update your yearbook quote; it'll show the error that it couldn't locate what you are trying to view and the url looks something like this: https://domain.tld/profile/0-%7B%3F%7D/ (which would be 0-{?}) Sorry, there is a problem We could not locate the item you are trying to view. Error code: 2C138/1 It still saves it, though. But this is reproducible. Edited June 8, 2018 by Tripp★
All Astronauts Posted June 8, 2018 Author Posted June 8, 2018 (edited) It's just the redirect I put in - before, when you saved, the page didn't reload so the displayed quote stayed the same until you refreshed. Prob just passing the wrong thing to the redirect method - two shakes, have this patched. EDIT: Done - dl again, etc... Edited June 8, 2018 by All Astronauts Tripp★ 1
Tripp★ Posted June 8, 2018 Posted June 8, 2018 That fixed it. Cheers man, I deeply appreciate the very quick fix. ?
AlexWright Posted June 9, 2018 Posted June 9, 2018 (edited) 19 hours ago, All Astronauts said: It's just the redirect I put in - before, when you saved, the page didn't reload so the displayed quote stayed the same until you refreshed. Prob just passing the wrong thing to the redirect method - two shakes, have this patched. EDIT: Done - dl again, etc... I just redownloaded this, and uninstalled and then reinstalled. Getting the same issue, but only for folks who haven't set the quote before it seems. Edited June 9, 2018 by AlexWright
All Astronauts Posted June 9, 2018 Author Posted June 9, 2018 Sorry bout that, grab it again now. If it still happens for new quote makers I'll need to investigate further but it appears I just derped this momentarily (should have just used the request id in the first place)
AlexWright Posted June 9, 2018 Posted June 9, 2018 Just now, All Astronauts said: Sorry bout that, grab it again now. If it still happens for new quote makers I'll need to investigate further but it appears I just derped this momentarily (should have just used the request id in the first place) Alright. Can this "new" version be uploaded as an update, or should I uninstall and reinstall again? Thanks!
All Astronauts Posted June 9, 2018 Author Posted June 9, 2018 Update is fine. 1 just needed to be uninstalled to remove the col from the member table.
AlexWright Posted June 9, 2018 Posted June 9, 2018 Just now, All Astronauts said: Update is fine. 1 just needed to be uninstalled to remove the col from the member table. Got it! And tested, works fine. Thanks again! All Astronauts 1
Kenneth Baker Posted September 1, 2018 Posted September 1, 2018 (edited) Hello thanks for a kewl plugin Where exactly is this Yearbook Quote block? i have it enabled but i dont see it anywhere in the profile settings also in the plugin settings, is this section supposed to look this way? i cant do anything in it Edited September 1, 2018 by Kenneth Baker
All Astronauts Posted September 1, 2018 Author Posted September 1, 2018 (edited) Yearbook quote block is on the members profile page, left side bar, near the bottom of the column. That fields to be outputted block should be pulling in any profile fields you have available. I just did a 3.4.6 to 4.3.whatever upgrade and installed this right afterward and all the old and new profiles fields were there for use. So, guessing you don't have any which would be odd but would explain the empty block, or there is something else is going on. You can pm me acp access and I'll take a look if you like. Edited September 1, 2018 by All Astronauts
All Astronauts Posted December 1, 2018 Author Posted December 1, 2018 Version 3 released! I'll have some better spacing and options (on/off) for the new stuff in V4. Maybe some other stuff as well. For now, V3 just adds content count to the lower left corner and moves reputation (if enabled) to the lower right corner.
All Astronauts Posted December 2, 2018 Author Posted December 2, 2018 Version 3.1 released! Bug fix for settings.
Recommended Posts