Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TIMT

Pages: 1 ... 25 26 27 28 [29] 30 31
421
Hi V@no

Why is it a sercurity risk to use HTML code in the description of pictures? Is it possible to user HTML code in the upload form?

In one category I show the product which are for sell. The description of the product is entered in the descirption picture. One of the product is a postcard, which shows one of a picture, made by the customer. That's, why I'd like to show the link for uploading pictures, but only for logged in users. A logged in user can upload a picture an buy postcards with this picture on it.

So I'd like to use HTML code only for my "pictures" or let's say for my "products" I wanna sell. Users, which can upload pictures don't have to use HTML code.

Do I have to  replace something in the code? Instead of interpreting the code, it shows me the code, unless the first line.


The following is displayed on the details:
global $user_info;
if ($user_info['user_level'] > GUEST)
{
?>

  Upload Foto (Sie können das Foto auch nach der Bestellung hochladen.)

}
?>

Thanks
Serge

PS:
Code: [Select]
define('EXEC_PHP_CODE', 1);should be ok, shouldn't it?

422
Hi everybody

Customers can order postcards with their own picture on the front. The customers are member of a usergroup "customer".
This usergroup should be able to upload pictures in only one special category, but without seeing this category.
See category: No
See details: No
Upload: Yes

On the other hand, the customer should see all other categories, but not be allowed to upload pictures in this categories.
See category: Yes
See details: Yes
Upload: No

So the customer should only see the special category in the dropdownlist "category" on the upload form. The category, which he can not see, but which he has access for uploading the picture.

Unfortunately there are all categories displayed, for which the customer has the permission to see the categories but not the permission for uploading and can not see the category for which he has the permission for uploading. It should only displayed the category, for which he has the permission of uploading pictures.

I hope I have explained the problem clearly enough. Otherwise... ask me.

Thank you for helping me.

Serge

423
Tutorials / Re: [Tutorial] Making additional field searchable
« on: March 28, 2005, 10:30:17 PM »
that's fine! Do I have to change the field in the database, table 4images_wordmatch ?
is the rest of the instruction regarding the turorial ok?

unfortunately the serach doesn't work. is it possible to enter "user_vorname" and "user_name2" for a single search (e.g. a serach after "Tom Till")

here is the code of my search_form.html

Code: [Select]
<form method="post" action="{url_search}">
  <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td class="head1">
        <table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td colspan="2" valign="top" class="head1">{lang_search}</td>
          </tr>
         
          <tr>
                  <td valign="top" class="row2"><b>Vorname</b></td>
                  <td class="row2" valign="top">
                  <input class="logininput" type="text" name="user_vorname" value="" /> </td>
                </tr>
                <tr>   
                  <td valign="top" class="row2"><b>Nachname</b></td>
                  <td class="row2" valign="top">
                  <input class="logininput" type="text" name="user_name2" value="" /> </td> 
                </tr>
         
         
          <tr>
            <td valign="top" class="row1"><b>{lang_search_by_keyword}</b></td>
            <td class="row1" valign="top">
              <input type="text" name="search_keywords" size="40" value="{search_keywords}" class="input" />
              <br />
              <input type="checkbox" name="search_new_images" value="1" />
              {lang_new_images_only}</td>
          </tr>
  <tr>
            <td valign="top" class="row2"><b>{lang_search_by_username}</b></td>
            <td class="row2" valign="top">
              <input type="text" name="search_user" size="40" value="{search_user}" class="input" />
            </td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_search_terms}</b></td>
            <td class="row1">
              <input type="radio" name="search_terms" value="all" checked="checked" />
              {lang_and}&nbsp;&nbsp;
              <input type="radio" name="search_terms" value="any" />
              {lang_or}
            </td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_category}</b></td>
            <td class="row2">{category_dropdown}</td>
          </tr>
          <tr>
            <td valign="top" class="row1"><b>{lang_search_fields}</b></td>
            <td class="row1">
              <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="all" checked="checked" /> {lang_all_fields}</td>
                  <td nowrap="nowrap">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="image_name" /> {lang_name_only}</td>
                </tr>
                <tr>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="image_description" /> {lang_description_only}</td>
                  <td nowrap="nowrap">&nbsp;</td>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="image_keywords" /> {lang_keywords_only}</td>
              </table>
            </td>
          </tr>
          <tr>
            <td class="row1">&nbsp;</td>
            <td class="row1"><input type="submit" value="{lang_search}" class="button" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>

424
Tutorials / Re: [Tutorial] Making additional field searchable
« on: March 28, 2005, 09:29:51 PM »
I'd like to offer the possibility to search for "user_name2" and "user_vorname" (first name).

I have entered in db_field_definitions the following code:
Code: [Select]
$additional_user_fields['user_vorname'] = array($lang['user_vorname'], "text", 1);
$additional_user_fields['user_name2'] = array($lang['user_name2'], "text", 1);

In the profile I can enter the first- and last name. The information is stored correctly in the database. That is not the problem.

But now I want to search after "user_name2" and "user_vorname". And that doesn't work.

I entered the code in search_form.html as it is mentioned in the tutorial.

So I'm a little bit confused about your proposal. What should I do?

Sorry, I have no idea about PHP....

Thank you for helping me.

Serge

425
Tutorials / Re: [Tutorial] Making additional field searchable
« on: March 28, 2005, 09:54:41 AM »
I don't know why... but it doesn't work..   :(

I have implemented two additionales files: user_vorname and user_name2.

I have entered the two fields name2_match and vorname_match in the table 4images_wordmatch in my database

In search_utils.php I have entered the following code:
Code: [Select]
$search_match_fields = array(
  "image_name" => "name_match",
  "image_description" => "desc_match",
  "image_keywords" => "keys_match",
  "user_vorname" => "vorname_match",
  "user_name2" => "name2_match"

In main.php I have entered the following code:
Code: [Select]
$lang['user_name2_only'] = "Nur Name";
$lang['user_vorname_only'] = "Nur Vorname";

In search_form.html I have entered the following code:
Code: [Select]
<tr>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="user_vorname" /> {lang_user_vorname_only}</td>
                  <td nowrap="nowrap">&nbsp;</td>
                  <td nowrap="nowrap" class="td2"><input type="radio" name="search_fields" value="user_name2" /> {lang_user_name2_only}</td>               
                </tr>

Than I rebuilded the search index.

On the search-sreen I can see the new radio buttons, but not the description of the radio buttons (regarding the entry in main.php).
The search of "user_name2" or "user_vorname" doesn't work.

Where is the problem?

Thank you for helping me!
Serge

426
Hi Jan

Is it possible to user
Code: [Select]
{if user_loggedin} and
Code: [Select]
{endif user_loggedin}in the description of a picture, which I enter in the ACP?
It is mentioned, that I can use HTML-Code.
What do I have to do, that I can use this tags?

Thank you for helping me!
Serge

427
Thank you Jan!

Great support!

Serge  :D

428
I get the following error message after starting the ACP

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/httpd/vhosts/photofront.ch/httpdocs/admin/index.php on line 143


At line 143 I have the following code:
Code: [Select]
<html dir="<?php echo $lang['direction']; ?>">
What is wrong? If you need more information, let me know.

Thanks

429
Templates & Styles (Requests & Discussions) / Re: Buttons
« on: March 23, 2005, 11:15:47 PM »
Wow!!!

Vielen Dank mawenzi!

Das ist ein super Service.
Ich werde mir morgen das Programm downloaden.

Serge

430
Templates & Styles (Requests & Discussions) / Re: Buttons
« on: March 23, 2005, 09:56:27 PM »
Hi mawenzi

Vielen Dank für den Tipp. Ich arbeite mit PhotoImpact. Das Programm finde ich gut, bringe aber die weiss umrandete Schrift nicht hin. Kannst du das mit Ultimate Paint? Wenn ja, könntest du mir die Buttons kreieren? Wäre super nett! Die Blank-Buttons gibt es ja hier in diesem Post.

Gruss
Serge

431
Templates & Styles (Requests & Discussions) / Re: Buttons
« on: March 23, 2005, 05:44:43 PM »
Hi everybody

I don't have the software photoshop.

Could anybody create four new buttons for me, using the standard-buttons?

Text for the buttons:
Bitte einloggen
Nicht an Lager
Bestellen (with an ative Flag, like the Lightbox-Button)
Bestellen (with a Flag not active, like the Lightbox-Button)

Thank you very much! 

Serge

432
Hi Jan

As usual... very good instructions and high quality.

Now it should also be possible for a customer to change his usergroup. In the template warenkorb_kunde.html I have implemented the following code:

Code: [Select]
<td class="row2">
   <input checked type="radio" name="usergruppe" value="Kunde"{user_is_photographer_no} /> Kunde
   <input type="radio" name="usergruppe" value="Fotograf"/{user_is_photographer_yes} />Fotograf
  </td>

The template is used by warenkorb_kunde.php

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: warenkorb.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'warenkorb_kunde,thumbnail_bit';
$main_template 'warenkorb_kunde';


define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (
$user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
  show_error_page($lang['warenkorb_register']);
}

$kunde_info = array();
$neuer_kunde = array();
$kunden_update = array();

if (
$user_id != GUEST) {
      $sql "SELECT *
              FROM 4images_kunden
              WHERE kunde_id = "
.$user_info['user_id'];
      $kunde_info $site_db->query_firstrow($sql);


  $sql "SELECT COUNT(*) as check_kunde
   FROM 4images_kunden
   WHERE kunde_id = "
.$user_info['user_id'];

   $check $site_db->query_firstrow($sql);
      $check_kunde $check['check_kunde'];
    if ($check_kunde 1)
    {

      $sql "INSERT INTO 4images_kunden( kunde_id, kunde_anrede, kunde_nachname, kunde_vorname, kunde_firma, kunde_plz, kunde_str, kunde_ort, kunde_telefon, kunde_telefax, liefer_anrede, liefer_nachname, liefer_vorname, liefer_firma, liefer_plz, liefer_str, liefer_ort, liefer_telefon, liefer_telefax, kunde_zahlungsart, kunde_bemerkung, kunde_bank, kunde_kontonr, kunde_blz, bestellung  )
      VALUES ( "
.$user_info['user_id'].", 'kunde_anrede', kunde_nachname, kunde_vorname, kunde_firma, kunde_plz, kunde_str, kunde_ort, kunde_telefon, kunde_telefax, liefer_anrede, liefer_nachname, liefer_vorname, liefer_firma, liefer_plz, liefer_str, liefer_ort, liefer_telefon, liefer_telefax, kunde_zahlungsart, kunde_bemerkung, kunde_bank, kunde_kontonr, kunde_blz, 1 ) ";
$result $site_db->query($sql);
}


}

$site_template->register_vars(array(
"kunde_id" => $kunde_info['kunde_id'],
"kunde_nachname" => $kunde_info['kunde_nachname'],
"kunde_vorname" => $kunde_info['kunde_vorname'],
"kunde_firma" => $kunde_info['kunde_firma'],
"kunde_plz" => $kunde_info['kunde_plz'],
"kunde_str" => $kunde_info['kunde_str'],
"kunde_ort" => $kunde_info['kunde_ort'],
"kunde_telefon" => $kunde_info['kunde_telefon'],
"kunde_telefax" => $kunde_info['kunde_telefax'],
"liefer_anrede" => $kunde_info['liefer_anrede'],
"liefer_nachname" => $kunde_info['liefer_nachname'],
"liefer_vorname" => $kunde_info['liefer_vorname'],
"liefer_firma" => $kunde_info['liefer_firma'],
"liefer_plz" => $kunde_info['liefer_plz'],
"liefer_str" => $kunde_info['liefer_str'],
"liefer_ort" => $kunde_info['liefer_ort'],
"liefer_telefon" => $kunde_info['liefer_telefon'],
"liefer_telefax" => $kunde_info['liefer_telefax'],
"kunde_bemerkung" => $kunde_info['kunde_bemerkung'],
"kunde_zahlungsart" => $kunde_info['kunde_zahlungsart'],
"kunde_bank" => $kunde_info['kunde_bank'],
"kunde_kontonr" => $kunde_info['kunde_kontonr'],
"kunde_blz" => $kunde_info['kunde_blz']

));

$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>



What do I have to implement, that the customer can change his usergroup from customer to photographer?

Thanks again, I really appreciate your help!    :D

433
Super Jan  :D

Now I have implemented the following code in member_editprofile.html

Code: [Select]
<tr>
            <td class="row1"><b>Usergruppe</b></td>
            <td class="row1">
            <input checked type="radio" name="usergruppe" value="Kunde"/> Kunde
            <input type="radio" name="usergruppe" value="Fotograf"/>Fotograf</td>
          </tr>

The radio button of the usergroup, which the user belongs to, should be active. That means, the database must be read befor displaying the radio buttons.
A change of the usergroup, which can be done by the user, should be stored in the database.

What code and where do I have to implement?


Thanks!

434
I have posted the MOD: http://www.4homepages.de/forum/index.php?topic=6945.new#new

After implementation of my request, this MOD wouln't be used anymore. The user would chose his usergroup at the time of registration and can anytime change the usergoup in the control center.

The name of the usergroupe is also displayed in the userinfo, next to the username.

And here is my register.php

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: register.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'register';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (
$action == "") {
  $action "signup";
}

if (
$user_info['user_level'] != GUEST && $action != "activate") {
  show_error_page($lang['already_registered']);
}
$content "";


//-----------------------------------------------------
//--- Signup ------------------------------------------
//-----------------------------------------------------
if ($action == "signup") {
  $site_template->register_vars(array(
    "lang_agreement" => $lang['agreement'],
    "lang_agreement_terms" => $lang['agreement_terms'],
    "lang_agree" => $lang['agree'],
    "lang_agree_not" => $lang['agree_not']
  ));
  $content $site_template->parse_template("register_signup");
}

//-----------------------------------------------------
//--- Add New User ------------------------------------
//-----------------------------------------------------
if ($action == "register") {
  if (!isset($HTTP_POST_VARS['user_name'])) {
    if ($config['activation_time'] != 0) {
      $expiry time() - 60 60 24 $config['activation_time'];
      $sql "DELETE FROM ".USERS_TABLE.
              WHERE ("
.get_user_table_field("""user_lastaction")." < $expiry) AND ".get_user_table_field("""user_level")." = ".USER_AWAITING;
      $site_db->query($sql);
    }
  }
  $user_name = (isset($HTTP_POST_VARS['user_name'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_name'])) : "";
  $user_name ereg_replace("( ){2,}"" "$user_name);
  $user_password = (isset($HTTP_POST_VARS['user_password'])) ? trim($HTTP_POST_VARS['user_password']) : "";
  $user_email = (isset($HTTP_POST_VARS['user_email'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_email'])) : "";
  $user_showemail = (isset($HTTP_POST_VARS['user_showemail'])) ? intval($HTTP_POST_VARS['user_showemail']) : 1;
  $user_allowemails = (isset($HTTP_POST_VARS['user_allowemails'])) ? intval($HTTP_POST_VARS['user_allowemails']) : 1;
  $user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;
  $user_homepage = (isset($HTTP_POST_VARS['user_homepage'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_homepage'])) : "";
  $user_icq = (isset($HTTP_POST_VARS['user_icq'])) ? ((intval(trim($HTTP_POST_VARS['user_icq']))) ? intval(trim($HTTP_POST_VARS['user_icq'])) : "") : "";

  $error 0;
  if (isset($HTTP_POST_VARS['user_name'])) {
    if ($user_name != "") {
      $sql "SELECT ".get_user_table_field("""user_name").
              FROM "
.USERS_TABLE.
              WHERE "
.get_user_table_field("""user_name")." = '".strtolower($user_name)."'";
      if ($site_db->not_empty($sql)) {
        $msg .= (($msg != "") ? "<br />" "").$lang['username_exists'];
        $error 1;
      }
    }
    else {
      $msg .= (($msg != "") ? "<br />" "").$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['user_name']), $lang['field_required']);
      $error 1;
    }

    if ($user_password == "") {
      $msg .= (($msg != "") ? "<br />" "").$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['password']), $lang['field_required']);
      $error 1;
    }

    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;
    }

    if (!empty($additional_user_fields)) {
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && intval($val[2]) == && trim($HTTP_POST_VARS[$key]) == "") {
          $error 1;
          $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$val[0]), $lang['field_required']);
          $msg .= (($msg != "") ? "<br />" "").$field_error;
        }
      }
    }
  // end if
  else {
    $error 1;
  }

  if (!$error) {
    $additional_field_sql "";
    $additional_value_sql "";
    if (!empty($additional_user_fields)) {
      $table_fields $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_field_sql .= ", $key";
          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }
    $activationkey get_random_key(USERS_TABLEget_user_table_field(""$user_table_fields['user_activationkey']));
    $user_id $site_db->get_next_id($user_table_fields['user_id'], USERS_TABLE);

    $current_time time();
    $user_level = ($config['account_activation'] == 0) ? USER USER_AWAITING;
    $sql "INSERT INTO ".USERS_TABLE."
            ("
.get_user_table_field("""user_id").get_user_table_field(", ""user_level").get_user_table_field(", ""user_name").get_user_table_field(", ""user_password").get_user_table_field(", ""user_email").get_user_table_field(", ""user_showemail").get_user_table_field(", ""user_allowemails").get_user_table_field(", ""user_invisible").get_user_table_field(", ""user_joindate").get_user_table_field(", ""user_activationkey").get_user_table_field(", ""user_lastaction").get_user_table_field(", ""user_lastvisit").get_user_table_field(", ""user_comments").get_user_table_field(", ""user_homepage").get_user_table_field(", ""user_icq").$additional_field_sql.") 
            VALUES
            (
$user_id$user_level, '$user_name', '".md5($user_password)."', '$user_email', $user_showemail$user_allowemails$user_invisible$current_time, '$activationkey', $current_time$current_time, 0, '$user_homepage', '$user_icq'".$additional_value_sql.")";
    $result $site_db->query($sql);

    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'];
    }
  }

  if ($error) {
    if ($user_showemail == 1) {
      $user_showemail_yes " checked=\"checked\"";
      $user_showemail_no "";
    }
    else {
      $user_showemail_yes "";
      $user_showemail_no " checked=\"checked\"";
    }
    if ($user_allowemails == 1) {
      $user_allowemails_yes " checked=\"checked\"";
      $user_allowemails_no "";
    }
    else {
      $user_allowemails_yes "";
      $user_allowemails_no " checked=\"checked\"";
    }
    if ($user_invisible == 1) {
      $user_invisible_yes " checked=\"checked\"";
      $user_invisible_no "";
    }
    else {
      $user_invisible_yes "";
      $user_invisible_no " checked=\"checked\"";
    }
    $site_template->register_vars(array(
      "user_name" => htmlspecialchars(stripslashes($user_name)),
      "user_email" => htmlspecialchars(stripslashes($user_email)),
      "user_homepage" => htmlspecialchars(stripslashes($user_homepage)),
      "user_icq" => $user_icq,
      "user_showemail_yes" => $user_showemail_yes,
      "user_showemail_no" => $user_showemail_no,
      "user_allowemails_yes" => $user_allowemails_yes,
      "user_allowemails_no" => $user_allowemails_no,
      "user_invisible_yes" => $user_invisible_yes,
      "user_invisible_no" => $user_invisible_no,
      "lang_user_name" => $lang['user_name'],
      "lang_password" => $lang['password'],
      "lang_email" => $lang['email'],
      "lang_register_msg" => $lang['register_msg'],
      "lang_submit" => $lang['submit'],
      "lang_reset" => $lang['reset'],
      "lang_email" => $lang['email'],
      "lang_show_email" => $lang['show_email'],
      "lang_allow_emails" => $lang['allow_emails'],
      "lang_invisible" => $lang['invisible'],
      "lang_optional_infos" => $lang['optional_infos'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq'],
      "lang_yes" => $lang['yes'],
      "lang_no" => $lang['no']
    ));
    
    
if (!empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        if ($val[1] == "radio") {
          $value = (isset($HTTP_POST_VARS[$key])) ? intval($HTTP_POST_VARS[$key]) : 1;
          if ($value == 1) {
            $additional_field_array[$key.'_yes'] = " checked=\"checked\"";
            $additional_field_array[$key.'_no'] = "";
          }
          else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }
        else {
          $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(trim($HTTP_POST_VARS[$key])) : "";
        }
        $additional_field_array[$key] = $value;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (!empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
    }

    $content $site_template->parse_template("register_form");
  }
}

if (
$action == "activate") {
  if ($config['activation_time'] != 0) {
    $expiry time() - 60 60 24 $config['activation_time'];
    $sql "DELETE FROM ".USERS_TABLE.
            WHERE ("
.get_user_table_field("""user_lastaction")." < $expiry) AND ".get_user_table_field("""user_level")." = ".USER_AWAITING;
    $site_db->query($sql);
  }
  if (!isset($HTTP_GET_VARS['activationkey'])){
    $msg $lang['missing_activationkey'];
  }
  else {
    if ($config['account_activation'] == && $user_info['user_level'] != ADMIN) {
      show_error_page($lang['no_permission']);
      exit;
    }
    $activationkey trim($HTTP_GET_VARS['activationkey']);


$sql "SELECT ".get_user_table_field("""user_id").get_user_table_field(", ""user_name").get_user_table_field(", ""user_email").get_user_table_field(", ""user_activationkey")."                
            
            
            FROM "
.USERS_TABLE.
            WHERE "
.get_user_table_field("""user_activationkey")." = '$activationkey'";
    $row $site_db->query_firstrow($sql);
    if (!$row) {
      $msg $lang['invalid_activationkey'];
    }
    else {
      $sql "UPDATE ".USERS_TABLE.
              SET "
.get_user_table_field("""user_level")." = ".USER.
              WHERE "
.get_user_table_field("""user_activationkey")." = '$activationkey'";
      $site_db->query($sql);
      $msg $lang['activation_success'];

    
$group_id 
1

$sql "INSERT INTO ".GROUP_MATCH_TABLE.
        (group_id, user_id, groupmatch_startdate, groupmatch_enddate) 
        VALUES 
        (
$group_id, ".$row[$user_table_fields['user_id']].", ".time().", 0)"
$site_db->query($sql);

     
      

      
if ($config['account_activation'] == 2) {
        include(ROOT_PATH.'includes/email.php');
        $site_email = new Email();
        $site_email->set_to($row[$user_table_fields['user_email']]);
        $site_email->set_subject($lang['activation_success_emailsubject']);
        $site_email->register_vars(array(
          "user_name" => $row[$user_table_fields['user_name']],
          "site_name" => $config['site_name']
        ));
        $site_email->set_body("activation_success"$config['language_dir']);
        $site_email->send_email();
      }
    }
  }
}

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['register']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "content" => $content,
  "msg" => $msg,
  "clickstream" => $clickstream,
  "lang_register" => $lang['register']
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


435
This Theme was discussed before hack

Hi together Is it possible to define a default usergroup for new registered users? As soon as the new user has activated his account, he should be linked to the usergroup "new user". thanks for helping me.
Serge



from Jan:

Try this:

1.) Open register.php and search for Code:

Code: [Select]
$sql = "SELECT ".get_user_table_field("",
"user_name").get_user_table_field(", ",
"user_email").get_user_table_field(", ",
"user_activationkey")."

Replace it with Code:
Code: [Select]
$sql = "SELECT ".get_user_table_field("",
"user_id").get_user_table_field("",
"user_name").get_user_table_field(", ",
"user_email").get_user_table_field(", ",
"user_activationkey")."

2.) Then search for Code:
Code: [Select]
$msg = $lang['activation_success'];

Add the following code below Code:
Code: [Select]
$group_id = [group_id];
$sql = "INSERT INTO ".GROUP_MATCH_TABLE."
         (group_id, user_id, groupmatch_startdate,
groupmatch_enddate)
         VALUES
         ($group_id, ".$row[$user_table_fields['user_id']].",
".time().", 0)";
$site_db->query($sql);

Replace [group_id] with the id of the goup id you want the user link with. To find out the id, go to Control Panel -> Usergroups and point your cursor over the edit link of the usergroup. Then look at the status bar of the browser and check the group_id= parameter in the url. The value of the parameter is the group id.

Jan
Zuletzt bearbeitet von Jan am 10.01.2005, 13:21, insgesamt 2 Male bearbeitet



TIMT wrote:

Hi Jan Now I get the following error-message:

 "DB Error: Bad SQL Query: SELECT user_iduser_name, user_email,
user_activationkey FROM 4images_users WHERE user_activationkey =
'0fa67cf43fd1dd0e1176a1d2ddedbc7b'
Unknown column 'user_iduser_name' in 'field list'"



v@no wrote:

@Jan: that what u get when u put things at the beginning of line, instead of end   j/k

TIMT hat folgendes geschrieben::
Code: [Select]
"DB Error: Bad SQL Query: SELECT user_iduser_name, user_email, $
user_activationkey FROM 4images_users WHERE user_activationkey =
'0fa67cf43fd1dd0e1176a1d2ddedbc7b'
Unknown column 'user_iduser_name' in 'field list'"


@TIMT: First line u changed should looks like this:
Zitat:
Code: [Select]
$sql = "SELECT ".get_user_table_field("",
"user_id").get_user_table_field(", ", "user_name").get_user_table_field(",
", "user_email").get_user_table_field(", ", "user_activationkey")."



Jan wrote:
V@no is right. Forgive me, its monday  


TIMT wrote:
Thank you Jan, Thank you V@no! Now it works perfect!    

Pages: 1 ... 25 26 27 28 [29] 30 31