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 01-16-2011 05:01 PM

So I took two weeks vacation/holiday so I'll have plenty of time to get everything upgraded.

After reading this thread and looking over that other auto tag mod I decided that I'll be upgrading some of my forums to the latest vb version and doing some tests on both mods. If that other mod works better, I will discontinue development on this mod. There's no sense in having two mods do the same thing. The other one looks more advance so it might be better to use that one. If not I will continue development on this one.

Once I do the upgrades I will report back here and post my findings. Hopefully we find a single solution that works best for everyone.

Thank you all!

ShackMaster 01-16-2011 07:09 PM

I was unable to get the other one working for me.

This one works, but it has a few issues... such as trying to add single letters as tags. It also does not add tags to old threads.

SEW810 01-16-2011 11:32 PM

1 Attachment(s)
https://vborg.vbsupport.ru/external/2012/01/11.gif Installed
https://vborg.vbsupport.ru/external/2012/01/11.gif Working on vBulletin 4.1.1
https://vborg.vbsupport.ru/external/2012/01/11.gif Translated into Spanish

zacs2k 02-06-2011 03:59 AM

installed on 4.1.1, works great

testbot 02-09-2011 09:37 PM

Quick update... I'm working on this right now.

I hope to have the following issues resolved:
1. Partial words such as "sniper" turning to "sni"
2. Conflicts with other mods (i think i have this sorted already - i just have to test it now)
3. Cron jobs to tag past threads
4. Good words (tags that can be added to every thread)
5. Integration with the current vbulletin stop words
6. Filter numbers option (this will be a check box to disable numbers in tags)

The one thing I can't do is make other languages work. There's just too many languages and special characters. I only know english. I'm sorry for that. One solution that I'm debating is a field in the options to allow the addition of alphabets but I'm not sure how that will work. More research is needed before I can add that. Until then, people are welcome to continue porting it over to other languages.

ShackMaster 02-09-2011 11:00 PM

Thanks for the update and I look forward to its release.

Budget101 02-11-2011 09:58 AM

unable to get it to do anything after enabling on a clean install test board, uninstalled.

testbot 02-11-2011 04:28 PM

All of the above is fixed. Just working on the cron jobs now.

jeleven 02-12-2011 10:14 AM

english version is worked on VB4.0.8 fine
I twice tried to configure script to recognize the Russian language but both of my attempts were unsuccessful
1 attempt ( not working ) on importing write me eror on 23 string ( I can not understand where the error )
PHP Code:

<?xml version="1.0" encoding="UTF-8"?>

<product productid="amp_tagger" active="1">
    <title>AMP Auto Tagger</title>
    <description>Automaticly Tags Threads with Titles</description>
    <version>1.0.1</version>
    <url>https://vborg.vbsupport.ru/showthread.php?t=235469</url>
    <versioncheckurl><![CDATA[https://vborg.vbsupport.ru/misc.php?do=productcheck&pid=amp_autotag]]></versioncheckurl>
    <dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
    </templates>
    <stylevardfns>
    </stylevardfns>
    <stylevars>
    </stylevars>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>AMP Auto Tagger</title>
            <hookname>parse_templates</hookname>
            <phpcode><![CDATA[if ($vbulletin->options['amp_auto_tagger_enabled'] && THIS_SCRIPT == 'newthread'){    
    $taggerbadwords = str_replace(" ","",$vbulletin->options["amptaggerbadwords"]);
    $taggerbadwords = str_replace(",","\b|",$vbulletin->options["amptaggerbadwords"]);
    //$taggerbadwords = str_replace(" ","\b|",$vbulletin->options["badwords"]);
    
    $tagscript = '<script type="text/javascript">

function removeAccents(strAccents){ 
    strAccents = strAccents.split(""); 
    strAccentsOut = new Array(); 
    strAccentsLen = strAccents.length; 
    var accents = 

"АаБбВвГгДдЕеЁёЖжЗзИиЙиКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЬьЭэЮюЯя"; 
    var accentsOut = 

["A","A","A","A","A","A","a","a","a","a","a","a","O","O","O","O","O","O","O"

,"o","o","o","o","o","o","E","E","E","E","e","e","e","e","e","C","c","D","I"

,"I","I","I","i","i","i","i","U","U","U","U","u","u","u","u","N","n","S","s"

,"Y","y","y","Z","z"]; 
    for (var y = 0; y < strAccentsLen; y++) { 
        if (accents.indexOf(strAccents[y]) != -1) { 
            strAccentsOut[y] = accentsOut[accents.indexOf(strAccents[y])]; 
        } 
        else 
            strAccentsOut[y] = strAccents[y]; 
    } 
    strAccentsOut = strAccentsOut.join(""); 
    return strAccentsOut; 


            function filterText(sText) {
                var reBadWords = /'.$taggerbadwords.'\b/gi;
                return sText.replace(reBadWords, "");
            }
            function ltrim(str){ 
                return str.replace(/^[ ]+/, ""); 
            } 
            function rtrim(str){ 
                return str.replace(/[ ]+$/, ""); 
            }             
            function trim(str){ 
                return ltrim(rtrim(str)); 
            } 

                        
            function updateTagger(){
                var subject = document.vbform.subject.value.replace(/[^a-zA-Z 0-9АаБбВвГгДдЕеЁёЖжЗзИиЙиКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЬьЭэЮюЯя]+/gi,"");
                subject = removeAccents(subject);
                                subject = subject.replace(/(\b(\w{1,3})\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,",");
            }
            </script>';

    $tagscript2 = 'onBlur="updateTagger()"';
    $search = 'name="subject" id="subject"';
    $replace = 'name="subject" id="subject" '.$tagscript2;
    $vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']);
    $search = '<form class="vbform block"';
    $replace = $tagscript.'<form class="vbform block"';
    $vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']); 
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_amp_auto_tagger_enabled_desc" date="1265763401" username="Brock Strongo" version="1"><![CDATA[Enable AMP Auto Tagger]]></phrase>
            <phrase name="setting_amp_auto_tagger_enabled_title" date="1265763401" username="Brock Strongo" version="1"><![CDATA[Enabled]]></phrase>
            <phrase name="setting_amptaggerbadwords_desc" date="1265776198" username="Brock Strongo" version="1"><![CDATA[Enter a list of bad words separated by comas.

For best results, leave out spaces and words shorter than three characters long.  It already filters words shorter than three words anyway.]]></phrase>
            <phrase name="setting_amptaggerbadwords_title" date="1265776198" username="Brock Strongo" version="1"><![CDATA[AMP Tagger Bad Words]]></phrase>
            <phrase name="settinggroup_amp_tagger" date="1265763113" username="Brock Strongo" version="1"><![CDATA[AMP Auto Tagger]]></phrase>
        </phrasetype>
    </phrases>
    <options>
        <settinggroup name="amp_tagger" displayorder="65535">
            <setting varname="amp_auto_tagger_enabled" displayorder="10">
                <datatype>free</datatype>
                <optioncode>yesno</optioncode>
            </setting>
            <setting varname="amptaggerbadwords" displayorder="20">
                <datatype>free</datatype>
                <optioncode>textarea</optioncode>
                <defaultvalue>all,and,any,are,but,can,con,cry,due,etc,few,for,get,had,has,her,him,his,how,inc,its,ltd,may,nor,not,now,off,one,our,out,own,per,put,see,she,six,ten,the,too,top,two,via,was,who,why,yet,you,also,back,been,bill,both,call,cant,done,down,each,else,even,ever,fify,fill,find,fire,five,four,from,full,give,have,here,hers,into,keep,last,less,made,many,mill,mine,more,most,move,much,must,name,next,nine,none,once,only,onto,ours,over,part,same,seem,show,side,some,such,take,than,that,them,then,they,thin,this,thru,thus,upon,very,well,were,what,when,whom,will,with,your,about,above,after,again,alone,along,among,being,below,could,eight,empty,every,first,forty,found,front,hasnt,hence,least,might,never,noone,often,other,seems,since,sixty,still,their,there,these,thick,third,those,three,under,until,where,which,while,whole,whose,would,yours,across,almost,always,amount,anyhow,anyone,anyway,around,became,become,before,behind,beside,beyond,bottom,cannot,detail,during,either,eleven,enough,except,former,hereby,herein,indeed,itself,latter,mostly,myself,namely,nobody,others,please,rather,seemed,should,system,thence,though,toward,twelve,twenty,whence,within,against,already,amongst,another,because,becomes,besides,between,couldnt,fifteen,further,herself,himself,however,hundred,neither,nothing,nowhere,perhaps,seeming,serious,several,sincere,somehow,someone,thereby,therein,through,towards,whereas,whereby,wherein,whether,whither,whoever,without,although,amoungst,anything,anywhere,becoming,computer,describe,everyone,formerly,hereupon,interest,latterly,moreover,sometime,together,whatever,whenever,wherever,yourself,elsewhere,hereafter,meanwhile,otherwise,ourselves,something,sometimes,somewhere,therefore,thereupon,whereupon,afterwards,beforehand,everything,everywhere,themselves,thereafter,throughout,whereafter,yourselves,nevertheless,dont</defaultvalue>
            </setting>
        </settinggroup>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>

2 second attempt
PHP Code:

<?xml version="1.0" encoding="UTF-8"?>

<product productid="amp_tagger" active="1">
    <title>AMP Auto Tagger</title>
    <description>Automaticly Tags Threads with Titles</description>
    <version>1.0.1</version>
    <url>https://vborg.vbsupport.ru/showthread.php?t=235469</url>
    <versioncheckurl><![CDATA[https://vborg.vbsupport.ru/misc.php?do=productcheck&pid=amp_autotag]]></versioncheckurl>
    <dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
    </templates>
    <stylevardfns>
    </stylevardfns>
    <stylevars>
    </stylevars>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>AMP Auto Tagger</title>
            <hookname>parse_templates</hookname>
            <phpcode><![CDATA[if ($vbulletin->options['amp_auto_tagger_enabled'] && THIS_SCRIPT == 'newthread'){    
    $taggerbadwords = str_replace(" ","",$vbulletin->options["amptaggerbadwords"]);
    $taggerbadwords = str_replace(",","\b|",$vbulletin->options["amptaggerbadwords"]);
    //$taggerbadwords = str_replace(" ","\b|",$vbulletin->options["badwords"]);
    
    $tagscript = '<script type="text/javascript">
            function filterText(sText) {
                var reBadWords = /'.$taggerbadwords.'\b/gi;
                return sText.replace(reBadWords, "");
            }
            function ltrim(str){ 
                return str.replace(/^[ ]+/, ""); 
            } 
            function rtrim(str){ 
                return str.replace(/[ ]+$/, ""); 
            }             
            function trim(str){ 
                return ltrim(rtrim(str)); 
            } 
            function updateTagger(){
                var subject = document.vbform.subject.value.replace(/[^[a-zA-Z0-9_\\u0430-\\u042F]+/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,",");
            }
            </script>';

    $tagscript2 = 'onBlur="updateTagger()"';
    $search = 'name="subject" id="subject"';
    $replace = 'name="subject" id="subject" '.$tagscript2;
    $vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']);
    $search = '<form class="vbform block"';
    $replace = $tagscript.'<form class="vbform block"';
    $vbulletin->templatecache['newthread'] = str_replace($search, $replace, $vbulletin->templatecache['newthread']); 
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_amp_auto_tagger_enabled_desc" date="1265763401" username="Brock Strongo" version="1"><![CDATA[Enable AMP Auto Tagger]]></phrase>
            <phrase name="setting_amp_auto_tagger_enabled_title" date="1265763401" username="Brock Strongo" version="1"><![CDATA[Enabled]]></phrase>
            <phrase name="setting_amptaggerbadwords_desc" date="1265776198" username="Brock Strongo" version="1"><![CDATA[Enter a list of bad words separated by comas.

For best results, leave out spaces and words shorter than three characters long.  It already filters words shorter than three words anyway.]]></phrase>
            <phrase name="setting_amptaggerbadwords_title" date="1265776198" username="Brock Strongo" version="1"><![CDATA[AMP Tagger Bad Words]]></phrase>
            <phrase name="settinggroup_amp_tagger" date="1265763113" username="Brock Strongo" version="1"><![CDATA[AMP Auto Tagger]]></phrase>
        </phrasetype>
    </phrases>
    <options>
        <settinggroup name="amp_tagger" displayorder="65535">
            <setting varname="amp_auto_tagger_enabled" displayorder="10">
                <datatype>free</datatype>
                <optioncode>yesno</optioncode>
            </setting>
            <setting varname="amptaggerbadwords" displayorder="20">
                <datatype>free</datatype>
                <optioncode>textarea</optioncode>
                <defaultvalue>all,and,any,are,but,can,con,cry,due,etc,few,for,get,had,has,her,him,his,how,inc,its,ltd,may,nor,not,now,off,one,our,out,own,per,put,see,she,six,ten,the,too,top,two,via,was,who,why,yet,you,also,back,been,bill,both,call,cant,done,down,each,else,even,ever,fify,fill,find,fire,five,four,from,full,give,have,here,hers,into,keep,last,less,made,many,mill,mine,more,most,move,much,must,name,next,nine,none,once,only,onto,ours,over,part,same,seem,show,side,some,such,take,than,that,them,then,they,thin,this,thru,thus,upon,very,well,were,what,when,whom,will,with,your,about,above,after,again,alone,along,among,being,below,could,eight,empty,every,first,forty,found,front,hasnt,hence,least,might,never,noone,often,other,seems,since,sixty,still,their,there,these,thick,third,those,three,under,until,where,which,while,whole,whose,would,yours,across,almost,always,amount,anyhow,anyone,anyway,around,became,become,before,behind,beside,beyond,bottom,cannot,detail,during,either,eleven,enough,except,former,hereby,herein,indeed,itself,latter,mostly,myself,namely,nobody,others,please,rather,seemed,should,system,thence,though,toward,twelve,twenty,whence,within,against,already,amongst,another,because,becomes,besides,between,couldnt,fifteen,further,herself,himself,however,hundred,neither,nothing,nowhere,perhaps,seeming,serious,several,sincere,somehow,someone,thereby,therein,through,towards,whereas,whereby,wherein,whether,whither,whoever,without,although,amoungst,anything,anywhere,becoming,computer,describe,everyone,formerly,hereupon,interest,latterly,moreover,sometime,together,whatever,whenever,wherever,yourself,elsewhere,hereafter,meanwhile,otherwise,ourselves,something,sometimes,somewhere,therefore,thereupon,whereupon,afterwards,beforehand,everything,everywhere,themselves,thereafter,throughout,whereafter,yourselves,nevertheless,dont</defaultvalue>
            </setting>
        </settinggroup>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>

importing ok, but no working to


author - have you tried to analyze not only the name of the topic but what is written in, can be used in the script comparison occurring words and substitute tags according to them?

testbot 02-12-2011 11:46 AM

^
jeleven, the problem is that it strips special chars out because those are not allowed in tags. It uses somewhat of a white list. In the next release that I'll be uploading soon you'll be able to add the alphabet of your choice and it will whitelist those letters too. The only problem is that I don't know any languages besides English so I don't know if it's working.

Can you give me a Russian word and the first and last letter of the Russian alphabet so I can test it? I tried it in Arabic and I think it worked but again, I don't know Arabic so I'm not sure

It would be like 'A-Za-z' but in Russian. I also need a Russian word to make sure it works.


All times are GMT. The time now is 12:47 PM.

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.01411 seconds
  • Memory Usage 1,831KB
  • 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_php_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