vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   different alphabet index for members list (https://vborg.vbsupport.ru/showthread.php?t=197197)

dimitrisvb 11-25-2008 11:06 AM

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

ReCom 11-25-2008 11:24 AM

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.

dimitrisvb 11-25-2008 12:16 PM

thanks for the help! :D 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. :o

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

Now, if you only had some advice as to how I could arrange it so that only greek letters are accepted for usernames! :rolleyes:

ReCom 11-25-2008 12:35 PM

Quote:

Originally Posted by dimitrisvb (Post 1672655)
Now, if you only had some advice as to how I could arrange it so that only greek letters are accepted for usernames! :rolleyes:

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 :rolleyes:

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.

dimitrisvb 11-25-2008 04:37 PM

Quote:

Originally Posted by ReCom (Post 1672664)
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 :rolleyes:

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! :o
thanks!

ReCom 11-25-2008 09:59 PM

Quote:

Originally Posted by dimitrisvb (Post 1672835)
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 :p

dimitrisvb 11-27-2008 08:50 AM

Quote:

Originally Posted by ReCom (Post 1672992)
Sorry it should have been ^[ ]+$ .. my mistake :p

indeed! this works!!!!!
thanx ReCom! I owe you! :D

ANGEL OF FIRE 02-21-2010 11:40 AM

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

Whether somebody can help?


All times are GMT. The time now is 02:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04129 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete