Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-25-2008, 11:06 AM
dimitrisvb's Avatar
dimitrisvb dimitrisvb is offline
 
Join Date: Oct 2008
Location: Greece
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default different alphabet index for members list

hi all!
is there a way to have the a different alphabet index (greek) for the members list?

thanks,
Dimitris
Reply With Quote
  #2  
Old 11-25-2008, 11:24 AM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Open memberlist.php and modify the following portion to display your character set:
PHP Code:
    // now do alpha-characters
    
for ($i=65$i 91$i++)
    {
        
$currentletter chr($i);
        
$linkletter =& $currentletter;
        
$show['selectedletter'] = $selectedletter == $currentletter true false;
        eval(
'$letterbits .= "' fetch_template('memberlist_letter') . '";');
    } 
Hint: you would need to define the character set in an array, then do a foreach on the array to assign each character to $currentletter.
Reply With Quote
  #3  
Old 11-25-2008, 12:16 PM
dimitrisvb's Avatar
dimitrisvb dimitrisvb is offline
 
Join Date: Oct 2008
Location: Greece
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the help! it works! :up:

I just changed the character indeces to the greek ones.

It seems, there's a non-character in position 210 though, breaking the alphabet in two! It must be an empty place, left there before the capital sigma because there are two lower case sigmas and thus, the rest of the capitals will correspond correctly with the lower case ones.

To resolve this, I have used two different loops:

PHP Code:
// now do alpha-characters
    
for ($i=193$i 210$i++)
    {
        
$currentletter chr($i);
        
$linkletter =& $currentletter;
        
$show['selectedletter'] = $selectedletter == $currentletter true false;
        eval(
'$letterbits .= "' fetch_template('memberlist_letter') . '";');
    }

    for (
$i=211$i 218$i++)
    {
        
$currentletter chr($i);
        
$linkletter =& $currentletter;
        
$show['selectedletter'] = $selectedletter == $currentletter true false;
        eval(
'$letterbits .= "' fetch_template('memberlist_letter') . '";');
    } 
This produces a greek alphabet index! Now, when I click on the letters, ordening doesn't seem to work properly but I suppose, this has to do with the fact we're only 16 members yet.

Thanks a lot for the tip, ReCom! You have helped big deal!

Now, if you only had some advice as to how I could arrange it so that only greek letters are accepted for usernames!
Reply With Quote
  #4  
Old 11-25-2008, 12:35 PM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dimitrisvb View Post
Now, if you only had some advice as to how I could arrange it so that only greek letters are accepted for usernames!
You would need to use regular expression (regex) for that:

1. Go to AdminCP > vBulletin Options > User Registration Options.

2. Look for setting "Username Regular Expression".

3. Now let say you want to limit the usernames to those containing a, b, c, d or e only. You would need to write in the setting:
Code:
^[abcde]$
4. So to allow greek characters only you need to replace 'abcde' with a string of all greek characters. Quite a long string I'd imagine

Perhaps there's a better way, probably using plugin. Will look into it further.

EDIT:
you can add plugin that hooks to register_addmember_process:

1. Check if $vbulletin->GPC['username'] is valid (greek characters only) using any PHP algorithm you want.
2. If it's invalid, append array $userdata->errors with your error message.
Reply With Quote
  #5  
Old 11-25-2008, 04:37 PM
dimitrisvb's Avatar
dimitrisvb dimitrisvb is offline
 
Join Date: Oct 2008
Location: Greece
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ReCom View Post
You would need to use regular expression (regex) for that:

1. Go to AdminCP > vBulletin Options > User Registration Options.

2. Look for setting "Username Regular Expression".

3. Now let say you want to limit the usernames to those containing a, b, c, d or e only. You would need to write in the setting:
Code:
^[abcde]$
4. So to allow greek characters only you need to replace 'abcde' with a string of all greek characters. Quite a long string I'd imagine
I have tried it but it doesn't seem to work!
I have entered all greek characters (upper and lower case, with accents) within this notation: ^[ ]$
in the "Username Regular Expression" field. Then I tried to create a user but neither greek nor latin characters would be accepted by the system! When I emptied the field, registration would work again!

Quote:
EDIT:
you can add plugin that hooks to register_addmember_process:

1. Check if $vbulletin->GPC['username'] is valid (greek characters only) using any PHP algorithm you want.
2. If it's invalid, append array $userdata->errors with your error message.
I'll see if can make anything out of these notes!
thanks!
Reply With Quote
  #6  
Old 11-25-2008, 09:59 PM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dimitrisvb View Post
I have tried it but it doesn't seem to work!
I have entered all greek characters (upper and lower case, with accents) within this notation: ^[ ]$
in the "Username Regular Expression" field. Then I tried to create a user but neither greek nor latin characters would be accepted by the system! When I emptied the field, registration would work again!
Sorry it should have been ^[ ]+$ .. my mistake
Reply With Quote
  #7  
Old 11-27-2008, 08:50 AM
dimitrisvb's Avatar
dimitrisvb dimitrisvb is offline
 
Join Date: Oct 2008
Location: Greece
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ReCom View Post
Sorry it should have been ^[ ]+$ .. my mistake
indeed! this works!!!!!
thanx ReCom! I owe you!
Reply With Quote
  #8  
Old 02-21-2010, 11:40 AM
ANGEL OF FIRE ANGEL OF FIRE is offline
 
Join Date: Jun 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How to make it under Vb4? Its code strongly differs.

Whether somebody can help?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:52 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04857 seconds
  • Memory Usage 2,252KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete