View Single Post
  #35  
Old 10-29-2008, 02:15 PM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, it is working now! Thank you very much! It was really nice of you to spend so much time on this issue!

I think in the end you only have to add ENCTYPE="multipart/form-data". I am not sure about the effect of reinstalling the product. I think this is part of the solution, too, but I don' t know what kind of difference that makes and I also had an imagemagick problem.

This mod did not work for you on first install as well, did it?

After reading your last post I have reinstalled the plugin, but the avatar still has not been uploaded. I then replaced everything with your code. This was the first time I could see an impact. Instead of just promping a success without uploading the avatar, it said "invalid file". Soon I noticed that the standard avatar feature did not work, too. The reason was a misconfigured imagemagick path. After correction everything worked perfectly, besides that instead of the success message I received a blank box.

Therefore I reinstalled the original mod again. Now everything works perfect. Not quite, there are two more issues left.

1. I still don' t know why I get Could not find phrase 'note_maximum_size_x_y_or_z'. error. The phrase manager displays it as User Tools (global) and the phrase works perfect in the user control panel. It is also referenced in register.php ($phrasegroups = array('timezone', 'user', 'register', 'cprofilefield');).

You have not used the $maxnote variable in your html form code. Did you have the same problem or did you just think that it was not necessary? If I don' t get it to work, I will delete it from the form, too. Avatars are resized anyway, so that this information is a little bit misleading.

2. Then there is one more goal I like to achieve - making the avatar mandatory. I tried adding code to the check for missing fields section of register.php, but I was not able to submit the form. I added 'upload' => TYPE_FILE, to clean_array_gpc and OR empty($vbulletin->GPC['upload']) to the if clause.

I also thought about adding code to the javascript verify_passwords function. This would be not as good as php validation, but still better than no validation at all. Unfortunately I have never dealt with javascript and the variables used in vbulletin look so much different than the ones used in code examples on other sites.

If anyone knows how to change the files in order to make avatars mandatory, please reply.

Edit:
The reason for the first problem is that the language variable calls have been changed. The register_form_complete plugin should look like this:
Code:
//register_form_complete

if($avatar_form)
{
    $reg_perms['avatarmaxsize'] = vb_number_format($reg_perms['avatarmaxsize'], 1, true);
    
    $maxnote = '';
    
    
    if($reg_perms['avatarmaxsize'] AND ($reg_perms['avatarmaxwidth'] OR $reg_perms['avatarmaxheight']))
{
    	$maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_or_z'], $reg_perms['avatarmaxwidth'], $reg_perms['avatarmaxheight'], $reg_perms['avatarmaxsize']);
}
    	
    else if ($reg_perms['avatarmaxsize'])
{
    	$maxnote = construct_phrase($vbphrase['note_maximum_size_x'], $reg_perms['avatarmaxsize']);
}
    
    else if ($reg_perms['avatarmaxwidth'] OR $reg_perms['avatarmaxheight'])
{
    	$maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_pixels'], $reg_perms['avatarmaxwidth'], $reg_perms['avatarmaxheight']);
}
    
    	
    $show['maxnote'] = (!empty($maxnote)) ? true : false;
}
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01042 seconds
  • Memory Usage 1,773KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete