News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Invitation System

Started by -Rock Lee-, February 24, 2020, 05:42:35 PM

Previous topic - Next topic

Rickpwns

#20
Quote from: shadav on April 25, 2022, 01:46:56 PM
Quote from: Rickpwns on April 25, 2022, 01:42:38 PMIs there a way to make a translation for this mod? Would love to help the author and the community by adding a new language.
as with any mod or theme there should be language files
simply rename the files to your language and edit them accordingly

Yes, after posting I decided to look around how it worked and found the language files. I added a Dutch translation file in the language folder and changed a few lines in 'package-info.xml' so the new file is imported after installing it.
It's working for me now. If anyone wants to do the same they can find the Dutch translation files in the attachment of my post. Download the .zip file for the complete installation or just download the .xml and .php file if you want to customize and add it to your own.

shadav

Quote from: Rickpwns on April 25, 2022, 02:35:40 PM
Quote from: shadav on April 25, 2022, 01:46:56 PM
Quote from: Rickpwns on April 25, 2022, 01:42:38 PMIs there a way to make a translation for this mod? Would love to help the author and the community by adding a new language.
as with any mod or theme there should be language files
simply rename the files to your language and edit them accordingly

Yes, after posting I decided to look around how it worked and found the language files. I added a Dutch translation file in the language folder and changed a few lines in 'package-info.xml' so the new file is imported after installing it.
It's working for me now. If anyone wants to do the same they can find the Dutch translation files in the attachment of my post. Download the .zip file for the complete installation or just download the .xml and .php file if you want to customize and add it to your own.
sorry but per most licenses I removed the attachment of the mod from your post....
typically uploading/redistributing of mods is not allowed per their licenses, all though after reading what rock lee stated in his initial post I'm unsure if he doesn't mind since the license does state as long as redistributing it links back to this thread...
that said :) thank you for the translation and I'm sure it will be added shortly to the original mod file

Rickpwns

Quote from: shadav on April 25, 2022, 02:47:17 PM
Quote from: Rickpwns on April 25, 2022, 02:35:40 PM
Quote from: shadav on April 25, 2022, 01:46:56 PM
Quote from: Rickpwns on April 25, 2022, 01:42:38 PMIs there a way to make a translation for this mod? Would love to help the author and the community by adding a new language.
as with any mod or theme there should be language files
simply rename the files to your language and edit them accordingly

Yes, after posting I decided to look around how it worked and found the language files. I added a Dutch translation file in the language folder and changed a few lines in 'package-info.xml' so the new file is imported after installing it.
It's working for me now. If anyone wants to do the same they can find the Dutch translation files in the attachment of my post. Download the .zip file for the complete installation or just download the .xml and .php file if you want to customize and add it to your own.
sorry but per most licenses I removed the attachment of the mod from your post....
typically uploading/redistributing of mods is not allowed per their licenses, all though after reading what rock lee stated in his initial post I'm unsure if he doesn't mind since the license does state as long as redistributing it links back to this thread...
that said :) thank you for the translation and I'm sure it will be added shortly to the original mod file
Oops, I'm sorry :) I was unaware of the license.
Hopefuly the language files that remain will help the people who are in need of the translation!

-Rock Lee-

@Rickpwns thanks for the translation, I'll see if I have time in the week and upload the updated package.

@shadav I am a bit of a sharing policy so that some contribution does not die, it can be useful although I also understand the issue here in SMF licenses are a bit strict. Even I sometimes have doubts about how to apply it, I'm not so used to it using in the right way (I suppose in my country they are somewhat softer and that is why it is difficult for me, but you learn as you go ;D).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

-Rock Lee-

+Added dutch translations provided by @Rickpwns
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Ibues

Hello, @-Rock Lee-

I found a problem with the mod in SMF 2.1.2, you can read this here:

https://www.simplemachines.org/community/index.php?topic=583096.0

Thank you.

-Rock Lee-

+Profile view 2.1.x fix - Thank you @Ibues
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

eltee

#27
Hi, Thanks for this mod. I'd like to add a simple suggestion: allow passing the invite token in the registration url request, e.g., ?invite=xxxxxxxxxxxxxxxxxxxxxxxx and prefill the input. This way you can send the link to the user and spare them from having to cut and paste. I have an elderly user base and I need to make things as simple as possible.

In the meantime, could you point me to which file I should modify to do this myself. I know php but totally new to smf. Thanks

@-Rock Lee-

I'm getting this error whenever I try to click on Manage keys tab

Fatal error: Uncaught Error: Call to undefined function create_function() in [readcted]/smf/Sources/Invite.php:990 Stack trace: #0 [readcted]/smf/Sources/Invite.php(149): ManageKeys() #1 [readcted]/smf/Sources/Admin.php(499): invite_admin() #2 [readcted]/smf/index.php(191): AdminMain() #3 {main} thrown in [readcted]/smf/Sources/Invite.php on line 990

I'm using smf 2.1.2 php 8.1

-Rock Lee-

#28
I have to seesee if it can be applied it without so many problems, although it is not a bad idea to simplify the system a bit. Now regarding the error I did not test it with PHP 8.x but you may need to change the way you use the function because some things changed, I will take time this weekend to look at it and try solve it.


Regards!

Add: The file is in ../www/Sources/invite.php and it's not only line 990 but also line 336 because they both use the same variable.

Add 2: A quick search in the PHP manual is as I thought so, create_function is no longer used, at the moment I can only recommend using PHP 7.4 until I can figure it out.
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

eltee

Quote from: -Rock Lee- on September 20, 2022, 09:23:13 PMI have to seesee if it can be applied it without so many problems, although it is not a bad idea to simplify the system a bit. Now regarding the error I did not test it with PHP 8.x but you may need to change the way you use the function because some things changed, I will take time this weekend to look at it and try solve it.


Regards!

Add: The file is in ../www/Sources/invite.php and it's not only line 990 but also line 336 because they both use the same variable.

Add 2: A quick search in the hxxp:www.php.net/manual/en/function.create-function.php [nonactive] is as I thought so, create_function is no longer used, at the moment I can only recommend using PHP 7.4 until I can figure it out.

This seems to do the trick, but I don't know what I'm doing :)
                'data' => array(
                    'function' => function($rowData) {
                        global $txt;
                       
                        // Tell them the status of their page.
                        if ($rowData['active'])
                            return sprintf('<span style="color: green;">%1$s</span>', $txt['active']);
                        else
                            return sprintf('<span style="color: red;">%1$s</span>', $txt['nactive']);
                    },
                    'class' => 'windowbg',
                    'style' => 'text-align: center;',
                ),

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

-Rock Lee-

Quote from: eltee on September 21, 2022, 07:30:52 PMThis seems to do the trick, but I don't know what I'm doing :)
                'data' => array(
                    'function' => function($rowData) {
                        global $txt;
                       
                        // Tell them the status of their page.
                        if ($rowData['active'])
                            return sprintf('<span style="color: green;">%1$s</span>', $txt['active']);
                        else
                            return sprintf('<span style="color: red;">%1$s</span>', $txt['nactive']);
                    },
                    'class' => 'windowbg',
                    'style' => 'text-align: center;',
                ),

It's perfect I'll do some tests later but it's what must be changed, also until the weekend I can't update the package O:).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

eltee

this is really dumb but for the life of me I can't figure out how to send an invite, either from the front end or admin panel. I have "enable email invitation" checked. I am admin so should have permission. I've switched to php 7 in case that is an issue. what am I not seeing? thanks

-Rock Lee-

Quote from: eltee on September 22, 2022, 02:32:44 PMthis is really dumb but for the life of me I can't figure out how to send an invite, either from the front end or admin panel. I have "enable email invitation" checked. I am admin so should have permission. I've switched to php 7 in case that is an issue. what am I not seeing? thanks

Does the shipment appear in the mail queue? Doesn't it show you any error? You can enter "https://miwebsite/index.php?action=invite" ?


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

eltee

Quote from: -Rock Lee- on September 22, 2022, 11:30:45 PMDoes the shipment appear in the mail queue? Doesn't it show you any error? You can enter "https://miwebsite/index.php?action=invite" ?


Regards!

Ah, thank you. But where does that link appear? Because I do not see it anywhere on the web site or in the admin panel.

Btw, the invite email has the link as ?action=register when it should be ?action=signup  At least it is on my 2.1.2 install.

-Rock Lee-

Quote from: eltee on September 23, 2022, 12:12:16 AMAh, thank you. But where does that link appear? Because I do not see it anywhere on the web site or in the admin panel.

Btw, the invite email has the link as ?action=register when it should be ?action=signup  At least it is on my 2.1.2 install.

I'm sure I fixed this issue to add the menu where the keys are handled to the profile, I'm going to look at it, it may be that the hook does not load correctly.

The theme of the url as I have it for the 2.0.x and 2.1.x line was overlooked but that is edited in the same invite.php that I noted to change as well. Tomorrow I have my day off from work and I look at it more closely :).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

-Rock Lee-

+Compatibility with PHP 8.x - Thank you @eltee
+Fix of the URL sent by mail
+Minor code fixes
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

eltee

Quote from: -Rock Lee- on September 25, 2022, 01:49:05 PM+Compatibility with PHP 8.x - Thank you @eltee
+Fix of the URL sent by mail
+Minor code fixes

thank you. the invite menu and gift link shows up for me now.

-Rock Lee-

Perfect any problem please report it :) , I will also see if in a next version I add some more things but I do not promise anything.



Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Dave J

Hi Rock Lee,

Is there any way that this mod can work in conjunction with the SMF default registration process so that someone who has not got an invitation code can still register as a member please?

At the moment no one passing a site can sign up to the forum unless they have a code.

Regards

Dave
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Advertisement: