Author Topic: How to remove E-mail field from register_Form??  (Read 11333 times)

0 Members and 1 Guest are viewing this topic.

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
How to remove E-mail field from register_Form??
« on: May 07, 2008, 02:53:05 PM »
Hi everybody,
i'm a new user of 4images, and i'm very happy to use this great script  :)
Everything is Ok, but i have a little probleme, My host doesn't allow Smtp server, so when, a member try to register, after registration, this error message appear

Warning: mail() [function.mail]: Safety Restriction in effect. The mail() command is not allowed, contact the admin. in /www/110mb.com/a/m/a/z/i/g/h/w/amazi******/htdocs/includes/email.php on line 171

So i want to disable this function, and remove the filed for email address in the Register_form file, i really need your help, and if you can please tell me, if there id another alternative way, to use a distant Smptserver witch may work with 4images...

Thanks in advance for your support
« Last Edit: May 10, 2008, 03:39:51 PM by blueangel »

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #1 on: May 07, 2008, 09:16:41 PM »
hi and welcome in forum,

look, on the best way.

contact admin of the host. if the PHP command mail() is not allowed.. maybe they can help you to use SMTP server.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #2 on: May 08, 2008, 01:03:28 AM »
Thanks Nicky for responding !!  :)

I really don't want to use any email address in registration form, i just want that members  enter A Username and a password...!! that's all ...
and as well I want to delete this error message, and i'm sure, i'll not use any emails ... maybe ..Temporarily, until i find a good hosting wibesite.
I just want my site to function normaly. Can you please tell me how can I disable completly this function ??!!!  :(

thanks again

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #3 on: May 09, 2008, 01:05:22 AM »
Nobody wants to to help !!!!!????????

I just have a question, and i need an answer from Admin !!

Why do we have the option to choose between enabling or disbling SMTP Server in the Admin Settings Area !!!!?????
If it works really, Automatically, when we disable it, ....email Field in the registration page, must disapear  !!!!!! isn't right !!!
I just want to remove this Sql error message !!

I really need your help !!! if it's not possible tell me that !!!! and if there is any solution, please share it with me !!!
I don't want to try another script, because I like 4images, but if this problem persists ... i'll not have the choice !!

Always expecting your answers

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #4 on: May 09, 2008, 12:36:08 PM »
dear blueangel,

Quote
I don't want to try another script, because I like 4images, but if this problem persists ... i'll not have the choice !!
There is no problem with 4images, your problem is your cheap host...
you should change host asap..
for nothing you will get nothing  :mrgreen:

you can use smtp from them or from your ISP...

anyway here a quick solution...

open register.php (v 1.7.6)

search this code
Code: [Select]
    if ($user_email != "") {
      if (check_email($user_email)) {
        $sql = "SELECT ".get_user_table_field("", "user_email")."
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_email")." = '".strtolower($user_email)."'";
        if ($site_db->not_empty($sql)) {
          $msg .= (($msg != "") ? "<br />" : "").$lang['email_exists'];
          $error = 1;
        }
      }
      else {
        $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
        $error = 1;
      }
    }
    else {
      $msg .= (($msg != "") ? "<br />" : "").$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['email']), $lang['field_required']);
      $error = 1;
    }

replace with
Code: [Select]
/*
    if ($user_email != "") {
      if (check_email($user_email)) {
        $sql = "SELECT ".get_user_table_field("", "user_email")."
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_email")." = '".strtolower($user_email)."'";
        if ($site_db->not_empty($sql)) {
          $msg .= (($msg != "") ? "<br />" : "").$lang['email_exists'];
          $error = 1;
        }
      }
      else {
        $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
        $error = 1;
      }
    }
    else {
      $msg .= (($msg != "") ? "<br />" : "").$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['email']), $lang['field_required']);
      $error = 1;
    }
*/


same file (register.php (v 1.7.6))

search for
Code: [Select]
    if ($result) {
      $activation_url = $script_url."/register.php?action=activate&activationkey=".$activationkey;

      include(ROOT_PATH.'includes/email.php');
      $site_email = new Email();
      $site_email->set_to($user_email);
      $site_email->set_subject($lang['register_success_emailsubject']);
      $site_email->register_vars(array(
        "activation_url" => $activation_url,
        "user_name" => $user_name,
        "user_password" => $user_password,
        "site_name" => $config['site_name']
      ));

      switch($config['account_activation']) {
      case 2:
        $email_template = "register_activation_admin";
        $msg = $lang['register_success_admin'];
        break;
      case 1:
        if ($config['language_dir_default'] != $config['language_dir']) {
          $activation_url .= "&l=".$config['language_dir'];
        }
        $email_template = "register_activation";
        $msg = $lang['register_success'];
        break;
      case 0:
      default:
        $email_template = "register_activation_none";
        $msg = $lang['register_success_none'];
        break;
      }

      $site_email->set_body($email_template, $config['language_dir']);
      $site_email->send_email();
      if ($config['account_activation'] == 2) {
        $site_email->reset();
        $site_email->set_to($config['site_email']);
        $site_email->set_subject($lang['admin_activation_emailsubject']);
        $user_details_url = $script_url."/admin/index.php?goto=".urlencode("users.php?action=edituser&user_id=".$user_id."&activation=1");
        $site_email->register_vars("user_details_url", $user_details_url);
        $site_email->set_body("admin_activation", $config['language_dir_default']);
        $site_email->send_email();
      }
    }
    else {
      $msg = $lang['general_error'];
    }

replace with
Code: [Select]
/*
    if ($result) {
      $activation_url = $script_url."/register.php?action=activate&activationkey=".$activationkey;

      include(ROOT_PATH.'includes/email.php');
      $site_email = new Email();
      $site_email->set_to($user_email);
      $site_email->set_subject($lang['register_success_emailsubject']);
      $site_email->register_vars(array(
        "activation_url" => $activation_url,
        "user_name" => $user_name,
        "user_password" => $user_password,
        "site_name" => $config['site_name']
      ));

      switch($config['account_activation']) {
      case 2:
        $email_template = "register_activation_admin";
        $msg = $lang['register_success_admin'];
        break;
      case 1:
        if ($config['language_dir_default'] != $config['language_dir']) {
          $activation_url .= "&l=".$config['language_dir'];
        }
        $email_template = "register_activation";
        $msg = $lang['register_success'];
        break;
      case 0:
      default:
        $email_template = "register_activation_none";
        $msg = $lang['register_success_none'];
        break;
      }

      $site_email->set_body($email_template, $config['language_dir']);
      $site_email->send_email();
      if ($config['account_activation'] == 2) {
        $site_email->reset();
        $site_email->set_to($config['site_email']);
        $site_email->set_subject($lang['admin_activation_emailsubject']);
        $user_details_url = $script_url."/admin/index.php?goto=".urlencode("users.php?action=edituser&user_id=".$user_id."&activation=1");
        $site_email->register_vars("user_details_url", $user_details_url);
        $site_email->set_body("admin_activation", $config['language_dir_default']);
        $site_email->send_email();
      }
    }
    else {
      $msg = $lang['general_error'];
    }
*/
        $msg = $lang['register_success_none'];





delete this in template register_form.html
Code: [Select]
          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1">
              <input type="text" name="user_email" size="30" class="input" value="{user_email}" />
            </td>
          </tr>


delete this in template member_editprofile.html
Code: [Select]
          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1"><input type="text" name="user_email"  size="30" value="{user_email}" class="input" /></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_email_confirm}</b></td>
            <td class="row2"><input type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_show_email}</b></td>
            <td class="row1">
              <input type="radio" name="user_showemail" value="1"{user_showemail_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_showemail" value="0"{user_showemail_no} />
              {lang_no}</td>
          </tr>
  <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}
</td>
          </tr>

delete this in template member_profile.html
Code: [Select]
        <tr>
          <td class="row2"><b>{lang_email}</b></td>
          <td class="row2">{if user_email}<a href="{user_mailform_link}">{user_email_save}</a>{endif user_email}</td>
        </tr>

delete this in template user_loginform.html
Code: [Select]
      &raquo; <a href="{url_lost_password}">{lang_lost_password}</a><br />



in 4images Admin CP

Set > Session and User Settings > Account activation to None

then set Permissions for ALL Categories Send eCard to Administrator

i think that should be all....

&
there is no support for this code (i tested it quick.. it's work)....  :P

kind regards & have a nice day.

btw.: that was not a SQL error.... it was PHP error that command mail() is disabled on host 110mb  8)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #5 on: May 09, 2008, 04:24:46 PM »
Hi Nicky, you're the BEST  :P

It WORKS  very Well :P   :D

Thank you man for your help... You're right, i have to change my host, or to upgrade to a paid plan, but the problem is that i still have some bugs with it !! sometimes, it doesn't work at all (My Host) ... And since I'm Newbie  :D I take this opportuinity, to learn more about this great script, and how it works  :)
Your forum helped me, to learn and understand a lot of things about Php and programming in general ...

I thank you infintly for your assistance  :)


« Last Edit: May 09, 2008, 04:46:39 PM by blueangel »

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #6 on: May 09, 2008, 04:42:26 PM »
hi,

are you sure that you did it all?

did you included */ and /* in register.php at both replacement like in my post?
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #7 on: May 09, 2008, 04:50:49 PM »
Thanks, Now it works, i did all the steps one more time, and everything is alright  :P

Yeah, i removed /* and */  lol  :P  :oops:
i'm a Nooob  :lol:

Thanks a lot Nicky  :)



Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #8 on: May 09, 2008, 05:26:39 PM »
 :mrgreen: :mrgreen:

i didn't say that..

have phun with 4images
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #9 on: May 10, 2008, 03:00:34 AM »
Hi nicky, it' me again  :D

Everything works great, but  :oops:  i have a small problem
Users can create accounts and upload files, fine ...but I can't controle that, the files they upload appear directly in the main page and are validated automatically !!!!!

I usualy upload Pics by FTP, and i want users to upload their fotos too via  website but, i want them to be approved by the administrators  !!

I tried to disable The upload option in Settings Area,  and i limited the permission of upload to Admins, but it doesn't work too !!  :( the option, Upload image appear for all users !! i want to bring it back, but i don't know how !!!

What do you suggest please?
Thanks again

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #10 on: May 10, 2008, 08:21:42 AM »
Hi,

set Permissions for ALL Categories Direct Upload to Administrator

but E-Mail notification to Administrator will fail  :wink:

let me see your site
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline blueangel

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #11 on: May 10, 2008, 12:58:01 PM »
Hiiii,
I resolved the problem thanks to you, everything works great now  :P

Here is my site:  www. amazigh life .co.nr without spaces

Thanks again and have a nice day  :)


« Last Edit: May 11, 2008, 12:08:28 AM by blueangel »

Offline barkuras

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: How to remove E-mail field from register_Form??
« Reply #12 on: December 22, 2008, 07:35:42 PM »
Just wanted to say THANK YOU Nicky, this helped me a lot!