Automatically set a custom field

Started by alianos, May 22, 2015, 09:30:14 AM

Previous topic - Next topic

alianos

Hello SMF Gurus!

I got a simple issue at hand. I have more less integrated SMF to my website. Now I want to pass some information from the main site to the forum, and make this information visible to the user's profile and posts. Custom fields seem to do that just fine, but I cannot find out how to set them automatically to the value of the main site (which is changing every so often by the way, because it is a counter).

Any pointers? Any better solutions?


Speaking of that, would be possible to be changing user groups based on that "counter"? (like for example you change groups with the number of posts).

Thanks in advance

margarett

Starting from the end:
Quote from: alianos on May 22, 2015, 09:30:14 AM
Speaking of that, would be possible to be changing user groups based on that "counter"? (like for example you change groups with the number of posts).
Not really, no... It is for sure possible but I would suggest that the coding involved is a *lot*

About changing custom profile fields, you just need to have your site to update the table smf_themes. I explained that in detail some time ago, let me see if I can find the topic ;)

edit: here it is
http://www.simplemachines.org/community/index.php?topic=518203.msg3666696#msg3666696
The example is to read the custom fields, you just need to adapt it to UPDATE/INSERT the table. You might want to check if the user->field combo already exists before writing it. If exists, UPDATE, if not, INSERT.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

alianos

Thank you for your reply.

I bumped on this information elsewhere before asking, but I don't have an 'smf_themes' table and I assumed that this method became outdated by now. I even found a thread (http://www.simplemachines.org/community/index.php?topic=496296.20) from someone looking for the table 2 years ago, and bumped that one as well.


Here are 2 screenshots from phpMyAdmin showing that there is no such table :/

alianos

Never mind, I found it!
Apparently the left column of phpMyAdmin has a limit to how many elements it displays. Thanks again.

Advertisement: