Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hanver
New Member
New Member



Joined: Apr 26, 2012
Posts: 14

PostPosted: Thu May 10, 2012 1:26 pm Reply with quote

Hello Raventeam,

thx 4 the great Support! And a new Quest Smile

I have the data x mod ((Tony Boyd) Custom Profile Fields - MOD Version: 1.2.0 I would like to incorporate this into my phpbb 2023, but the mysql can not insert into the table...

Is there there a similar mod or a newer verison?

i hope you can help me.

regards
 
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Thu May 10, 2012 1:39 pm Reply with quote

I would probably suggest to just use the built-in custom fields in RavenNuke (see the Users ACP), and this threads shows an example of how to use them on the forums. [ Only registered users can see links on this board! Get registered or login! ]

although I'm not familiar with the mod you spoke of, so not sure if this approach handles all your needs, or not.
 
View user's profile Send private message Visit poster's website
hanver







PostPosted: Fri May 11, 2012 11:34 am Reply with quote

ok my Custom Fields from the Owner is now running without a problem.. i think - but i have find one problem.

Code:
<?php

/***************************************************************************
 *                          admin_profile_fields.php
 *                            -------------------
 *   author:                Brian Shields (alias Blankety Blank Man)
 *   email:                 blanketyblankman@gmail.com
 *   description:           Dynamic content file driving the addition/editing/
 *                          deletion of custom profile fields for the Custom
 *                          Profiles MOD.
 *
 *
 ***************************************************************************/

/***************************************************************************
 *                               Version notes
 *                                 ---------
 *   1.0.0: December 31, 2005
 *   ------------------------
 *      - No longer vulnerable to SQL injection
 *      - Removed Javascript implementaion for radio & checkboxes
 *      - Added field description
 *
 *   0.0.1: December 17, 2005
 *   ------------------------
 *      - Vulnerable to SQL injection
 *      - Poorly implemented Javascript for radio and checkbox values
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB',true);

if(!empty($setmodules))
{
  $filename = basename(__FILE__);
  $module['Custom_Profile']['Add'] = "$filename?mode=add&pfid=x";
  $module['Custom_Profile']['Edit'] = "$filename?mode=edit&pfid=x";
  $module['Custom_Profile']['Settings'] = "$filename?mode=settings&pfid=x";
 
  return;
}

//
// Load default header
//
$no_page_header = false;
$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_profile_fields.'.$phpEx);

if(!isset($HTTP_GET_VARS['mode']) || !isset($HTTP_GET_VARS['pfid']))
{
  message_die(GENERAL_ERROR,'Required GET variables not set','Could not reach admin page; Insufficient data',__LINE__,__FILE__);
}


$mode = $HTTP_GET_VARS['mode'];
$pfid = $HTTP_GET_VARS['pfid'];

if($mode == 'add')
{
  $template->set_filenames(array('body' => 'admin/add_profile_field.tpl'));
 
  $template->assign_vars(array(
    'TEXT_FIELD_CHECKED' => ' checked="checked"',
    'NOT_REQUIRED_CHECKED' => ' checked="checked"',
    'ALLOW_VIEW_CHECKED' => ' checked="checked"',
    'VIEW_IN_PROFILE_CHECKED' => ' checked="checked"',
    'ABOUT_CHECKED' => ' checked="checked"',
    'NO_VIEW_IN_MEMBERLIST' => ' checked="checked"',
    'NO_VIEW_IN_TOPIC' => ' checked="checked"',
    'AUTHOR_CHECKED' => ' checked="checked"',
    'NO_LINKIFY_CHECKED' => ' checked="checked"',
   
    'L_ADD_FIELD_TITLE' => $lang['add_field_title'],
    'L_ADD_FIELD_EXPLAIN' => $lang['add_field_explain'],
   
    'S_ADD_FIELD_ACTION' => append_sid("$filename?mode=update&pfid=x")
    ));
}
else if ($mode == 'settings') {
   $template->set_filenames(array('body' => 'admin/edit_cpf_settings.tpl'));
   $template->assign_vars(array(
      'L_CPF_SETTINGS_TITLE' => $lang['cpf_settings_title'],
      'L_CPF_SETTINGS_EXPLAIN' => $lang['cpf_settings_explain'],
      'L_COLLAPSE_FIELDS' => $lang['collapse_fields'],
      'L_COLLAPSE_FIELDS_EXPLAIN' => $lang['collapse_fields_explain'],
      'COLLAPSE_FIELDS_CHECKED' => $board_config['collapse_fields'] == COLLAPSE_FIELDS_ON ? ' checked="checked"' : '',
      'NO_COLLAPSE_FIELDS_CHECKED' => $board_config['collapse_fields'] == COLLAPSE_FIELDS_OFF ? ' checked="checked"' : '',
      'S_CPF_SETTINGS_ACTION' => append_sid("$filename?mode=change&pfid=x")
   ));
}
else if ($mode == 'change') {
   $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
   $config_value = intval($HTTP_POST_VARS['collapse_fields']);
   if (($config_value == 1) || ($config_value == 0)) {
      $sql = "UPDATE " . CONFIG_TABLE . "
         SET config_value = $config_value
         WHERE config_name = 'collapse_fields'";
      if (!$db->sql_query($sql)) {
         message_die(GENERAL_ERROR,'Unable to update the config table.','',__LINE__,__FILE__,$sql);
      }
      $template->assign_vars(array(
         'MESSAGE_TITLE' => $lang['cpf_settings_updated'],
         'MESSAGE_TEXT' => $lang['cpf_settings_success']
      ));
   }
   else {
      message_die(GENERAL_ERROR,'Improper value entered.  Unable to change settings.','',__LINE__,__FILE__,$sql);
   }
}
elseif($mode == 'update')
{
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
 
  $name = htmlspecialchars($HTTP_POST_VARS['field_name']);
  if(empty($name))
  {
    message_die(GENERAL_ERROR,$lang['enter_a_name']);
  }
 
  $description = htmlspecialchars($HTTP_POST_VARS['field_description']);
 
  $type = intval($HTTP_POST_VARS['field_type']);
  $text_field_default = htmlspecialchars($HTTP_POST_VARS['text_field_default']);
  $text_field_maxlen = empty($HTTP_POST_VARS['text_field_maxlen']) ? TEXT_FIELD_MAXLENGTH : intval($HTTP_POST_VARS['text_field_maxlen']);
  $text_field_maxlen = $text_field_maxlen > TEXT_FIELD_MAXLENGTH ? TEXT_FIELD_MAXLENGTH : $text_field_maxlen;
  $text_area_default = htmlspecialchars($HTTP_POST_VARS['text_area_default']);
  $text_area_maxlen = empty($HTTP_POST_VARS['text_area_maxlen']) ? TEXTAREA_MINLENGTH : intval($HTTP_POST_VARS['text_area_maxlen']);
  $text_area_maxlen = $text_area_maxlen > TEXTAREA_MAXLENGTH ? TEXTAREA_MAXLENGTH : $text_area_maxlen;
 
  $radio_values = htmlspecialchars($HTTP_POST_VARS['radio_values']);
  $radio_default_value = htmlspecialchars($HTTP_POST_VARS['radio_default_value']);
  $radio_values = explode("\n",str_replace("\r",'',$radio_values));
  if(empty($radio_default_value))
  {
    $radio_default_value = $radio_values[0];
  }
  $temp = '';
  foreach($radio_values as $val)
  {
    $temp .= $val . ',';
  }
  $radio_values = substr($temp,0,strlen($temp)-1);
 
  $checkbox_values = htmlspecialchars($HTTP_POST_VARS['checkbox_values']);
  $check_default_values = htmlspecialchars($HTTP_POST_VARS['check_default_values']);
  $checkbox_values = explode("\n",str_replace("\r",'',$checkbox_values));
  if(!empty($check_default_values))
  {
    $check_default_values = explode("\n",str_replace("\r",'',$check_default_values));
    $temp = '';
    foreach($check_default_values as $val)
    {
      $temp .= $val . ',';
    }
    $check_default_values = substr($temp,0,strlen($temp)-1);
  }
  $temp = '';
  foreach($checkbox_values as $val)
  {
    $temp .= $val . ',';
  }
  $checkbox_values = substr($temp,0,strlen($temp)-1);
 
  $required = intval($HTTP_POST_VARS['required']);
  $user_can_view = intval($HTTP_POST_VARS['user_can_view']);
  $view_in_profile = intval($HTTP_POST_VARS['view_in_profile']);
  $profile_location = intval($HTTP_POST_VARS['profile_location']);
  $view_in_memberlist = intval($HTTP_POST_VARS['view_in_memberlist']);
  $view_in_topic = intval($HTTP_POST_VARS['view_in_topic']);
  $signature_wrap = intval($HTTP_POST_VARS['signature_wrap']);
  $linkify = intval($HTTP_POST_VARS['linkify']);
 
  if($pfid == 'x')
  {
    $sql = "SELECT field_name FROM " . PROFILE_FIELDS_TABLE . "
      WHERE field_name='$name'";
    if(!($result = $db->sql_query($sql)))
    {
      message_die(GENERAL_ERROR,'Could not query database for field name information','',__LINE__,__FILE__,$sql);
    }
    $temp = $db->sql_fetchrowset($result);
    if(!empty($temp))
    {
      message_die(GENERAL_ERROR,$lang['field_exists']);
    }
  }
 
  if($pfid == 'x')
  {
    $die_message = 'Could not insert new profile field';
  }
  else
  {
    $die_message = 'Could not update profile information';
  }
 
  if($pfid != 'x')
  {
    $sql = "SELECT field_name FROM " . PROFILE_FIELDS_TABLE . "
      WHERE field_id = $pfid";
    if(!($result = $db->sql_query($sql)))
    {
      message_die(GENERAL_ERROR,'Could not find old name','',__LINE__,__FILE__,$sql);
    }
    $old_name = $db->sql_fetchrow($result);
    $old_name = text_to_column($old_name['field_name']);
  }
 
  $name_display = $name;
  $name = str_replace("\'","''",text_to_column($name));
  $description = str_replace("\'","''",$description);
  $text_field_default = str_replace("\'","''",$text_field_default);
  $text_area_default = str_replace("\'","''",$text_area_default);
  $text_area_maxlen = str_replace("\'","''",$text_area_maxlen);
  $radio_default_value = str_replace("\'","''",$radio_default_value);
  $radio_values = str_replace("\'","''",$radio_values);
  $check_default_values = str_replace("\'","''",$check_default_values);
  $checkbox_values = str_replace("\'","''",$checkbox_values);
 
  if($pfid == 'x')
  {
    $sql = "INSERT INTO " . PROFILE_FIELDS_TABLE . "
      (field_name, field_description, field_type, text_field_default, text_field_maxlen, text_area_default, text_area_maxlen,
      radio_button_default, radio_button_values, checkbox_default, checkbox_values, is_required,
      users_can_view, view_in_profile, profile_location, view_in_memberlist, view_in_topic, topic_location, linkify)
      VALUES ('$name_display','$description',$type,'$text_field_default',$text_field_maxlen,'$text_area_default',$text_area_maxlen,
      '$radio_default_value','$radio_values','$check_default_values','$checkbox_values',$required,$user_can_view,
      $view_in_profile,$profile_location,$view_in_memberlist,$view_in_topic,$signature_wrap,$linkify)";
  }
  else
  {
    $sql = "UPDATE " . PROFILE_FIELDS_TABLE . "
      SET field_name = '$name_display',
        field_description = '$description',
        field_type = $type,
        text_field_default = '$text_field_default',
        text_field_maxlen = $text_field_maxlen,
        text_area_default = '$text_area_default',
        text_area_maxlen = $text_area_maxlen,
        radio_button_default = '$radio_default_value',
        radio_button_values = '$radio_values',
        checkbox_default = '$check_default_values',
        checkbox_values = '$checkbox_values',
        is_required = $required,
        users_can_view = $user_can_view,
        view_in_profile = $view_in_profile,
        profile_location = $profile_location,
        view_in_memberlist = $view_in_memberlist,
        view_in_topic = $view_in_topic,
        topic_location = $signature_wrap,
        linkify = $linkify
      WHERE field_id = $pfid";
  }
 
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,$die_message,'',__LINE__,__FILE__,$sql);
  }
 
  if($pfid != 'x')
  {
    switch($type)
    {
      case TEXT_FIELD: $col_type = 'VARCHAR('.$text_field_maxlen.')'; break;
      case TEXTAREA:
      case RADIO:
      case CHECKBOX: $col_type = 'TEXT'; break;
    }
    $sql = "ALTER TABLE " . USERS_TABLE . "
      CHANGE $old_name $name $col_type";
    if(!$db->sql_query($sql))
    {
      message_die(GENERAL_ERROR,'Could not change column name in '.USERS_TABLE,'',__LINE__,__FILE__,$sql);
    }
  }
 
  $sql = "ALTER TABLE " . USERS_TABLE . "
    ADD $name";
  switch($type)
  {
    case TEXT_FIELD:
      $sql .= " varchar($text_field_maxlen) DEFAULT '$text_field_default'";
      break;
    case RADIO:
      $sql .= " varchar(255) DEFAULT '$radio_default_value'";
      break;
    case TEXTAREA:
    case CHECKBOX:
      $sql .= " text";
      break;
  }
 
  if($pfid == 'x' && !$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not expand users table for new profile field.','',__LINE__,__FILE__,$sql);
  }
 
  $sql = "SELECT user_id FROM " . USERS_TABLE;
  if(!($result = $db->sql_query($sql)))
  {
    message_die(GENERAL_ERROR,'Could not retrieve use and profile information','',__LINE__,__FILE__,$sql);
  }
 
  $user_id_array = array();
  while($temp = $db->sql_fetchrow($result))
  {
    $user_id_array[] = $temp['user_id'];
  }
 
  if($pfid == 'x')
  {
    foreach($user_id_array as $user_id)
    {
      $sql = "UPDATE " . USERS_TABLE . "
        SET $name = %s
        WHERE user_id = $user_id";
     
      switch($type)
      {
        case TEXT_FIELD:
          $val = $text_field_default;
          break;
        case TEXTAREA:
          $val = $text_area_default;
          break;
        case RADIO:
          $val = $radio_default_value;
          break;
        case CHECKBOX:
          $val = $check_default_values;
          break;
      }
     
      $sql = sprintf($sql,"'$val'");
     
      if(!$db->sql_query($sql))
      {
        message_die(GENERAL_ERROR,'Could not update users with default values','',__LINE__,__FILE__,$sql);
      }
    }
  }
 
  $template->assign_vars(array(
    'MESSAGE_TITLE' => $pfid == 'x' ? $lang['profile_field_created'] : $lang['profile_field_updated'],
    'MESSAGE_TEXT' => $lang['field_success'] . '<br /><br />' . $create_second_field_link));
}
elseif($mode == 'edit')
{
  if($pfid == 'x')
  {
    $template->set_filenames(array('body' => 'admin/add_profile_field_list.tpl'));
   
    $template->assign_vars(array(
      'L_PROFILE_FIELD_LIST_TITLE' => $lang['profile_field_list'],
      'L_PROFILE_FIELD_LIST_EXPLAIN' => $lang['profile_field_list_explain'],
      'L_ID' => $lang['profile_field_id'],
      'L_NAME' => $lang['profile_field_name'],
      'L_ACTION' => $lang['profile_field_action'],
      'L_EDIT' => $lang['Edit'],
      'L_DELETE' => $lang['Delete']
      ));
   
    $profile_rows = get_fields();
   
    if(count($profile_rows) == 0)
    {
      $template->assign_block_vars('switch_no_fields',array('NO_FIELDS_EXIST' => $lang['no_profile_fields_exist']));
    }
    else
    {
      $template->assign_block_vars('switch_fields',array());
     
      foreach($profile_rows as $col => $val)
      {
        $row = $col % 2 == 0 ? 'row1' : 'row2';
        $id = $val['field_id'];
        $name = $val['field_name'];
       
        $edit_url = append_sid("$filename?mode=edit&pfid=$id");
        $delete_url = append_sid("$filename?mode=delete&pfid=$id");
       
        $template->assign_block_vars('switch_fields.profile_fields',array(
          'ROW_CLASS' => $row,
          'ID' => $id,
          'NAME' => $name,
         
          'U_PROFILE_FIELD_EDIT' => $edit_url,
          'U_PROFILE_FIELD_DELETE' => $delete_url
          ));
      }
    }
  }
  else
  {
    $template->set_filenames(array('body' => 'admin/add_profile_field.tpl'));
   
    $profile_rows = get_fields('WHERE field_id = ' . $pfid,false);
   
    $template->assign_vars(array(
      'FIELD_NAME' => $profile_rows['field_name'],
      'FIELD_DESCRIPTION' => $profile_rows['field_description'],
      'TEXT_FIELD_CHECKED' => $profile_rows['field_type'] == TEXT_FIELD ? ' checked="checked"' : '',
      'TEXTAREA_CHECKED' => $profile_rows['field_type'] == TEXTAREA ? ' checked="checked"' : '',
      'RADIO_CHECKED' => $profile_rows['field_type'] == RADIO ? ' checked="checked"' : '',
      'CHECKBOX_CHECKED' => $profile_rows['field_type'] == CHECKBOX ? ' checked="checked"' : '',
      'TEXT_FIELD_DEFAULT' => $profile_rows['text_field_default'],
      'TEXT_FIELD_MAXLENGTH' => $profile_rows['text_field_maxlen'],
      'TEXTAREA_DEFAULT' => $profile_rows['text_area_default'],
      'TEXTAREA_MAXLENGTH' => $profile_rows['text_area_maxlen'],
      'REQUIRED_CHECKED' => $profile_rows['is_required'] == REQUIRED ? ' checked="checked"' : '',
      'NOT_REQUIRED_CHECKED' => $profile_rows['is_required'] == NOT_REQUIRED ? ' checked="checked"' : '',
      'ALLOW_VIEW_CHECKED' => $profile_rows['users_can_view'] == ALLOW_VIEW ? ' checked="checked"' : '',
      'DISALLOW_VIEW_CHECKED' => $profile_rows['users_can_view'] == DISALLOW_VIEW ? ' checked="checked"' : '',
      'VIEW_IN_PROFILE_CHECKED' => $profile_rows['view_in_profile'] == VIEW_IN_PROFILE ? ' checked="checked"' : '',
      'NO_VIEW_IN_PROFILE_CHECKED' => $profile_rows['view_in_profile'] == NO_VIEW_IN_PROFILE ? ' checked="checked"' : '',
      'CONTACTS_CHECKED' => $profile_rows['profile_location'] == CONTACTS ? ' checked="checked"' : '',
      'ABOUT_CHECKED' => $profile_rows['profile_location'] == ABOUT ? ' checked="checked"' : '',
      'VIEW_IN_MEMBERLIST' => $profile_rows['view_in_memberlist'] == VIEW_IN_MEMBERLIST ? ' checked="checked"' : '',
      'NO_VIEW_IN_MEMBERLIST' => $profile_rows['view_in_memberlist'] == NO_VIEW_IN_MEMBERLIST ? ' checked="checked"' : '',
      'VIEW_IN_TOPIC' => $profile_rows['view_in_topic'] == VIEW_IN_TOPIC ? ' checked="checked"' : '',
      'NO_VIEW_IN_TOPIC' => $profile_rows['view_in_topic'] == NO_VIEW_IN_TOPIC ? ' checked="checked"' : '',
      'AUTHOR_CHECKED' => $profile_rows['topic_location'] == AUTHOR ? ' checked="checked"' : '',
      'ABOVE_SIG_CHECKED' => $profile_rows['topic_location'] == ABOVE_SIGNATURE ? ' checked="checked"' : '',
      'BELOW_SIG_CHECKED' => $profile_rows['topic_location'] == BELOW_SIGNATURE ? ' checked="checked"' : '',
      'RADIO_VALUES' => str_replace(',',"\r\n",$profile_rows['radio_button_values']),
      'RADIO_DEFAULT' => $profile_rows['radio_button_default'],
      'CHECKBOX_VALUES' => str_replace(',',"\r\n",$profile_rows['checkbox_values']),
      'CHECKBOX_DEFAULT' => str_replace(',',"\r\n",$profile_rows['checkbox_default']),
      'LINKIFY_CHECKED' => $profile_rows['linkify'] == LINKIFY_ON ? ' checked="checked"' : '',
      'NO_LINKIFY_CHECKED' => $profile_rows['linkify'] == LINKIFY_OFF ? ' checked="checked"' : '',
     
      'L_ADD_FIELD_TITLE' => $lang['edit_field_title'],
      'L_ADD_FIELD_EXPLAIN' => $lang['edit_field_explain'],
     
      'S_ADD_FIELD_ACTION' => append_sid("$filename?mode=update&pfid=$pfid")
      ));
  }
}
elseif($mode == 'delete')
{
  $field_name = get_fields('WHERE field_id = '.$pfid,false,'field_name');
  $name = text_to_column($field_name['field_name']);
 
  $del_link = '<a href="' . append_sid("$filename?mode=confirmdelete&pfid=$pfid&name=$name") . '">' . $lang['Yes'] . '</a>';
  $nodel_link = sprintf($lang['index_link'],$lang['No']);
 
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
  $template->assign_vars(array(
    'MESSAGE_TITLE' => sprintf($lang['double_check_delete'],$field_name['field_name']),
    'MESSAGE_TEXT' => $del_link . ' &nbsp; ' . $nodel_link
    ));
}
elseif($mode == 'confirmdelete')
{
  $sql = "DELETE FROM " . PROFILE_FIELDS_TABLE . "
    WHERE field_id = $pfid";
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not delete profile form database','',__LINE__,__FILE__,$sql);
  }
 
  $name = $HTTP_GET_VARS['name'];
  $sql = "ALTER TABLE " . USERS_TABLE . "
    DROP COLUMN $name";
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not remove column from '.USERS_TABLE,'',__LINE__,__FILE__,$sql);
  }
 
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
  $template->assign_vars(array(
    'MESSAGE_TITLE' => $lang['field_deleted'],
    'MESSAGE_TEXT' => $lang['click_here_here']
    ));
}

$template->assign_vars(array(
  'L_NEW_FIELD_NAME' => $lang['add_field_name'],
  'L_NEW_FIELD_EXPLAIN' => $lang['add_field_name_explain'],
  'L_NEW_FIELD_DESCRIPTION' => $lang['add_field_description'],
  'L_NEW_FIELD_DESCRIPTION_EXPLAIN' => $lang['add_field_description_explain'],
  'L_NEW_FIELD_TYPE' => $lang['add_field_type'],
  'L_NEW_FIELD_TYPE_EXPLAIN' => $lang['edit_field_type_explain'],
  'L_REQUIRED_FIELD' => $lang['add_field_required'],
  'L_REQUIRED_FIELD_EXPLAIN' => $lang['add_field_required_explain'],
  'L_USER_CAN_VIEW' => $lang['add_field_user_can_view'],
  'L_USER_CAN_VIEW_EXPLAIN' => $lang['add_field_user_can_view_explain'],
  'L_TEXTAREA' => $lang['textarea'],
  'L_TEXTAREA_EXAMPLE' => $lang['textarea_example'],
  'L_TEXT_FIELD' => $lang['text_field'],
  'L_TEXT_FIELD_EXAMPLE' => $lang['text_field_example'],
  'L_RADIO' => $lang['radio'],
  'L_RADIO_EXAMPLE' => $lang['radio_example'],
  'L_CHECKBOX' => $lang['checkbox'],
  'L_CHECKBOX_EXAMPLE' => $lang['checkbox_example'],
  'L_VIEW_IN_PROFILE' => $lang['view_in_profile'],
  'L_VIEW_IN_MEMBERLIST' => $lang['view_in_memberlist'],
  'L_VIEW_IN_TOPIC' => $lang['view_in_topic'],   
  'L_PROFILE_LOCATIONS_EXPLAIN' => $lang['profile_locations_explain'],
  'L_CONTACTS_COLUMN' => $lang['contacts_column'],
  'L_ABOUT_COLUMN' => $lang['about_column'],   
  'L_TOPIC_LOCATIONS_EXPLAIN' => $lang['topic_locations_explain'],
  'L_ABOVE_SIGNATURE' => $lang['above'] . $lang['Signature'],
  'L_BELOW_SIGNATURE' => $lang['below'] . $lang['Signature'],
  'L_AUTHOR_COLUMN' => $lang['author_column'],   
  'L_YES' => $lang['Yes'],
  'L_NO' => $lang['No'],   
  'L_ADMIN_SETTINGS' => $lang['add_field_admin'],
  'L_GENERAL_SETTINGS' => $lang['add_field_general'],
  'L_VIEW_SETTINGS' => $lang['add_field_view'],
  'L_TEXT_FIELD_SETTINGS' => $lang['add_field_text_field'],
  'L_TEXT_AREA_SETTINGS' => $lang['add_field_text_area'],
  'L_RADIO_BUTTON_SETTINGS' => $lang['add_field_radio_button'],
  'L_CHECKBOX_SETTINGS' => $lang['add_field_checkbox'],   
  'L_DEFAULT_VALUE' => $lang['default_value'],
  'L_DEFAULT_VALUE_EXPLAIN' => $lang['default_value_explain'],
  'L_DEFAULT_VALUE_RADIO_EXPLAIN' => $lang['default_value_radio_explain'],
  'L_DEFAULT_VALUE_CHECKBOX_EXPLAIN' => $lang['default_value_checkbox_explain'],
  'L_MAX_LENGTH' => $lang['max_length'],
  'L_MAX_LENGTH_TEXT_FIELD_EXPLAIN' => $lang['max_length_explain'] . sprintf($lang['max_length_value'],TEXT_FIELD_MINLENGTH,TEXT_FIELD_MAXLENGTH),
  'L_MAX_LENGTH_TEXTAREA_EXPLAIN' => $lang['max_length_explain'] . sprintf($lang['max_length_value'],TEXTAREA_MINLENGTH,TEXTAREA_MAXLENGTH),
  'L_AVAILABLE_VALUES' => $lang['available_values'],
  'L_AVAILABE_VALUES_EXPLAIN' => $lang['available_values_explain'],   
  'L_VIEW_DISCLAIMER' => $lang['add_field_view_disclaimer'],
  'L_SUBMIT' => $lang['Submit'],
  'L_RESET' => $lang['Reset'],
  'L_LINKIFY' => $lang['linkify'],
  'L_LINKIFY_EXPLAIN' => $lang['linkify_explain'],
 
  'S_COLLAPSE_FIELDS_ON' => COLLAPSE_FIELDS_ON,
  'S_COLLAPSE_FIELDS_OFF' => COLLAPSE_FIELDS_OFF,
  'S_LINKIFY_ON' => LINKIFY_ON,
  'S_LINKIFY_OFF' => LINKIFY_OFF,
  'S_TEXT_FIELD' => TEXT_FIELD,
  'S_TEXTAREA' => TEXTAREA,
  'S_RADIO' => RADIO,
  'S_CHECKBOX' => CHECKBOX,
  'S_REQUIRED' => REQUIRED,
  'S_NOT_REQUIRED' => NOT_REQUIRED,
  'S_ALLOW_VIEW' => ALLOW_VIEW,
  'S_DISALLOW_VIEW' => DISALLOW_VIEW,
  'S_VIEW_IN_PROFILE' => VIEW_IN_PROFILE,
  'S_NO_VIEW_IN_PROFILE' => NO_VIEW_IN_PROFILE,
  'S_CONTACTS' => CONTACTS,
  'S_ABOUT' => ABOUT,
  'S_VIEW_IN_MEMBERLIST' => VIEW_IN_MEMBERLIST,
  'S_NO_VIEW_IN_MEMBERLIST' => NO_VIEW_IN_MEMBERLIST,
  'S_VIEW_IN_TOPIC' => VIEW_IN_TOPIC,
  'S_NO_VIEW_IN_TOPIC' => NO_VIEW_IN_TOPIC,
  'S_AUTHOR' => AUTHOR,
  'S_ABOVE_SIGNATURE' => ABOVE_SIGNATURE,
  'S_BELOW_SIGNATURE' => BELOW_SIGNATURE
  ));

$template->pparse('body');

include($phpbb_root_path . 'admin/page_footer_admin.' . $phpEx);
?>


I click "sumit" on the Admin Center from this Mod. And i must write:

Not found
The requested document was not found on this server.

where i found the link from "L_SUBMIT"

I have no idea what the problem is :-/ I think the link from "L_SUBMIT" is wrong
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Fri May 11, 2012 12:01 pm Reply with quote

That does not appear to be a bbtonuke mod. I think it is for standalone phpbb2 forum.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
hanver







PostPosted: Fri May 11, 2012 12:44 pm Reply with quote

sure, but it works with phpnuke - the Problem i must change the link..can you say me where i can change the Link from Sumit button?

I Have checked. the language files and the admin_profile_fields.php

On Line 42-45 i have a Code and on Line 86 i think that is my problem... but is this correct?
 
nuken







PostPosted: Sun May 13, 2012 6:37 am Reply with quote

Do you have a download link to the entire mod?
 
hanver







PostPosted: Sun May 13, 2012 12:16 pm Reply with quote

I can give you the Mod. perhaps anyone can me this covert?

if anyone willing to convert me the Custom Profile Fields MOD for phpbb2.0.23 to RN 2,5?
Please tell me your conditions to make it for me - or your imagination if you would help me.

Thanks

Mod: [ Only registered users can see links on this board! Get registered or login! ]

This Mod make new Custom fields on phpbb 2.0.23


Last edited by hanver on Sun May 20, 2012 11:40 am; edited 1 time in total 
hanver







PostPosted: Tue May 15, 2012 10:33 am Reply with quote

anyone have look fro this?
 
hanver







PostPosted: Sun May 20, 2012 10:24 am Reply with quote

You can see the Phpnuke is dead. There are no more mods for it. I will now also delete the phpnuke / RavenNuke and find me another cms.

Too bad I paid money for a design. But for the future, I know that.
 
spasticdonkey







PostPosted: Sun May 20, 2012 10:55 am Reply with quote

Sorry you feel that way. Realize we all volunteer our time here, and just because nobody had time to do your mod for you for free, does not mean there are no mods available. I just spent several weeks completing one myself Wink

Did you even try the solution I suggested earlier?

Best of luck with whatever you decide, but there is not a CMS on the planet that will "do free mods for you on request". I think you will find the community here is quite willing to help, provided you are making some effort on your own. Simply finding some mod on the web and saying it doesn't work isn't enough effort, imo.
 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1512

PostPosted: Tue May 22, 2012 4:27 am Reply with quote

hey hanver!

your nuke is running, I see. Smile The theme is very nice - clan themes are very pretty.
I can try to check it. but remember, this mod is not for the bbtonuke. have you ever seen this MOD in a nuke - if so where?

can you upload the package again?
which database table prefix have you used in RN?
 
View user's profile Send private message
hanver







PostPosted: Tue May 22, 2012 6:06 am Reply with quote

Hallo Neralex,

Ja es ist ein Standalone Mod von phpbb meiner Version. Es ist schon verbaut aber es gibt Komplikationen im Adminbereich. Wenn ich auf Abschicken klicke passiert nichts.

Somit legt er keine neuen Felder an. Dennoch sehe ich im Adminbereich alle Felder ohne Fehlermeldung.

Ich nutze es noch, da ich momentan keine Zeit hatte was anderes zu suchen. Dennoch kann ich sagen nie wieder phpnuke, denn ich hatte so viele Probleme die ich in Stunden umsetzen und anpassen mußte.
 
neralex







PostPosted: Tue May 22, 2012 6:43 am Reply with quote

Ich habe es hinbekommen Smile

Also ich mag das RavenNuke sehr gern und habe einige Pages damit laufen. Viele Modifiaktionen sind sehr alt und unsauber geschrieben. Dadurch das das RavenNuke sehr sauber gecoded ist und einige grundlegende Dinge verbessert und damit geändert wurden, laufen einige Modifikationen nicht gleich auf anhieb.

Ich kann dir nur raten, gib den Mut nicht auf, denn im RavenNuke stecken deutlich mehr Möglichkeiten individuelle Features zu realiseren, die mit anderen CMS total umständlich gelöst werden und man nicht eben mal den Code umschreiben kann, ohne gleich einen ganzen Tag damit zu verbringen.

Ich passe dir die Files entsprechend an poste sie einzeln hier, dann kannst die Mod auch im Ravennuke nutzen.

@all: sorry for the many german words, but it was easier for me to answer Smile
 
hanver







PostPosted: Tue May 22, 2012 7:12 am Reply with quote

Hmm,

was willste denn dafür haben?! Ich weiss nicht genau was angepasst werden muß. Hier hast du den Download zum aktuellen phpbb 2.023 .
[ Only registered users can see links on this board! Get registered or login! ]


Wie gesagt ich habe schon alles verbaut/eingebaut. Was mir derzeit Probleme macht ist das ich im ACP nicht die Neuen Felder adden kann da er den Submitbutton nicht korrekt weiterleitet. Danach kommt die Meldung "Seite nicht gefunden"

Edit: Ich war gerade mal auf deiner Seite: [ Only registered users can see links on this board! Get registered or login! ]
Ich brauche die Customfields nur um ein einigermaßen Vernünftige Teamübersicht zu bekommen. Da bot sich das Custom field an. Deine teamübersicht ist nicht mit Eingabefelder erweiterbar,oder?


Last edited by hanver on Wed May 23, 2012 7:00 am; edited 1 time in total 
neralex







PostPosted: Tue May 22, 2012 7:35 am Reply with quote

okay das problem liegt darin, dass die links in der function append_sid () nicht korrekt übergeben werden. demnach müssen diese nur angepasst werden. siehe dazu diese admin_profile_fields.php:

Code:
<?php

/***************************************************************************
 *                          admin_profile_fields.php
 *                            -------------------
 *   author:                Brian Shields (alias Blankety Blank Man)
 *   email:                 blanketyblankman@gmail.com
 *   description:           Dynamic content file driving the addition/editing/
 *                          deletion of custom profile fields for the Custom
 *                          Profiles MOD.
 *
 *
 ***************************************************************************/

/***************************************************************************
 *                               Version notes
 *                                 ---------
 *   1.0.0: December 31, 2005
 *   ------------------------
 *      - No longer vulnerable to SQL injection
 *      - Removed Javascript implementaion for radio & checkboxes
 *      - Added field description
 *
 *   0.0.1: December 17, 2005
 *   ------------------------
 *      - Vulnerable to SQL injection
 *      - Poorly implemented Javascript for radio and checkbox values
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB',true);

if(!empty($setmodules))
{
  $filename = basename(__FILE__);
  $module['Custom_Profile']['Add'] = $filename . '?mode=add&pfid=x';
  $module['Custom_Profile']['Edit'] = $filename . '?mode=edit&pfid=x';
  $module['Custom_Profile']['Settings'] = $filename . '?mode=settings&pfid=x';
 
  return;
}

//
// Load default header
//
$no_page_header = false;
$phpbb_root_path = './../';
require_once($phpbb_root_path . 'extension.inc');
require_once('./pagestart.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);


//
// Set mode
//
if( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) {
        $mode = ( isset( $HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
        $mode = htmlspecialchars($mode, ENT_COMPAT);
} else {
        $mode = '';
}

//
// Set pfid
//
if( isset( $HTTP_POST_VARS['pfid'] ) || isset( $HTTP_GET_VARS['pfid'] ) ) {
        $pfid = ( isset( $HTTP_POST_VARS['pfid']) ) ? $HTTP_POST_VARS['pfid'] : $HTTP_GET_VARS['pfid'];
        $pfid = htmlspecialchars($pfid, ENT_COMPAT);
} else {
        $pfid = '';
}


if($mode == 'add')
{
  $template->set_filenames(array('body' => 'admin/add_profile_field.tpl'));
 
  $template->assign_vars(array(
    'TEXT_FIELD_CHECKED' => ' checked="checked"',
    'NOT_REQUIRED_CHECKED' => ' checked="checked"',
    'ALLOW_VIEW_CHECKED' => ' checked="checked"',
    'VIEW_IN_PROFILE_CHECKED' => ' checked="checked"',
    'ABOUT_CHECKED' => ' checked="checked"',
    'NO_VIEW_IN_MEMBERLIST' => ' checked="checked"',
    'NO_VIEW_IN_TOPIC' => ' checked="checked"',
    'AUTHOR_CHECKED' => ' checked="checked"',
    'NO_LINKIFY_CHECKED' => ' checked="checked"',
   
    'L_ADD_FIELD_TITLE' => $lang['add_field_title'],
    'L_ADD_FIELD_EXPLAIN' => $lang['add_field_explain'],
   
    'S_ADD_FIELD_ACTION' => append_sid('admin_profile_fields.' .$phpEx .'?mode=update&amp;pfid=x')
    ));
}
else if ($mode == 'settings') {
   $template->set_filenames(array('body' => 'admin/edit_cpf_settings.tpl'));
   $template->assign_vars(array(
      'L_CPF_SETTINGS_TITLE' => $lang['cpf_settings_title'],
      'L_CPF_SETTINGS_EXPLAIN' => $lang['cpf_settings_explain'],
      'L_COLLAPSE_FIELDS' => $lang['collapse_fields'],
      'L_COLLAPSE_FIELDS_EXPLAIN' => $lang['collapse_fields_explain'],
      'COLLAPSE_FIELDS_CHECKED' => $board_config['collapse_fields'] == COLLAPSE_FIELDS_ON ? ' checked="checked"' : '',
      'NO_COLLAPSE_FIELDS_CHECKED' => $board_config['collapse_fields'] == COLLAPSE_FIELDS_OFF ? ' checked="checked"' : '',
      'S_CPF_SETTINGS_ACTION' => append_sid('admin_profile_fields.' .$phpEx . '?mode=change&amp;pfid=x')
   ));
}
else if ($mode == 'change') {
   $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
   $config_value = intval($HTTP_POST_VARS['collapse_fields']);
   if (($config_value == 1) || ($config_value == 0)) {
      $sql = "UPDATE " . CONFIG_TABLE . "
         SET config_value = $config_value
         WHERE config_name = 'collapse_fields'";
      if (!$db->sql_query($sql)) {
         message_die(GENERAL_ERROR,'Unable to update the config table.','',__LINE__,__FILE__,$sql);
      }
      $template->assign_vars(array(
         'MESSAGE_TITLE' => $lang['cpf_settings_updated'],
         'MESSAGE_TEXT' => $lang['cpf_settings_success']
      ));
   }
   else {
      message_die(GENERAL_ERROR,'Improper value entered.  Unable to change settings.','',__LINE__,__FILE__,$sql);
   }
}
elseif($mode == 'update')
{
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
 
  $name = htmlspecialchars($HTTP_POST_VARS['field_name']);
  if(empty($name))
  {
    message_die(GENERAL_ERROR,$lang['enter_a_name']);
  }
 
  $description = htmlspecialchars($HTTP_POST_VARS['field_description']);
 
  $type = intval($HTTP_POST_VARS['field_type']);
  $text_field_default = htmlspecialchars($HTTP_POST_VARS['text_field_default']);
  $text_field_maxlen = empty($HTTP_POST_VARS['text_field_maxlen']) ? TEXT_FIELD_MAXLENGTH : intval($HTTP_POST_VARS['text_field_maxlen']);
  $text_field_maxlen = $text_field_maxlen > TEXT_FIELD_MAXLENGTH ? TEXT_FIELD_MAXLENGTH : $text_field_maxlen;
  $text_area_default = htmlspecialchars($HTTP_POST_VARS['text_area_default']);
  $text_area_maxlen = empty($HTTP_POST_VARS['text_area_maxlen']) ? TEXTAREA_MINLENGTH : intval($HTTP_POST_VARS['text_area_maxlen']);
  $text_area_maxlen = $text_area_maxlen > TEXTAREA_MAXLENGTH ? TEXTAREA_MAXLENGTH : $text_area_maxlen;
 
  $radio_values = htmlspecialchars($HTTP_POST_VARS['radio_values']);
  $radio_default_value = htmlspecialchars($HTTP_POST_VARS['radio_default_value']);
  $radio_values = explode("\n",str_replace("\r",'',$radio_values));
  if(empty($radio_default_value))
  {
    $radio_default_value = $radio_values[0];
  }
  $temp = '';
  foreach($radio_values as $val)
  {
    $temp .= $val . ',';
  }
  $radio_values = substr($temp,0,strlen($temp)-1);
 
  $checkbox_values = htmlspecialchars($HTTP_POST_VARS['checkbox_values']);
  $check_default_values = htmlspecialchars($HTTP_POST_VARS['check_default_values']);
  $checkbox_values = explode("\n",str_replace("\r",'',$checkbox_values));
  if(!empty($check_default_values))
  {
    $check_default_values = explode("\n",str_replace("\r",'',$check_default_values));
    $temp = '';
    foreach($check_default_values as $val)
    {
      $temp .= $val . ',';
    }
    $check_default_values = substr($temp,0,strlen($temp)-1);
  }
  $temp = '';
  foreach($checkbox_values as $val)
  {
    $temp .= $val . ',';
  }
  $checkbox_values = substr($temp,0,strlen($temp)-1);
 
  $required = intval($HTTP_POST_VARS['required']);
  $user_can_view = intval($HTTP_POST_VARS['user_can_view']);
  $view_in_profile = intval($HTTP_POST_VARS['view_in_profile']);
  $profile_location = intval($HTTP_POST_VARS['profile_location']);
  $view_in_memberlist = intval($HTTP_POST_VARS['view_in_memberlist']);
  $view_in_topic = intval($HTTP_POST_VARS['view_in_topic']);
  $signature_wrap = intval($HTTP_POST_VARS['signature_wrap']);
  $linkify = intval($HTTP_POST_VARS['linkify']);
 
  if($pfid == 'x')
  {
    $sql = "SELECT field_name FROM " . PROFILE_FIELDS_TABLE . "
      WHERE field_name='$name'";
    if(!($result = $db->sql_query($sql)))
    {
      message_die(GENERAL_ERROR,'Could not query database for field name information','',__LINE__,__FILE__,$sql);
    }
    $temp = $db->sql_fetchrowset($result);
    if(!empty($temp))
    {
      message_die(GENERAL_ERROR,$lang['field_exists']);
    }
  }
 
  if($pfid == 'x')
  {
    $die_message = 'Could not insert new profile field';
  }
  else
  {
    $die_message = 'Could not update profile information';
  }
 
  if($pfid != 'x')
  {
    $sql = "SELECT field_name FROM " . PROFILE_FIELDS_TABLE . "
      WHERE field_id = $pfid";
    if(!($result = $db->sql_query($sql)))
    {
      message_die(GENERAL_ERROR,'Could not find old name','',__LINE__,__FILE__,$sql);
    }
    $old_name = $db->sql_fetchrow($result);
    $old_name = text_to_column($old_name['field_name']);
  }
 
  $name_display = $name;
  $name = str_replace("\'","''",text_to_column($name));
  $description = str_replace("\'","''",$description);
  $text_field_default = str_replace("\'","''",$text_field_default);
  $text_area_default = str_replace("\'","''",$text_area_default);
  $text_area_maxlen = str_replace("\'","''",$text_area_maxlen);
  $radio_default_value = str_replace("\'","''",$radio_default_value);
  $radio_values = str_replace("\'","''",$radio_values);
  $check_default_values = str_replace("\'","''",$check_default_values);
  $checkbox_values = str_replace("\'","''",$checkbox_values);
 
  if($pfid == 'x')
  {
    $sql = "INSERT INTO " . PROFILE_FIELDS_TABLE . "
      (field_name, field_description, field_type, text_field_default, text_field_maxlen, text_area_default, text_area_maxlen,
      radio_button_default, radio_button_values, checkbox_default, checkbox_values, is_required,
      users_can_view, view_in_profile, profile_location, view_in_memberlist, view_in_topic, topic_location, linkify)
      VALUES ('$name_display','$description',$type,'$text_field_default',$text_field_maxlen,'$text_area_default',$text_area_maxlen,
      '$radio_default_value','$radio_values','$check_default_values','$checkbox_values',$required,$user_can_view,
      $view_in_profile,$profile_location,$view_in_memberlist,$view_in_topic,$signature_wrap,$linkify)";
  }
  else
  {
    $sql = "UPDATE " . PROFILE_FIELDS_TABLE . "
      SET field_name = '$name_display',
        field_description = '$description',
        field_type = $type,
        text_field_default = '$text_field_default',
        text_field_maxlen = $text_field_maxlen,
        text_area_default = '$text_area_default',
        text_area_maxlen = $text_area_maxlen,
        radio_button_default = '$radio_default_value',
        radio_button_values = '$radio_values',
        checkbox_default = '$check_default_values',
        checkbox_values = '$checkbox_values',
        is_required = $required,
        users_can_view = $user_can_view,
        view_in_profile = $view_in_profile,
        profile_location = $profile_location,
        view_in_memberlist = $view_in_memberlist,
        view_in_topic = $view_in_topic,
        topic_location = $signature_wrap,
        linkify = $linkify
      WHERE field_id = $pfid";
  }
 
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,$die_message,'',__LINE__,__FILE__,$sql);
  }
 
  if($pfid != 'x')
  {
    switch($type)
    {
      case TEXT_FIELD: $col_type = 'VARCHAR('.$text_field_maxlen.')'; break;
      case TEXTAREA:
      case RADIO:
      case CHECKBOX: $col_type = 'TEXT'; break;
    }
    $sql = "ALTER TABLE " . USERS_TABLE . "
      CHANGE $old_name $name $col_type";
    if(!$db->sql_query($sql))
    {
      message_die(GENERAL_ERROR,'Could not change column name in '.USERS_TABLE,'',__LINE__,__FILE__,$sql);
    }
  }
 
  $sql = "ALTER TABLE " . USERS_TABLE . "
    ADD $name";
  switch($type)
  {
    case TEXT_FIELD:
      $sql .= " varchar($text_field_maxlen) DEFAULT '" . $text_field_default . "'";
      break;
    case RADIO:
      $sql .= " varchar(255) DEFAULT '" . $radio_default_value . "'";
      break;
    case TEXTAREA:
    case CHECKBOX:
      $sql .= " text";
      break;
  }
 
  if($pfid == 'x' && !$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not expand users table for new profile field.','',__LINE__,__FILE__,$sql);
  }
 
  $sql = "SELECT user_id FROM " . USERS_TABLE;
  if(!($result = $db->sql_query($sql)))
  {
    message_die(GENERAL_ERROR,'Could not retrieve use and profile information','',__LINE__,__FILE__,$sql);
  }
 
  $user_id_array = array();
  while($temp = $db->sql_fetchrow($result))
  {
    $user_id_array[] = $temp['user_id'];
  }
 
  if($pfid == 'x')
  {
    foreach($user_id_array as $user_id)
    {
      $sql = "UPDATE " . USERS_TABLE . "
        SET $name = %s
        WHERE user_id = " . $user_id . "";
     
      switch($type)
      {
        case TEXT_FIELD:
          $val = $text_field_default;
          break;
        case TEXTAREA:
          $val = $text_area_default;
          break;
        case RADIO:
          $val = $radio_default_value;
          break;
        case CHECKBOX:
          $val = $check_default_values;
          break;
      }
     
      $sql = sprintf($sql,"'$val'");
     
      if(!$db->sql_query($sql))
      {
        message_die(GENERAL_ERROR,'Could not update users with default values','',__LINE__,__FILE__,$sql);
      }
    }
  }
 
  $template->assign_vars(array(
    'MESSAGE_TITLE' => $pfid == 'x' ? $lang['profile_field_created'] : $lang['profile_field_updated'],
    'MESSAGE_TEXT' => $lang['field_success'] . '<br /><br />' . $create_second_field_link));
}
elseif($mode == 'edit')
{
  if($pfid == 'x')
  {
    $template->set_filenames(array('body' => 'admin/add_profile_field_list.tpl'));
   
    $template->assign_vars(array(
      'L_PROFILE_FIELD_LIST_TITLE' => $lang['profile_field_list'],
      'L_PROFILE_FIELD_LIST_EXPLAIN' => $lang['profile_field_list_explain'],
      'L_ID' => $lang['profile_field_id'],
      'L_NAME' => $lang['profile_field_name'],
      'L_ACTION' => $lang['profile_field_action'],
      'L_EDIT' => $lang['Edit'],
      'L_DELETE' => $lang['Delete']
      ));
   
    $profile_rows = get_fields();
   
    if(count($profile_rows) == 0)
    {
      $template->assign_block_vars('switch_no_fields',array('NO_FIELDS_EXIST' => $lang['no_profile_fields_exist']));
    }
    else
    {
      $template->assign_block_vars('switch_fields',array());
     
      foreach($profile_rows as $col => $val)
      {
        $row = $col % 2 == 0 ? 'row1' : 'row2';
        $id = $val['field_id'];
        $name = $val['field_name'];
       
        $edit_url = append_sid('admin_profile_fields.' .$phpEx . '?mode=edit&amp;pfid=' . $id);
        $delete_url = append_sid('admin_profile_fields.' .$phpEx . '?mode=delete&amp;pfid=' . $id);
       
        $template->assign_block_vars('switch_fields.profile_fields',array(
          'ROW_CLASS' => $row,
          'ID' => $id,
          'NAME' => $name,
         
          'U_PROFILE_FIELD_EDIT' => $edit_url,
          'U_PROFILE_FIELD_DELETE' => $delete_url
          ));
      }
    }
  }
  else
  {
    $template->set_filenames(array('body' => 'admin/add_profile_field.tpl'));
   
    $profile_rows = get_fields('WHERE field_id = ' . $pfid,false);
   
    $template->assign_vars(array(
      'FIELD_NAME' => $profile_rows['field_name'],
      'FIELD_DESCRIPTION' => $profile_rows['field_description'],
      'TEXT_FIELD_CHECKED' => $profile_rows['field_type'] == TEXT_FIELD ? ' checked="checked"' : '',
      'TEXTAREA_CHECKED' => $profile_rows['field_type'] == TEXTAREA ? ' checked="checked"' : '',
      'RADIO_CHECKED' => $profile_rows['field_type'] == RADIO ? ' checked="checked"' : '',
      'CHECKBOX_CHECKED' => $profile_rows['field_type'] == CHECKBOX ? ' checked="checked"' : '',
      'TEXT_FIELD_DEFAULT' => $profile_rows['text_field_default'],
      'TEXT_FIELD_MAXLENGTH' => $profile_rows['text_field_maxlen'],
      'TEXTAREA_DEFAULT' => $profile_rows['text_area_default'],
      'TEXTAREA_MAXLENGTH' => $profile_rows['text_area_maxlen'],
      'REQUIRED_CHECKED' => $profile_rows['is_required'] == REQUIRED ? ' checked="checked"' : '',
      'NOT_REQUIRED_CHECKED' => $profile_rows['is_required'] == NOT_REQUIRED ? ' checked="checked"' : '',
      'ALLOW_VIEW_CHECKED' => $profile_rows['users_can_view'] == ALLOW_VIEW ? ' checked="checked"' : '',
      'DISALLOW_VIEW_CHECKED' => $profile_rows['users_can_view'] == DISALLOW_VIEW ? ' checked="checked"' : '',
      'VIEW_IN_PROFILE_CHECKED' => $profile_rows['view_in_profile'] == VIEW_IN_PROFILE ? ' checked="checked"' : '',
      'NO_VIEW_IN_PROFILE_CHECKED' => $profile_rows['view_in_profile'] == NO_VIEW_IN_PROFILE ? ' checked="checked"' : '',
      'CONTACTS_CHECKED' => $profile_rows['profile_location'] == CONTACTS ? ' checked="checked"' : '',
      'ABOUT_CHECKED' => $profile_rows['profile_location'] == ABOUT ? ' checked="checked"' : '',
      'VIEW_IN_MEMBERLIST' => $profile_rows['view_in_memberlist'] == VIEW_IN_MEMBERLIST ? ' checked="checked"' : '',
      'NO_VIEW_IN_MEMBERLIST' => $profile_rows['view_in_memberlist'] == NO_VIEW_IN_MEMBERLIST ? ' checked="checked"' : '',
      'VIEW_IN_TOPIC' => $profile_rows['view_in_topic'] == VIEW_IN_TOPIC ? ' checked="checked"' : '',
      'NO_VIEW_IN_TOPIC' => $profile_rows['view_in_topic'] == NO_VIEW_IN_TOPIC ? ' checked="checked"' : '',
      'AUTHOR_CHECKED' => $profile_rows['topic_location'] == AUTHOR ? ' checked="checked"' : '',
      'ABOVE_SIG_CHECKED' => $profile_rows['topic_location'] == ABOVE_SIGNATURE ? ' checked="checked"' : '',
      'BELOW_SIG_CHECKED' => $profile_rows['topic_location'] == BELOW_SIGNATURE ? ' checked="checked"' : '',
      'RADIO_VALUES' => str_replace(',',"\r\n",$profile_rows['radio_button_values']),
      'RADIO_DEFAULT' => $profile_rows['radio_button_default'],
      'CHECKBOX_VALUES' => str_replace(',',"\r\n",$profile_rows['checkbox_values']),
      'CHECKBOX_DEFAULT' => str_replace(',',"\r\n",$profile_rows['checkbox_default']),
      'LINKIFY_CHECKED' => $profile_rows['linkify'] == LINKIFY_ON ? ' checked="checked"' : '',
      'NO_LINKIFY_CHECKED' => $profile_rows['linkify'] == LINKIFY_OFF ? ' checked="checked"' : '',
     
      'L_ADD_FIELD_TITLE' => $lang['edit_field_title'],
      'L_ADD_FIELD_EXPLAIN' => $lang['edit_field_explain'],
     
      'S_ADD_FIELD_ACTION' => append_sid('admin_profile_fields.' .$phpEx . '?mode=update&amp;pfid=' . $pfid)
      ));
  }
}
elseif($mode == 'delete')
{
  $field_name = get_fields('WHERE field_id = ' . $pfid,false,'field_name');
  $name = text_to_column($field_name['field_name']);
 
  $del_link = '<a href="' . append_sid('admin_profile_fields.' .$phpEx . '?mode=confirmdelete&amp;pfid=' . $pfid . '&amp;name=' . $name) . '">' . $lang['Yes'] . '</a>';
  $nodel_link = sprintf($lang['index_link'],$lang['No']);
 
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
  $template->assign_vars(array(
    'MESSAGE_TITLE' => sprintf($lang['double_check_delete'],$field_name['field_name']),
    'MESSAGE_TEXT' => $del_link . ' &nbsp; ' . $nodel_link
    ));
}
elseif($mode == 'confirmdelete')
{
  $sql = "DELETE FROM " . PROFILE_FIELDS_TABLE . "
    WHERE field_id = $pfid";
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not delete profile form database','',__LINE__,__FILE__,$sql);
  }
 
  $name = $HTTP_GET_VARS['name'];
  $sql = "ALTER TABLE " . USERS_TABLE . "
    DROP COLUMN $name";
  if(!$db->sql_query($sql))
  {
    message_die(GENERAL_ERROR,'Could not remove column from '.USERS_TABLE,'',__LINE__,__FILE__,$sql);
  }
 
  $template->set_filenames(array('body' => 'admin/admin_message_body.tpl'));
  $template->assign_vars(array(
    'MESSAGE_TITLE' => $lang['field_deleted'],
    'MESSAGE_TEXT' => $lang['click_here_here']
    ));
}

$template->assign_vars(array(
  'L_NEW_FIELD_NAME' => $lang['add_field_name'],
  'L_NEW_FIELD_EXPLAIN' => $lang['add_field_name_explain'],
  'L_NEW_FIELD_DESCRIPTION' => $lang['add_field_description'],
  'L_NEW_FIELD_DESCRIPTION_EXPLAIN' => $lang['add_field_description_explain'],
  'L_NEW_FIELD_TYPE' => $lang['add_field_type'],
  'L_NEW_FIELD_TYPE_EXPLAIN' => $lang['edit_field_type_explain'],
  'L_REQUIRED_FIELD' => $lang['add_field_required'],
  'L_REQUIRED_FIELD_EXPLAIN' => $lang['add_field_required_explain'],
  'L_USER_CAN_VIEW' => $lang['add_field_user_can_view'],
  'L_USER_CAN_VIEW_EXPLAIN' => $lang['add_field_user_can_view_explain'],
  'L_TEXTAREA' => $lang['textarea'],
  'L_TEXTAREA_EXAMPLE' => $lang['textarea_example'],
  'L_TEXT_FIELD' => $lang['text_field'],
  'L_TEXT_FIELD_EXAMPLE' => $lang['text_field_example'],
  'L_RADIO' => $lang['radio'],
  'L_RADIO_EXAMPLE' => $lang['radio_example'],
  'L_CHECKBOX' => $lang['checkbox'],
  'L_CHECKBOX_EXAMPLE' => $lang['checkbox_example'],
  'L_VIEW_IN_PROFILE' => $lang['view_in_profile'],
  'L_VIEW_IN_MEMBERLIST' => $lang['view_in_memberlist'],
  'L_VIEW_IN_TOPIC' => $lang['view_in_topic'],   
  'L_PROFILE_LOCATIONS_EXPLAIN' => $lang['profile_locations_explain'],
  'L_CONTACTS_COLUMN' => $lang['contacts_column'],
  'L_ABOUT_COLUMN' => $lang['about_column'],   
  'L_TOPIC_LOCATIONS_EXPLAIN' => $lang['topic_locations_explain'],
  'L_ABOVE_SIGNATURE' => $lang['above'] . $lang['Signature'],
  'L_BELOW_SIGNATURE' => $lang['below'] . $lang['Signature'],
  'L_AUTHOR_COLUMN' => $lang['author_column'],   
  'L_YES' => $lang['Yes'],
  'L_NO' => $lang['No'],   
  'L_ADMIN_SETTINGS' => $lang['add_field_admin'],
  'L_GENERAL_SETTINGS' => $lang['add_field_general'],
  'L_VIEW_SETTINGS' => $lang['add_field_view'],
  'L_TEXT_FIELD_SETTINGS' => $lang['add_field_text_field'],
  'L_TEXT_AREA_SETTINGS' => $lang['add_field_text_area'],
  'L_RADIO_BUTTON_SETTINGS' => $lang['add_field_radio_button'],
  'L_CHECKBOX_SETTINGS' => $lang['add_field_checkbox'],   
  'L_DEFAULT_VALUE' => $lang['default_value'],
  'L_DEFAULT_VALUE_EXPLAIN' => $lang['default_value_explain'],
  'L_DEFAULT_VALUE_RADIO_EXPLAIN' => $lang['default_value_radio_explain'],
  'L_DEFAULT_VALUE_CHECKBOX_EXPLAIN' => $lang['default_value_checkbox_explain'],
  'L_MAX_LENGTH' => $lang['max_length'],
  'L_MAX_LENGTH_TEXT_FIELD_EXPLAIN' => $lang['max_length_explain'] . sprintf($lang['max_length_value'],TEXT_FIELD_MINLENGTH,TEXT_FIELD_MAXLENGTH),
  'L_MAX_LENGTH_TEXTAREA_EXPLAIN' => $lang['max_length_explain'] . sprintf($lang['max_length_value'],TEXTAREA_MINLENGTH,TEXTAREA_MAXLENGTH),
  'L_AVAILABLE_VALUES' => $lang['available_values'],
  'L_AVAILABE_VALUES_EXPLAIN' => $lang['available_values_explain'],   
  'L_VIEW_DISCLAIMER' => $lang['add_field_view_disclaimer'],
  'L_SUBMIT' => $lang['Submit'],
  'L_RESET' => $lang['Reset'],
  'L_LINKIFY' => $lang['linkify'],
  'L_LINKIFY_EXPLAIN' => $lang['linkify_explain'],
 
  'S_COLLAPSE_FIELDS_ON' => COLLAPSE_FIELDS_ON,
  'S_COLLAPSE_FIELDS_OFF' => COLLAPSE_FIELDS_OFF,
  'S_LINKIFY_ON' => LINKIFY_ON,
  'S_LINKIFY_OFF' => LINKIFY_OFF,
  'S_TEXT_FIELD' => TEXT_FIELD,
  'S_TEXTAREA' => TEXTAREA,
  'S_RADIO' => RADIO,
  'S_CHECKBOX' => CHECKBOX,
  'S_REQUIRED' => REQUIRED,
  'S_NOT_REQUIRED' => NOT_REQUIRED,
  'S_ALLOW_VIEW' => ALLOW_VIEW,
  'S_DISALLOW_VIEW' => DISALLOW_VIEW,
  'S_VIEW_IN_PROFILE' => VIEW_IN_PROFILE,
  'S_NO_VIEW_IN_PROFILE' => NO_VIEW_IN_PROFILE,
  'S_CONTACTS' => CONTACTS,
  'S_ABOUT' => ABOUT,
  'S_VIEW_IN_MEMBERLIST' => VIEW_IN_MEMBERLIST,
  'S_NO_VIEW_IN_MEMBERLIST' => NO_VIEW_IN_MEMBERLIST,
  'S_VIEW_IN_TOPIC' => VIEW_IN_TOPIC,
  'S_NO_VIEW_IN_TOPIC' => NO_VIEW_IN_TOPIC,
  'S_AUTHOR' => AUTHOR,
  'S_ABOVE_SIGNATURE' => ABOVE_SIGNATURE,
  'S_BELOW_SIGNATURE' => BELOW_SIGNATURE
  ));

$template->pparse('body');

include($phpbb_root_path . 'admin/page_footer_admin.' . $phpEx);
?>


desweiteren muss das dann auch in der lang_admin.php angepasst werden.

Code:
$lang['new_field_link'] = '<a href="'.append_sid('admin_profile_fields.' .$phpEx .'?mode=add&amp;pfid=x').'">%s</a>';

$lang['edit_field_link'] = '<a href="'.append_sid('admin_profile_fields.' .$phpEx .'?mode=edit&amp;pfid=x').'">%s</a>';
$lang['index_link'] = '<a href="'.append_sid('admin_profile_fields.' .$phpEx .'?mode=edit&amp;pfid=x').'">%s</a>';


Die Teamübersicht auf ist ein komplett selbstgeschriebenes und speziell angepasstes Addon. Warum baust du dir da nicht einfach ein kleines Modul. Du kannst doch im Your_Account Modul eigene Felder anlegen, die dann auch bei der Registrierung und in der Profilübersicht angezeigt werden.

Du erstellst dir im eigenen Modul einen Query und liest einfach die Felder aus. Schon hast du deine Teamliste.


Last edited by neralex on Mon Jun 25, 2012 12:26 pm; edited 2 times in total 
hanver







PostPosted: Tue May 22, 2012 7:38 am Reply with quote

Achso. vielen Dank für deine Hilfe. Ich werde es nun versuchen und mich ggf. melden.
 
hanver







PostPosted: Tue May 22, 2012 7:56 am Reply with quote

Ok, klappt soweit Prima... nur wenn ich ein feld eingetragen habe, und auf den Button klicke: Hier klicken um zum Ausgangspunkt zurück zu gelanden, sagt er mir Seite nicht gefunden.

Diese Stelle ist nun nicht Lebenswichtig, aber wenn man es macht dann sollten wir es Vernünftig machen. Wo ändere ich das noch?
 
neralex







PostPosted: Tue May 22, 2012 9:23 am Reply with quote

...das sind die Einträge des language files, die du noch ändern musst, wie im zweiten Snippet dargestellt.

Hier das Beispiel für das Modul:

Feld anlegen als admin in Your_Account:
Image

Feld in im Profil:
Image

Hier der Code für das Modul, ich nenne es mal Team. Du legst einfach einen Ordner im Modules-Verzeichnis mit dem Namen Team an, erstellst dort eine index.php und kopierst diesen Code dort rein.Ddann brauchst diese alte Foren-Modifikation nicht nutzen, da dir Your_Account alles bietet und sich besser verwalten lässt.

Code:
<?php

/******************************************************
file: index.php  module: Team
******************************************************/

if (!defined('MODULE_FILE')) {
   die ("You can't access this file directly...");
}
define('INDEX_FILE', true);
$module_name = basename(dirname(__FILE__));
global $language, $prefix, $user_prefix, $db, $bgcolor1, $bgcolor2;
include_once 'header.php';
OpenTable();
   echo '<div style="display:inline-block; border:1px solid;">'."\n";         
   echo '<ul style="list-style:none; margin:0; padding:0;">'."\n";
   echo '   <li style="float:left; width:20px; padding:2px; text-align:center;">ID </li>'."\n";
   echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">Name</li>'."\n";
   echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">From</li>'."\n";
   echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">Your 1st Field</li>'."\n";
   echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">Your 2nd Field</li>'."\n";
   echo '</ul>'."\n";            
   $fid1 = 1; // 1st field id
   $fid2 = 2; // 2nd field id
   $usrquery = $db->sql_query('SELECT `user_id`, `username`, `user_from` FROM `' . $user_prefix . '_users` ORDER BY `username` ASC, `user_id` ASC');
   while (list($user_id, $username, $user_from) = $db->sql_fetchrow($usrquery)) {
      list($value1) = $db->sql_fetchrow($db->sql_query('SELECT `value` FROM `' . $user_prefix . '_users_field_values` WHERE `fid` = \'' . $fid1 . '\' AND `uid` = \'' . $user_id . '\''));
      list($value2) = $db->sql_fetchrow($db->sql_query('SELECT `value` FROM `' . $user_prefix . '_users_field_values` WHERE `fid` = \'' . $fid2 . '\'  AND `uid` = \'' . $user_id . '\''));
      echo '<ul style=" clear:both; list-style:none; margin:0; padding:0; border-top:1px solid;">'."\n";
      echo '   <li style="clear:both; float:left; width:20px; padding:2px; text-align:center;">' . $user_id . '</li>'."\n";
      echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">' . $username . '</li>'."\n";
      echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">' . ($user_from != '' ? $user_from : '&nbsp;') . '</li>'."\n";
      echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">' . ($value1 != '' ? $value1 : '&nbsp;') . '</li>'."\n";
      echo '   <li style="float:left; width:200px; padding:2px; border-left:1px solid;">' . ($value2 != '' ? $value2 : '&nbsp;') . '</li>'."\n";
      echo '</ul>'."\n";
   }
   echo '</div>'."\n";
CloseTable();
include_once 'footer.php';
?>


Last edited by neralex on Tue May 22, 2012 11:04 am; edited 1 time in total 
hanver







PostPosted: Tue May 22, 2012 10:36 am Reply with quote

Wir reden aneinander vorbei.... Das was du mir nun gepostet hast ist nicht das Forum Plugin. Wenn man die Standard Übersicht in TeamMitglieder und sonstige Mitglieder einordnen kann dann würde ich mich auch mit dem Standard Field zufrieden setzten.

Das ist ja mein Problem Sad
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©