[OzzModz] Auto Title Case

[OzzModz] Auto Title Case [Paid] 2.0.0 Patch Level 1

No permission to buy ($15.00)

Painbaker

Well-known member
Painbaker submitted a new resource:

[PB] Auto Title Case - Automatic title case conversion for some types of content

Automatic title case conversion for XenForo 2 as in the XenForo v1.

Features:
  • Supported the titles of:
    • Threads
    • Conversations
    • XFRM Resources
    • Albums and medias of XFMG
    • Articles and promotions [EWR] XenPorta
    • Articles of [XenAddons] Article Management System
  • Any type can be turned off in the options
  • Conversion performed both when creating content and when editing it
  • Multibyte strings are supported (Cyrillic, etc.)
  • The case conversion...

Read more about this resource...
 

sbj

Well-known member
This is a nice addon. Already using Andy's but perhaps this can add stuff I would need where I don't need to maintain a PHP script.

I believe having title case capitalization enabled helps tremendously. An example thread title: This Will Be a Thread Title. Having proper titles help reading faster and gives structure.

The problem is title case capitalization needs exceptions. In the English language prepositions such as at, by, to or conjunctions such as and, but, for or articles like a, an, the are always not capitalized unless it is the first word of the title.

3 suggestions:

1) Allow us a list of words which are always written lowercase. So a list where we can add words to it and they are always lowercase except if those words are the first word in the title.

2) Allow us a list of words which are always written uppercase. Words such as I , II, III, IV, NBA, UN, M.I.T, USA need to be written all uppercase all the time. Allow us to add words to such a list.

3) Give option to include or exclude nodes by entering node ids. For example I run a bilingual forum. I have a separate title case capitalization for English forums than for my native language. For the English forums I have added English words which should be excluded, for my native language nodes different words.

I can share you my script with you in private if you want to take a look at it.
 

sevenmix

Active member
Hi

Im having this error:

  • ErrorException: [E_WARNING] Division by zero
  • src/addons/PB/AutoTitleCase/Util/CaseUtils.php:148
  • Generado por: Maiden Alan
  • 7 Sep 2020 a la(s) 08:45
#0 src/addons/PB/AutoTitleCase/Util/CaseUtils.php(148): XF::handlePhpError(2, '[E_WARNING] Div...', '/home/forobeta/...', 148, Array)
#1 src/addons/PB/AutoTitleCase/Util/CaseUtils.php(27): PB\AutoTitleCase\Util\CaseUtils::upperCasePercentage('')
#2 src/addons/PB/AutoTitleCase/XF/Service/Conversation/Creator.php(13): PB\AutoTitleCase\Util\CaseUtils::convert('')
#3 src/XF/Pub/Controller/Conversation.php(286): PB\AutoTitleCase\XF\Service\Conversation\Creator->setContent('', 'iron666_parati@...')
#4 src/addons/SV/ConversationEssentials/XF/Pub/Controller/Conversation.php(632): XF\Pub\Controller\Conversation->setupConversationCreate()
#5 src/XF/Pub/Controller/Conversation.php(314): SV\ConversationEssentials\XF\Pub\Controller\Conversation->setupConversationCreate()
#6 src/addons/SV/ConversationEssentials/XF/Pub/Controller/Conversation.php(61): XF\Pub\Controller\Conversation->actionAdd()
#7 src/XF/Mvc/Dispatcher.php(350): SV\ConversationEssentials\XF\Pub\Controller\Conversation->actionAdd(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Conversation', 'Add', Object(XF\Mvc\RouteMatch), Object(SV\ConversationSharing\XF\Pub\Controller\Conversation), NULL)
#9 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ConversationSharing\XF\Pub\Controller\Conversation), NULL)
#10 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2190): XF\Mvc\Dispatcher->run()
#12 src/XF.php(391): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
array(4) {
["url"] => string(18) "/conversations/add"
["referrer"] => string(38) "https://forobeta.com/conversations/add"
["_GET"] => array(0) {
}
["_POST"] => array(11) {
["tokens_select"] => string(11) "Maiden Alan"
["recipients"] => string(11) "Maiden Alan"
["label_id"] => string(1) "0"
["title"] => string(0) ""
["message_html"] => string(33) "<p>iron666_parati@hotmail.com</p>"
["attachment_hash"] => string(32) "cb3f5a68cda947fe11f117ed9a2ede51"
["attachment_hash_combined"] => string(86) "{"type":"conversation_message","context":[],"hash":"cb3f5a68cda947fe11f117ed9a2ede51"}"
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(18) "/conversations/add"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}



greetings
 

frm

Well-known member
Will this save it in the database so that it isn't add on dependent in the future?

Say someone types the title this is an interesting subject. Does it save it as such or This is an Interesting Subject so that if the add on, worst case scenario is gone in the future, the latter formatting will always remain.

Thanks
 

sevenmix

Active member
Hi

When somebody add an icon or ¿ previous to the title, it goes undercase

per example

¿Qué opinan de esto?

goes:

¿qué opinan de esto?
 

sevenmix

Active member
Hi, now im having this errors, greetings

  • InvalidArgumentException: Received invalid UTF-8 for string column [title]
  • src/XF/Mvc/Entity/Entity.php:740
  • Generado por: Pompinchu
  • 17 Sep 2020 a la(s) 09:28
#0 src/XF/Mvc/Entity/Entity.php(618): XF\Mvc\Entity\Entity->_castValueToType('Compro fanpage ...', 'title', 5, Array)
#1 src/XF/Service/Thread/Creator.php(145): XF\Mvc\Entity\Entity->set('title', 'Compro fanpage ...', Array)
#2 src/addons/PB/AutoTitleCase/XF/Service/Thread/Creator.php(16): XF\Service\Thread\Creator->setContent('Compro fanpage ...', 'Compro fan page...', true)
#3 src/XF/Pub/Controller/Forum.php(545): PB\AutoTitleCase\XF\Service\Thread\Creator->setContent('Compro fanpage ...', 'Compro fan page...')
#4 src/XF/Pub/Controller/Forum.php(820): XF\Pub\Controller\Forum->setupThreadCreate(Object(SV\LiveContent\XF\Entity\Forum))
#5 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Forum->actionThreadPreview(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'ThreadPreview', Object(XF\Mvc\RouteMatch), Object(ThemeHouse\Trending\XF\Pub\Controller\Forum), NULL)
#7 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(ThemeHouse\Trending\XF\Pub\Controller\Forum), NULL)
#8 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2191): XF\Mvc\Dispatcher->run()
#10 src/XF.php(391): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}
array(4) {
["url"] => string(31) "/forums/fanpages/thread-preview"
["referrer"] => string(48) "https://forobeta.com/forums/fanpages/post-thread"
["_GET"] => array(0) {
}
["_POST"] => array(13) {
["prefix_id"] => string(1) "4"
["title"] => string(48) "Compro FANPAGE de temática Fotografia - Diseño"
["message_html"] => string(232) "<p>Compro fan page de temática Fotografia - Diseño en verde.</p><p><br></p><p>Puede ser de 10k a 30k</p><p><br></p><p>PD: Que se le pueda cambiar el nombre y url.</p><p><br></p><p>Enviame un MP con tu Fanpage, dinero en manos.</p>"
["attachment_hash"] => string(32) "80bff6852c6d7ceada16fdf3045a5f14"
["attachment_hash_combined"] => string(83) "{"type":"post","context":{"node_id":166},"hash":"80bff6852c6d7ceada16fdf3045a5f14"}"
["custom_fields"] => array(7) {
["seguidores"] => string(1) "1"
["precio"] => string(0) ""
["metododepago"] => array(2) {
[0] => string(6) "paypal"
[1] => string(7) "bitcoin"
}
["procesodeentrega"] => string(16) "sinintermediario"
["plazoparapagar"] => string(4) "1dia"
["plazodeentrega"] => string(4) "1dia"
["comisiones"] => string(9) "noexisten"
}
["watch_thread"] => string(1) "1"
["_xfSet"] => array(1) {
["watch_thread"] => string(1) "1"
}
["poll"] => array(5) {
["question"] => string(0) ""
["new_responses"] => array(1) {
[0] => string(0) ""
}
["max_votes_type"] => string(6) "single"
["change_vote"] => string(1) "1"
["view_results_unvoted"] => string(1) "1"
}
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(28) "/forums/fanpages/post-thread"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 
Top