vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - AMP Quick Auto Tagger (https://vborg.vbsupport.ru/showthread.php?t=235469)

testbot 03-25-2010 09:19 PM

i believe the following is what strips non english words from tags. if anyone knows how to translate it that would be great.

Code:

var subject = document.vbform.subject.value.replace(/[^a-zA-Z 0-9]+/gi,"");
subject = subject.replace(/(\b(\w{1,2})\b(\s|$))|(\b(\w{19,})\b(\s|$))/g,"");
var newtaglist = filterText(subject);
newtaglist = trim(newtaglist);
newtaglist = newtaglist.replace(/\s+/g," ");
document.vbform.taglist.value = newtaglist.replace(/ /gi,",");


dippetas 03-26-2010 08:17 AM

Quote:

Originally Posted by testbot (Post 2010265)
i believe the following is what strips non english words from tags. if anyone knows how to translate it that would be great.

Code:

var subject = document.vbform.subject.value.replace(/[^a-zA-Z 0-9]+/gi,"");
subject = subject.replace(/(\b(\w{1,2})\b(\s|$))|(\b(\w{19,})\b(\s|$))/g,"");
var newtaglist = filterText(subject);
newtaglist = trim(newtaglist);
newtaglist = newtaglist.replace(/\s+/g," ");
document.vbform.taglist.value = newtaglist.replace(/ /gi,",");


i think that i need only to change the regular expression command in greek is that right?, it should be something like that
Code:

var subject = document.vbform.subject.value.replace(/[^α-ωΑ-Ω 0-9]+/gi,"");
is that right?
do i have to change anything else? :)

testbot 03-26-2010 01:03 PM

Quote:

Originally Posted by dippetas (Post 2010426)
i think that i need only to change the regular expression command in greek is that right?, it should be something like that
Code:

var subject = document.vbform.subject.value.replace(/[^α-ωΑ-Ω 0-9]+/gi,"");
is that right?
do i have to change anything else? :)

i think so. the rest really just removes spaces and stuff. give it a try and let me know how it works.

i'll be updating this soon because there's still a few slight bugs. if that works i'll incorporate that into the code.

dippetas 03-26-2010 07:59 PM

Quote:

Originally Posted by testbot (Post 2010521)
i think so. the rest really just removes spaces and stuff. give it a try and let me know how it works.

i'll be updating this soon because there's still a few slight bugs. if that works i'll incorporate that into the code.

unfortunately this didn't work at all, but i will give it a try in order to fix it :D

Professional2 03-28-2010 04:57 AM

i have a lot of topic,does it add tags for them?

dippetas 03-28-2010 08:06 AM

Quote:

Originally Posted by Professional2 (Post 2011426)
i have a lot of topic,does it add tags for them?

if you are referring to me, no it doesn't add at all tags at my threads because the reg exp is only for Latin words and non Unicode. I've tried some solutions with Unicode but nothing.

i'm using this site in order to create and test the reg exp for greek http://www.regexplanet.com/simple/index.html

@testbot
i'm pretty close to solve it only i have a problem it strips spaces and can't place "," for the tag words here is the code
Code:

        var subject = document.vbform.subject.value.replace(/[^[a-zA-Z0-9_\\u00A1-\\uFFFF]+/gi,"");

dippetas 03-28-2010 09:23 AM

1 Attachment(s)
Quote:

Originally Posted by testbot (Post 2010521)
i think so. the rest really just removes spaces and stuff. give it a try and let me know how it works.

i'll be updating this soon because there's still a few slight bugs. if that works i'll incorporate that into the code.

Fixed, it adds Greek tags and english
here is the solution :
Code:

       
function updateTagger(){
                                var subject = document.vbform.subject.value.replace(/[^[a-zA-Z0-9_\\u0020-\\uFFFF]+/gi,"");
                                subject = subject.replace(/(\b(\w{1,2})\b(\s|$))|(\b(\w{19,})\b(\s|$))/g,"");
                                var newtaglist = filterText(subject);
                                newtaglist = trim(newtaglist);
                                newtaglist = newtaglist.replace(/\s+/g," ");
                                document.vbform.taglist.value = newtaglist.replace(/ /gi,",");

and here is the fixed RegExp
Code:

(/[^[a-zA-Z0-9_\\u0020-\\uFFFF]+/gi,"")
:D :D :D :D

This is the attached file for unicode (including greek) and english languages

ffak 04-07-2010 07:36 AM

Quote:

Originally Posted by testbot (Post 1991303)
i think i might release the updater for older threads as a separate product. right now, part of this mods appeal is that there's absolutely no database changes, it's fast and simple. the updater will require database changes and a file to uplodad.

Thanks for your mod.
Do you think you'll release some updater for old threads?

Furcal15 04-07-2010 06:31 PM

Quote:

Originally Posted by ffak (Post 2017298)
Thanks for your mod.
Do you think you'll release some updater for old threads?


I'm also interested in the old threads being automatically updated. Is it possible?

arena 04-07-2010 09:01 PM

Quote:

Originally Posted by dippetas (Post 2011496)
Fixed, it adds Greek tags and english
here is the solution :
Code:

   
function updateTagger(){
                var subject = document.vbform.subject.value.replace(/[^[a-zA-Z0-9_\\u0020-\\uFFFF]+/gi,"");
                subject = subject.replace(/(\b(\w{1,2})\b(\s|$))|(\b(\w{19,})\b(\s|$))/g,"");
                var newtaglist = filterText(subject);
                newtaglist = trim(newtaglist);
                newtaglist = newtaglist.replace(/\s+/g," ");
                document.vbform.taglist.value = newtaglist.replace(/ /gi,",");

and here is the fixed RegExp
Code:

(/[^[a-zA-Z0-9_\\u0020-\\uFFFF]+/gi,"")
:D :D :D :D

This is the attached file for unicode (including greek) and english languages

Please Turkish language help? ? ? Ş ş Ğ ğ ı ? ? ? ?


All times are GMT. The time now is 08:57 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.01280 seconds
  • Memory Usage 1,756KB
  • 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
  • (9)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete