Moderator: Integra Moderator
"HelterSkelter";p="23097" wrote:check that all your profilcpdefdef_* files are chmodded to 666
sometimes your ftp says they are set to 666, but when you check them in your webhost file manager they may still be set to 644
<?php
/***************************************************************************
* def_userfuncs.php
* -----------------
* begin : 04/10/2003
* copyright : Ptirhiik
* email : <a>Ptirhiik@rpgnet.clanmckeen.com</a>
*
* version : 1.0.5 - 04/11/2003
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
//---------------------------------------------------------------------
//
// function pcp_parse_def() : parse a sql def, getting all the tables linked and setting their identifiers
//
//---------------------------------------------------------------------
function pcp_parse_def($sql_def, $view_userdata, &$tables_used)
{
global $phpEx, $phpbb_root_path;
global $board_config;
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
// nothing to parse
if ( empty($sql_def) ) return '';
// change the [view.field_name] by its value $view_userdata[$field_name]
$sql_ids = array();
preg_match_all("|[view.([^]].*)]|U", $sql_def, $sql_ids );
if (count($sql_ids) > 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i </a>sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not read list informations', '', __LINE__, __FILE__, '<table><tr><td><span><pre>' . $sql . '</pre></span></td></tr></table>');
}
$values = array();
while ( $row = $db->sql_fetchrow($result) )
{
$values[ $row['_list_key'] ] = array( 'txt' => $row['_list_txt'], 'img' => $row['_list_img'] );
}
// transfert in values
@reset($values);
while ( list($key, $value) = @each($values) )
{
$values_list[$list_name]['values'][$key] = $value;
}
$values_list[$list_name]['done'] = true;
$done = true;
}
}
// force txt if nothing ask for display
if ( !$field_data['txt'] && !$field_data['img'] )
{
$field_data['txt'] = true;
}
@reset($values_list[$list_name]['values']);
while ( list( $key, $value_data) = @each($values_list[$list_name]['values']) )
{
$txt = '';
$img = '';
if ( $field_data['txt'] )
{
$txt = isset($lang[ $value_data['txt'] ]) ? $lang[ $value_data['txt'] ] : $value_data['txt'];
}
if ( $field_data['img'] )
{
$img = isset($images[ $value_data['img'] ]) ? $images[ $value_data['img'] ] : $value_data['img'];
}
$value = !empty($img) ? '<img>' : '';
$value .= ( !empty($img) && !empty($txt) ) ? ' ' : '';
$value .= $txt;
if ( !empty($value) )
{
$res[$value] = $key;
}
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_field() : get the field definition
//
//---------------------------------------------------------------------
function pcp_get_field( $field_cfg, $map_name='', $field_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
$found = false;
if ( empty($field_name) )
{
@reset($user_fields);
while ( list($field_name, $field_data) = @each($user_fields) )
{
$found = ($field_data[$field_name]['input_id'] == $field_cfg);
if ( $found )
{
break;
}
}
if ( !$found )
{
$field_name = $field_cfg;
}
}
// get the field definition
$field_data = $user_fields[$field_name];
// overwrite by the map definition
@reset($user_maps[$map_name]['fields'][$field_name]);
while ( list($key, $value) = @each($user_maps[$map_name]['fields'][$field_name]) )
{
$field_data[$key] = $value;
}
// parse the default value
if ( !empty($field_data['default']) || ($field_data['default'] == "0") )
{
$tables_used = array();
$field_data['default'] = pcp_parse_def($field_data['default'], $userdata, $tables_used);
}
// solve values list
if ( !empty($field_data['values']) && is_string($field_data['values']) )
{
// if list drop force the img/txt set
if ( ($field_data['get_mode'] == 'LIST_DROP') && $field_data['img'] )
{
$field_data['img'] = false;
$field_data['txt'] = true;
}
$field_data['values'] = pcp_get_values_list($field_name, $field_data, $map_name);
if ( empty($field_data['values']) )
{
$field_data['default'] = '';
}
else
{
// check if the default value is in the values list
@reset($field_data['values']);
$found = false;
while ( list($value, $key) = @each($field_data['values']) )
{
$found = ( $field_data['default'] == $key );
if ( $found )
{
break;
}
}
if ( !$found )
{
$first_key = '';
@reset($field_data['values']);
list($first_value, $first_key) = @each($field_data['values']);
$field_data['default'] = $first_key;
}
}
}
// get back values
$res = $field_data;
// fill the necessary entries for mods_settings
$res['user'] = $field_name;
if ( !empty($res['get_mode']) )
{
$res['type'] = $res['get_mode'];
}
else if ( !empty($res['get_func']) || !empty($res['chk_func']) )
{
$res['type'] = '';
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_mods_setting_menu() : get the menu values for the mods settings
//
//---------------------------------------------------------------------
function pcp_get_mods_setting_menu( $menu_id, $map_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
if ( !empty($map_name) && isset($user_maps[$map_name]) )
{
$res = $user_maps[$map_name][$menu_id];
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_mods_setting_config_fields() : get the field definition from a map
//
//---------------------------------------------------------------------
function pcp_get_mods_setting_config_fields( $map_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
if ( isset($user_maps[$map_name]) )
{
@reset($user_maps[$map_name]['fields']);
while ( list($field_name, $field_data) = @each($user_maps[$map_name]['fields']) )
{
$field_cfg = $field_data['input_id'];
if ( empty($field_cfg) )
{
$field_cfg = $field_name;
}
$res[$field_cfg] = pcp_get_field($field_cfg, $map_name, $field_name);
}
}
return $res;
}
// PCP Extra :: Replaced the full function
// function added by edwin for fixing override problem...
function display_field($userfield, &$viewdata){
global $board_config, $userdata, $user_fields;
/* You cannot unscrable scrambled eggs... So re-write the logic!
edwin's logic:
If override
yes: if value 0 ==> hide
if value 1 ==> Show
if value 2 ==> Show Buddy, hide Ignore
+ override the view_user value
==> this is for all non allow fields
when a generic field is created the value in config is not 0,1 or 2
but the exact needed value.
Ex: if username=dumbo && override=yes
then set dumbo as view_userdata['username']
No: User value?
0 ==> hide
1 ==> show
2 ==> Show buddy, hide Ignore
Special cases
1) guest user logged in ==> hide
2) user viewing guest user ==> hide
3) admin viewing user ==> show + override the view_user value
*/
// tha vals
$config_value = $board_config[$userfield];
$override = $board_config[$userfield.'_over'];
$user_value = $viewdata[$userfield];
$display = false;
// let's go!
// special cases
if ($userdata['user_id'] == ANONYMOUS) {
// guest user logged in ==> hide
$display = false;
} else if ($viewdata['viewed_by_admin']) {
// 3) show + override the view_user value
$display = true;
if($override){
$viewdata[$userfield] = $config_value;
}
} else {
// start edwin's logic:
if ($override){
$real_value = $config_value;
// override the value of view_userdata
$viewdata[$userfield] = $config_value;
} else {
$real_value = $user_value;
}
switch ($real_value){
case YES:
// show
$display = true;
break;
case FRIEND_ONLY:
// show buddy, hide Ignore
// if page calls the pcp_get_class_check() directly for valmidating a class
// the getBuddyStatus() hasn't been called
// ==> call it otherwise this returns false!
if(!isset($viewdata['user_ignore']) || !isset($viewdata['user_friend'])){
getBuddyStatus($viewdata);
}
if ($viewdata['user_ignore']){
$display = false;
} else if ($viewdata['user_friend']){
$display = true;
} else {
$display = false;
}
break;
default:
// means NO, 0 or NULL ==> non allow field is NULL
// hide
$display = false;
break;
}
}
// yes, yes, yes... we know it now so no good of keeping thus return it...
return $display;
}
function preProcessUserConfig(&$viewdata){
global $userdata;
// stuff to do before user buttons are send to the template
// set the admin for use inside my functions...
$viewdata['viewed_by_admin'] = is_admin($userdata);
// set online
$viewdata['user_online'] = ( $viewdata['user_session_time'] >= (time()-300) );
// correct pm
$viewdata['user_pm'] = pcp_get_class_check('pm', $viewdata);
// get buddy status
getBuddyStatus($viewdata);
}
function postProcessUserConfig(&$viewdata){
// stuff to do after user buttons are send to the template
global $userdata;
// sig :: hide when user do not want to see it...
if (!$userdata['user_viewsig'] || !$viewdata['user_allowsignature'])
{
$viewdata['user_sig'] = '';
}
}
function getBuddyStatus(&$viewdata){
global $db, $userdata;
$id = $userdata['user_id'];
$viewid = $viewdata['user_id'];
if($id == $viewid){
// you are always buddy of yourself!
$viewdata['user_friend'] = 1;
$viewdata['user_ignore'] = 0;
$viewdata['user_visible'] = 1;
} else {
$sql = "SELECT * FROM " . BUDDYS_TABLE . "
WHERE (user_id=$id AND buddy_id=$viewid) OR (user_id=$viewid AND buddy_id=$id)";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get buddy information', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
if ( $row['user_id'] != $viewid )
{
$viewdata['user_my_friend'] = !$row['buddy_ignore'];
$viewdata['user_my_ignore'] = $row['buddy_ignore'];
$viewdata['user_my_visible'] = $row['buddy_visible'];
}
else
{
if($viewdata['viewed_by_admin']){
// admin is always the friend of the user being viewed
$viewdata['user_friend'] = 1;
$viewdata['user_ignore'] = 0;
$viewdata['user_visible'] = 1;
} else {
$viewdata['user_friend'] = !$row['buddy_ignore'];
$viewdata['user_ignore'] = $row['buddy_ignore'];
$viewdata['user_visible'] = $row['buddy_visible'];
}
}
}
}
}
?>
def_userfields.php 68 k 0666
def_userfields_phpbb.php 6 k 0666
def_userfuncs.php 27 k 0666
def_userfuncs_album.php 2 k 0666
def_userfuncs_bhere.php 0 k 0666
def_userfuncs_cash.php 6 k 0666
def_userfuncs_custom.php 6 k 0666
def_userfuncs_skype.php 1 k 0666
def_userfuncs_std.php 39 k 0666
def_userfuncs_viewonline.php 7 k 0666
def_userfuncs_vlist.php 2 k 0666
def_userfuncs_warning.php 1 k 0666
def_usermaps.php 39 k 0666
index.html 0 k 0644
<?php
/***************************************************************************
* def_userfuncs.php
* -----------------
* begin : 04/10/2003
* copyright : Ptirhiik
* email : <a>Ptirhiik@rpgnet.clanmckeen.com</a>
*
* version : 1.0.5 - 04/11/2003
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
//---------------------------------------------------------------------
//
// function pcp_parse_def() : parse a sql def, getting all the tables linked and setting their identifiers
//
//---------------------------------------------------------------------
function pcp_parse_def($sql_def, $view_userdata, &$tables_used)
{
global $phpEx, $phpbb_root_path;
global $board_config;
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
// nothing to parse
if ( empty($sql_def) ) return '';
// change the [view.field_name] by its value $view_userdata[$field_name]
$sql_ids = array();
preg_match_all("|[view.([^]].*)]|U", $sql_def, $sql_ids );
if (count($sql_ids) > 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i <count> 0)
{
for ($i = 0; $i </a>sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not read list informations', '', __LINE__, __FILE__, '<table><tr><td><span><pre>' . $sql . '</pre></span></td></tr></table>');
}
$values = array();
while ( $row = $db->sql_fetchrow($result) )
{
$values[ $row['_list_key'] ] = array( 'txt' => $row['_list_txt'], 'img' => $row['_list_img'] );
}
// transfert in values
@reset($values);
while ( list($key, $value) = @each($values) )
{
$values_list[$list_name]['values'][$key] = $value;
}
$values_list[$list_name]['done'] = true;
$done = true;
}
}
// force txt if nothing ask for display
if ( !$field_data['txt'] && !$field_data['img'] )
{
$field_data['txt'] = true;
}
@reset($values_list[$list_name]['values']);
while ( list( $key, $value_data) = @each($values_list[$list_name]['values']) )
{
$txt = '';
$img = '';
if ( $field_data['txt'] )
{
$txt = isset($lang[ $value_data['txt'] ]) ? $lang[ $value_data['txt'] ] : $value_data['txt'];
}
if ( $field_data['img'] )
{
$img = isset($images[ $value_data['img'] ]) ? $images[ $value_data['img'] ] : $value_data['img'];
}
$value = !empty($img) ? '<img>' : '';
$value .= ( !empty($img) && !empty($txt) ) ? ' ' : '';
$value .= $txt;
if ( !empty($value) )
{
$res[$value] = $key;
}
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_field() : get the field definition
//
//---------------------------------------------------------------------
function pcp_get_field( $field_cfg, $map_name='', $field_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
$found = false;
if ( empty($field_name) )
{
@reset($user_fields);
while ( list($field_name, $field_data) = @each($user_fields) )
{
$found = ($field_data[$field_name]['input_id'] == $field_cfg);
if ( $found )
{
break;
}
}
if ( !$found )
{
$field_name = $field_cfg;
}
}
// get the field definition
$field_data = $user_fields[$field_name];
// overwrite by the map definition
@reset($user_maps[$map_name]['fields'][$field_name]);
while ( list($key, $value) = @each($user_maps[$map_name]['fields'][$field_name]) )
{
$field_data[$key] = $value;
}
// parse the default value
if ( !empty($field_data['default']) || ($field_data['default'] == "0") )
{
$tables_used = array();
$field_data['default'] = pcp_parse_def($field_data['default'], $userdata, $tables_used);
}
// solve values list
if ( !empty($field_data['values']) && is_string($field_data['values']) )
{
// if list drop force the img/txt set
if ( ($field_data['get_mode'] == 'LIST_DROP') && $field_data['img'] )
{
$field_data['img'] = false;
$field_data['txt'] = true;
}
$field_data['values'] = pcp_get_values_list($field_name, $field_data, $map_name);
if ( empty($field_data['values']) )
{
$field_data['default'] = '';
}
else
{
// check if the default value is in the values list
@reset($field_data['values']);
$found = false;
while ( list($value, $key) = @each($field_data['values']) )
{
$found = ( $field_data['default'] == $key );
if ( $found )
{
break;
}
}
if ( !$found )
{
$first_key = '';
@reset($field_data['values']);
list($first_value, $first_key) = @each($field_data['values']);
$field_data['default'] = $first_key;
}
}
}
// get back values
$res = $field_data;
// fill the necessary entries for mods_settings
$res['user'] = $field_name;
if ( !empty($res['get_mode']) )
{
$res['type'] = $res['get_mode'];
}
else if ( !empty($res['get_func']) || !empty($res['chk_func']) )
{
$res['type'] = '';
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_mods_setting_menu() : get the menu values for the mods settings
//
//---------------------------------------------------------------------
function pcp_get_mods_setting_menu( $menu_id, $map_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
if ( !empty($map_name) && isset($user_maps[$map_name]) )
{
$res = $user_maps[$map_name][$menu_id];
}
return $res;
}
//---------------------------------------------------------------------
//
// function pcp_get_mods_setting_config_fields() : get the field definition from a map
//
//---------------------------------------------------------------------
function pcp_get_mods_setting_config_fields( $map_name='' )
{
global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;
$res = array();
if ( isset($user_maps[$map_name]) )
{
@reset($user_maps[$map_name]['fields']);
while ( list($field_name, $field_data) = @each($user_maps[$map_name]['fields']) )
{
$field_cfg = $field_data['input_id'];
if ( empty($field_cfg) )
{
$field_cfg = $field_name;
}
$res[$field_cfg] = pcp_get_field($field_cfg, $map_name, $field_name);
}
}
return $res;
}
// PCP Extra :: Replaced the full function
// function added by edwin for fixing override problem...
function display_field($userfield, &$viewdata){
global $board_config, $userdata, $user_fields;
/* You cannot unscrable scrambled eggs... So re-write the logic!
edwin's logic:
If override
yes: if value 0 ==> hide
if value 1 ==> Show
if value 2 ==> Show Buddy, hide Ignore
+ override the view_user value
==> this is for all non allow fields
when a generic field is created the value in config is not 0,1 or 2
but the exact needed value.
Ex: if username=dumbo && override=yes
then set dumbo as view_userdata['username']
No: User value?
0 ==> hide
1 ==> show
2 ==> Show buddy, hide Ignore
Special cases
1) guest user logged in ==> hide
2) user viewing guest user ==> hide
3) admin viewing user ==> show + override the view_user value
*/
// tha vals
$config_value = $board_config[$userfield];
$override = $board_config[$userfield.'_over'];
$user_value = $viewdata[$userfield];
$display = false;
// let's go!
// special cases
if ($userdata['user_id'] == ANONYMOUS) {
// guest user logged in ==> hide
$display = false;
} else if ($viewdata['viewed_by_admin']) {
// 3) show + override the view_user value
$display = true;
if($override){
$viewdata[$userfield] = $config_value;
}
} else {
// start edwin's logic:
if ($override){
$real_value = $config_value;
// override the value of view_userdata
$viewdata[$userfield] = $config_value;
} else {
$real_value = $user_value;
}
switch ($real_value){
case YES:
// show
$display = true;
break;
case FRIEND_ONLY:
// show buddy, hide Ignore
// if page calls the pcp_get_class_check() directly for valmidating a class
// the getBuddyStatus() hasn't been called
// ==> call it otherwise this returns false!
if(!isset($viewdata['user_ignore']) || !isset($viewdata['user_friend'])){
getBuddyStatus($viewdata);
}
if ($viewdata['user_ignore']){
$display = false;
} else if ($viewdata['user_friend']){
$display = true;
} else {
$display = false;
}
break;
default:
// means NO, 0 or NULL ==> non allow field is NULL
// hide
$display = false;
break;
}
}
// yes, yes, yes... we know it now so no good of keeping thus return it...
return $display;
}
function preProcessUserConfig(&$viewdata){
global $userdata;
// stuff to do before user buttons are send to the template
// set the admin for use inside my functions...
$viewdata['viewed_by_admin'] = is_admin($userdata);
// set online
$viewdata['user_online'] = ( $viewdata['user_session_time'] >= (time()-300) );
// correct pm
$viewdata['user_pm'] = pcp_get_class_check('pm', $viewdata);
// get buddy status
getBuddyStatus($viewdata);
}
function postProcessUserConfig(&$viewdata){
// stuff to do after user buttons are send to the template
global $userdata;
// sig :: hide when user do not want to see it...
if (!$userdata['user_viewsig'] || !$viewdata['user_allowsignature'])
{
$viewdata['user_sig'] = '';
}
}
function getBuddyStatus(&$viewdata){
global $db, $userdata;
$id = $userdata['user_id'];
$viewid = $viewdata['user_id'];
if($id == $viewid){
// you are always buddy of yourself!
$viewdata['user_friend'] = 1;
$viewdata['user_ignore'] = 0;
$viewdata['user_visible'] = 1;
} else {
$sql = "SELECT * FROM " . BUDDYS_TABLE . "
WHERE (user_id=$id AND buddy_id=$viewid) OR (user_id=$viewid AND buddy_id=$id)";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get buddy information', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
if ( $row['user_id'] != $viewid )
{
$viewdata['user_my_friend'] = !$row['buddy_ignore'];
$viewdata['user_my_ignore'] = $row['buddy_ignore'];
$viewdata['user_my_visible'] = $row['buddy_visible'];
}
else
{
if($viewdata['viewed_by_admin']){
// admin is always the friend of the user being viewed
$viewdata['user_friend'] = 1;
$viewdata['user_ignore'] = 0;
$viewdata['user_visible'] = 1;
} else {
$viewdata['user_friend'] = !$row['buddy_ignore'];
$viewdata['user_ignore'] = $row['buddy_ignore'];
$viewdata['user_visible'] = $row['buddy_visible'];
}
}
}
}
}
?>
"Frost";p="23122" wrote:You said you are ?
That file is no where near the same as the one that came with imod 141
In fact it was dated the day after the one in the 141 package. Did you try to upgrade something?
"Frost";p="23793" wrote:Try reuploading your whole profilcp folder again, then go back to the install instructions and do the chmod's again (on just the ones for profilcp)
Registered users: App360MonitorBot, Bing [Bot], Google [Bot]