Is there a way to retrieve user avatar urls to a table? I am using mysql query type to get the data otherwise, and understand avatar locations are not stored in the database. But is there any way still to get these?
Thanks Aleksandar. My query though was to do it programmatically for a user based on their user id? Doing it manually for each user is not a feasible or sustainable alternative.
You can add a CONCAT function in the database, which would create a dynamic part of the URL, then add the filename to it.
However, you'd need to have the same URL in the CONCAT function, and to pull the filename from the database where it is stored.
Please explain to me where the avatar is located, where it is stored, and to which table you're trying to add it, and I'll take a look as soon as you provide me remote access in the other ticket.
Thanks Aleksander. I have provided the temporary credentials now. As for the location of the avatars, they are stored in the cloud storage in a given folder (avatars/userid/..) but the thing is that the file names within such folders are not stored anywhere in the database. As such, it is not possible to get those names with a simple db query and the file name needs to be fetched somehow from the folder itself, that's why I was wondering if you guys have solved this before.
Yes, they are being uploaded on the user's profile page, for example. There's an easy way to link into the folder where the avatars for a given user are. For example, for the user with id 3, this would be the path (not real, but this gives the idea that the until avatars/, it's a static string, followed by the user id and in the folder there's a bunch of images with random names) -
We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.
Aleksandar is on vacation and I will answer you.
Unfortunately with SQL query that Aleksandar explain you and CONCAT function you can create dynamic links for each user but for all or them you will pass only one avatar image because you don't have it in database so you need to hardcode it in queries.
If you have data in database you can use CONCAT function in MySQL. On this link you have example how to achieve this with query.
What you can also try is to filter that query with our filter wpdatatables_filter_mysql_query( $query, $tableId )
This filter is applied to the MySQL query before it is sent to MySQL server.
$query is the query text
$tableId is the table identifier from the MySQL table (wp_wpdatatables).
Hi,
Is there a way to retrieve user avatar urls to a table? I am using mysql query type to get the data otherwise, and understand avatar locations are not stored in the database. But is there any way still to get these?
Hello Ashish Jain.
I believe if you right-click on that avatar, you can download the URL to it, correct?
If that is true, you can add them in a string type column like this:
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Aleksandar. My query though was to do it programmatically for a user based on their user id? Doing it manually for each user is not a feasible or sustainable alternative.
Br
Ashish.
Hi again Ashish.
I don't know how you'd go about doing that.
You can add a CONCAT function in the database, which would create a dynamic part of the URL, then add the filename to it.
However, you'd need to have the same URL in the CONCAT function, and to pull the filename from the database where it is stored.
Please explain to me where the avatar is located, where it is stored, and to which table you're trying to add it, and I'll take a look as soon as you provide me remote access in the other ticket.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi,
Thanks Aleksander. I have provided the temporary credentials now. As for the location of the avatars, they are stored in the cloud storage in a given folder (avatars/userid/..) but the thing is that the file names within such folders are not stored anywhere in the database. As such, it is not possible to get those names with a simple db query and the file name needs to be fetched somehow from the folder itself, that's why I was wondering if you guys have solved this before.
Br
Ashish.
I see Ashish
Well, if there's anything to link to in that folder, then maybe we could pull it off.
However, I never did that, and at this point I'm only guessing. Are they being loaded on a user's page, or anything like that?
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks Aleksander.
Yes, they are being uploaded on the user's profile page, for example. There's an easy way to link into the folder where the avatars for a given user are. For example, for the user with id 3, this would be the path (not real, but this gives the idea that the until avatars/, it's a static string, followed by the user id and in the folder there's a bunch of images with random names) -
https://storage.cloud.google.com/stateless/avatars/3/random_image_title_xyz.jpg
There's a buddypress core function (get_avatar()) that gets this avatar generally, but this is not from a sql query.
Br
Ashish.
Hi Ashish,
Sorry for late response.
We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.
Aleksandar is on vacation and I will answer you.
Unfortunately with SQL query that Aleksandar explain you and CONCAT function you can create dynamic links for each user but for all or them you will pass only one avatar image because you don't have it in database so you need to hardcode it in queries.
If you have data in database you can use CONCAT function in MySQL. On this link you have example how to achieve this with query.
What you can also try is to filter that query with our filter wpdatatables_filter_mysql_query( $query, $tableId )
This filter is applied to the MySQL query before it is sent to MySQL server.
$query is the query text
$tableId is the table identifier from the MySQL table (wp_wpdatatables).
Best regards.
Kind Regards,
Isidora Markovic
wpDataTables: FAQ | Facebook | Twitter | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Amelia demo sites | Docs
You can try our wpDataTables add-ons before purchase on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables
Ok, thanks. Doesn't solve for the issue but I suppose there's no other way either.