Technology > SMF Forum Code Modifications

Join Reason

(1/1)

Chip:
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 ?

Chip:
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.

Chip:
marked for removal soon as it is replaced by native Admin > Core Features > Advanced Profile Fields > Custom Profile Fields.

conversion via:


--- Code: ---#!/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****
--- End code ---

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


--- Code: ---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 !='';
--- End code ---

which produces:


--- Code: ---+-----------+-------------+-------------+-------------+-------------+
| id_member | member_name | join_reason | variable    | value       |
+-----------+-------------+-------------+-------------+-------------+
|      3113 | test        | MOD-REASON  | cust_joinre | SMF-REASON  |
|      3114 | test2       | MOD-REASON2 | cust_joinre | SMF-REASON2 |
+-----------+-------------+-------------+-------------+-------------+
--- End code ---

Chip:
mod removed.

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

replace:

--- Code: ---                        Activity_Bar_Who(), $txt['jrcopy'],
--- End code ---

with:

--- Code: ---                        Activity_Bar_Who(),
--- End code ---

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.

Chip:
A quick command to see everyone's join reasons:


--- Code: ---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
--- End code ---

Navigation

[0] Message Index

It appears that you have not registered with dopetalk. To register, please click here...
Go to full version