Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Peludo_08 on February 20, 2009, 09:22:37 AM

Title: Location on reg
Post by: Peludo_08 on February 20, 2009, 09:22:37 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1651)

English:

Well, this modification does the following: Adds a field in the section of the register for writing our location, which will then appear in our profiles


-----------------------------------


Español
Bueno, esta modificacion hace lo siguiente:

Agrega un campo en la seccion del registro para escrivir nuestra ubicacion, que luego aparecera en nuestros perfiles



Compatible with:
Version: SMF 1.1.8
Language: English, Spanish
Author: Peludo_08 (http://www.simplemachines.org/community/index.php?action=profile;u=145900)
Website: http://descargawarez.net (http://descargawarez.net)
Demo: Click Here (http://descargawarez.net/index.php?action=register)





Make a paypal donation:
(https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif) (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1458796)
Title: Re: Location on reg
Post by: Marcus Forsberg on February 22, 2009, 02:40:40 PM
Nice :P

Swedish translation:

$txt['locationmod'] = 'Vänligen ange stad/land';
Title: Re: Location on reg
Post by: Peludo_08 on February 23, 2009, 05:34:21 PM
Quote from: Nas on February 22, 2009, 02:40:40 PM
Nice :P

Swedish translation:

$txt['locationmod'] = 'Vänligen ange stad/land';

thanks mate :P
Title: Re: Location on reg
Post by: Blinker on August 04, 2009, 02:40:34 AM
Hey Peludo

Thanks for this mod, it was just what I needed.

Works on 1.1.10 with an edited package-info.xml file.
Title: Re: Location on reg
Post by: Goad on February 03, 2010, 11:17:32 AM
what needs to be added/changed in order to make this a REQUIRED field in order to register?
Title: Re: Location on reg
Post by: Joker™ on February 03, 2010, 12:55:18 PM
codes removed  ;)
Title: Re: Location on reg
Post by: Matthew K. on February 03, 2010, 01:00:32 PM
@sid, as this mod is not compatible with SMF 2.0, this is not the mod authors issue, and it's not something he is obligated to help you with.
Title: Re: Location on reg
Post by: Joker™ on February 03, 2010, 01:04:36 PM
but it a very small error .... also i posted here that if error gets solved others can use it

can u help me out to resolve the error ?
Title: Re: Location on reg
Post by: Matthew K. on February 03, 2010, 01:06:28 PM
Very small error or not, it's not covered by this mod, so it's not the mod authors issue.

As it's nice to help other people out by posting code, this is the mod authors mod, and it is sometimes not appreciated to give updates, especially from 1.1 to 2.0 as there are many changes.

Labradoodle-360
Title: Re: Location on reg
Post by: Joker™ on February 03, 2010, 01:12:02 PM
ohhh ok..... if u like i can remove my post ..

thanx for ur direction :D
Title: Re: Location on reg
Post by: Matthew K. on February 03, 2010, 01:20:00 PM
I cannot remove posts, I am just a Support Helper.

I'm not saying the mod author won't help you, but it's not their obligation as this mod is technically not compatible with SMF 2.0.
(And it may not ever be, as in SMF 2.0 RC2 you can add your own fields through the Admin panel)

Labradoodle-360
Title: Re: Location on reg
Post by: Joker™ on February 03, 2010, 01:39:57 PM
no problem mate ...

i solved it myself ;)

if im allowed can i make edit on above posted codes ??
Title: Re: Location on reg
Post by: Goad on February 04, 2010, 02:27:31 PM
glad you guys figured that out.....any chance helping me with my question?

i want to make this field required upon registration. thanks!
Title: Re: Location on reg
Post by: Joker™ on February 04, 2010, 02:50:28 PM
u mean a compulsory field ? n for which version ?
Title: Re: Location on reg
Post by: Goad on February 04, 2010, 03:02:17 PM
i guess if thats what you call it. this is for smf 1.1.11
Title: Re: Location on reg
Post by: Joker™ on February 04, 2010, 04:24:27 PM
Here u go bro ;)

in Source/Register.php

Find:
  // You can't register if it's disabled.
   if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3)
      fatal_lang_error('registration_disabled', false);


Add After
// You can't register without a location...
   if (empty($_POST['locationmod']) || trim($_POST['locationmod']) == '')
      fatal_error('Please Fill Your location.', false);
Title: Re: Location on reg
Post by: Goad on February 10, 2010, 01:51:47 PM
I tried the code above, but even if you fill in the location field on the registration page, it still nags you to fill it in.

in the /themes/default/register.template.php file, i have the following code:


//Show location on reg - Muestra la ubicacion en el reg xD

echo '
<td width="40%">
<b>', $txt[227], ': </b>
<div class="smalltext">',$txt['locationmod'], '</div>
<td><input type="text" name="location" size="30" value="', !empty($context['member']['location']) ? $context['member']['location'] : '', '" /></td>
</tr>';


in the Sources/Register.php file, i have the following code:


// You can't register without a location...
    if (empty($_POST['locationmod']) || trim($_POST['locationmod']) == '')
      fatal_error('Please fill in your location...', false);
Title: Re: Location on reg
Post by: Joker™ on February 11, 2010, 03:04:34 AM
My mistake ...

Use this code instead of previous one at same place

  // You can't register without a location...
      if (empty($_POST['location']))
         fatal_error('Please fill in your location...', false);


this worked for me on RC2 .... lets see how it goes for u
Title: Re: Location on reg
Post by: ABCDiamond on March 01, 2010, 06:30:23 AM
I tried to load this on SMF v1.1.11 but get this message:
QuoteInstallations actions for "LocationOnReg":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

I then looked at the manual code, for v 1.1.11 and got:
QuoteSorry, but this modification does not appear to be compatible with the selected version.

Am I right in saying that this will not work with my version ?
Although Goad seems to have it running with 1.1.11 ?

Any other options for me to make having the location set at time of registration.

Thanks
Title: Re: Location on reg
Post by: asma on March 21, 2010, 07:30:05 PM
same problem... this mod is not compatible with SMF 1.1.11
Title: Re: Location on reg
Post by: aw06 on February 15, 2011, 03:34:17 PM
How can i force the location on registration .. ?? If it's left blank the registration still goes through