dopetalk

Technology => SMF Forum Code Modifications => Topic started by: Chip on July 16, 2016, 03:22:50 AM

Title: Join Reason
Post by: Chip on July 16, 2016, 03:22:50 AM
http://custom.simplemachines.org/mods/index.php?mod=2326

This mod adds a field on the registration page asking the visitor how he found the site. In addition, if all registrants must be approved by the site administrator, a section is added to the list of members awaiting approval with their join reason.

when the site gets too big, perhaps ?
Title: Re: Join Reason
Post by: Chip on August 09, 2016, 12:00:36 AM
This has been installed and is an optional field at this stage ... if we are constantly hit by spammers then we need to more to a manual approval system (one click away) to see if they have a valid reason.
Title: Re: Join Reason
Post by: Chip on January 24, 2018, 08:56:17 PM
marked for removal soon as it is replaced by native Admin > Core Features > Advanced Profile Fields > Custom Profile Fields.

conversion via:

Code: [Select]
#!/bin/bash

rm jrf

echo "use smf209; SELECT smf209_members.id_member, smf209_members.join_reason FROM smf209_members WHERE  smf209_members.join_reason !='';" | mysql -uroot -p**** > jrf

count=0
while read a b; do
        let count=count+1
        if [ $count -gt 1  ]; then
                echo "use smf209; REPLACE INTO smf209_themes(variable, value, id_member) VALUES  (SUBSTRING('cust_joinre', 1, 255), SUBSTRING('unset yet', 1, 65534), $a);" | mysql -uroot -p****
        fi
done < jrf

echo    "USE smf209; \
UPDATE  smf209_themes \
JOIN    smf209_members ON smf209_members.id_member=smf209_themes.id_member \
SET     smf209_themes.value = smf209_members.join_reason \
WHERE   smf209_themes.variable='cust_joinre' AND smf209_members.join_reason !='';" | mysql -uroot -p****

see www.simplemachines.org/community/index.php?topic=558527 (http://www.simplemachines.org/community/index.php?topic=558527) as it also mentions the info was derived from:

Code: [Select]
use smf209; select smf209_members.id_member, smf209_members.member_name, smf209_members.join_reason, smf209_themes.variable, smf209_themes.value FROM smf209_themes INNER JOIN smf209_members ON smf209_members.id_member=smf209_themes.id_member WHERE smf209_themes.variable='cust_joinre' AND smf209_members.join_reason !='';
which produces:

Code: [Select]
+-----------+-------------+-------------+-------------+-------------+
| id_member | member_name | join_reason | variable    | value       |
+-----------+-------------+-------------+-------------+-------------+
|      3113 | test        | MOD-REASON  | cust_joinre | SMF-REASON  |
|      3114 | test2       | MOD-REASON2 | cust_joinre | SMF-REASON2 |
+-----------+-------------+-------------+-------------+-------------+
Title: Re: Join Reason
Post by: Chip on January 25, 2018, 06:23:03 AM
mod removed.

additional (manual) edit for uninstall in Sources/Who.php:

replace:
Code: [Select]
                        Activity_Bar_Who(), $txt['jrcopy'],
with:
Code: [Select]
                        Activity_Bar_Who(),
DB now converted with the script i wrote above.

@Z and @dizzle can now click on any new or not very recent member's (Profile > Forum Profile) and can either question the member's intentions or even delete them.

Some say stupid shit like "I want to make drugs and sell them" etc. and i have no time for them.
Title: Re: Join Reason
Post by: Chip on July 13, 2021, 12:50:38 PM
A quick command to see everyone's join reasons:

Code: [Select]
echo "use smf209; select smf209_members.id_member, smf209_members.member_name, smf209_members.join_reason, smf209_themes.value FROM smf209_themes INNER JOIN smf209_members ON smf209_members.id_member=smf209_themes.id_member WHERE smf209_themes.variable='cust_joinre'\G;" | mysql | less
SimplePortal 2.3.6 © 2008-2014, SimplePortal