Tag Essentials [Deleted]

Stuart Wright updated Tag Essentials with a new v1.8.0:
Quite unimpressed that this version automatically did a bulk update of wiki entries during upgrade - now I have a whole lot of tags filled with incorrect crap from wikipedia. :eek::mad: And a really slow and laborious process to go through and review wiki entries on all tags. (n)
Is there an SQL query to remove all wiki entries created on x date/time (which will be 1.8.1 upgrade date/time)?

The tag page @ /tags/<your tag here>/ seems to have introduced a bug too, where 'Edit Category' is now appearing as a call-to-action button despite Tag Categories not being enabled at ACP options, /admin.php?options/list/tagess

Anyone have an SQL query that can be used to delete single usage tags? Currently, at /admin.php?tags/ you have to order by total, go to the last page, skip back 1 or 2 pages to bypass 0 usage synonyms, click select all, untick any synonym entries (or others you don't want removed) on the page, click Delete Selected Tags, click Delete again. Then start all over again, as the page then automatically returns to a tag alphabetical ordered list on the first page.

  • For when Wikipedia fails to return information for a tag, set the Wiki entry to the contents of the phrase "tagess_no_wikipedia_entry_exists" (default "No Wikipedia entry exists for this tag"). Note: if you do not want to display any text, set the phrase to a single space character to avoid attempting to repopulate it from Wikipedia each time it is saved.
Anyone gotten this to work? I set the text at /admin.php?phrases/tagess_no_wikipedia_entry_exists[...] to a single space, but it still is populating a tag wiki entry that I empty/null and save, with the wikipedia contents.

Generally quite disappointed with the quality and wiki functionality of the 1.8.x release. Likely un-install and re-install the previous 1.7.x (will I loose tags and wiki entries on un-install?).
 
Last edited:
Anyone have an SQL query that can be used to delete single usage tags? Currently, at /admin.php?tags/ you have to order by total, go to the last page, skip back 1 or 2 pages to bypass 0 usage synonyms, click select all, untick any synonym entries (or others you don't want removed) on the page, click Delete Selected Tags, click Delete again. Then start all over again, as the page then automatically returns to a tag alphabetical ordered list on the first page.

Adjust $fileDir if this its below or above the webroot, and adjust $deleteThreshold to what you want:
Code:
<?php

$startTime = microtime(true);
$fileDir = dirname(__FILE__) ;
$deleteThreshold = 1;

@set_time_limit(120);
ignore_user_abort(true);

require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');

XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);

$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();

$db = XenForo_Application::get('db');

$tags = $db->fetchAll("
select *
from xf_tag
where xf_tag.use_count <= ? and permanent  0
", $deleteThreshold);

print count($tags) . " about to delete in 10 seconds\n";
sleep(10);
print "Now deleting\n";

foreach($tags as $tag)
{
    $dw = XenForo_DataWriter::create('XenForo_DataWriter_Tag');
    $dw->setExistingData($tag);
    $dw->delete();
}

$threads = $db->fetchAll("
    SELECT thread_id
    FROM xf_thread
    WHERE xf_thread.tags <> 'a:0:{}' and xf_thread.tags <> ''
");

/** @var XenForo_Model_Tag $tagModel */
$tagModel = XenForo_Model::create('XenForo_Model_Tag');

foreach ($threads AS $thread)
{
XenForo_Db::beginTransaction($db);
    $tagModel->rebuildTagCache('thread', $thread['thread_id']);
XenForo_Db::commit($db);
}

deleteThreshold is inclusive (so make it = 1 to delete single use tags)
synonym tags are generally all permanent.

I used this script to delete thousands of junk tags off SpaceBattles.
 
This add-on has some issues with BD-Cache AMP pages not being rendered, I'm sending Stuart a PC now.
 
Last edited:
When catogories is enabled a lot of errors appear, especially when catagories seperated is selected.

I have disabled them and is working perfect now.

How can you batch update wiki information?
 
Last edited:
When Categories Separated (thread view) option is enabled i get this when opening a thread and also 11 times in my serverlog.

error when catagories separate.webp
 
Serverlog (it is generated when someone clicks on a thread i think)

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 3 - library/Zend/Db/Statement/Mysqli.php:77

Gegenereerd Door: Onbekend Account, een moment geleden

Stack Trace
#0 /home/bodyforum/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('\n se...')
#1 /home/bodyforum/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '\n se...')
#2 /home/bodyforum/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('\n se...')
#3 /home/bodyforum/public_html/library/XenForo/Model.php(219): Zend_Db_Adapter_Abstract->query('\n se...', Array, 2)
#4 /home/bodyforum/public_html/library/TagEss/Model/Category.php(22): XenForo_Model->fetchAllKeyed('\n se...', 'category_id')
#5 /home/bodyforum/public_html/library/TagEss/XenForo/ControllerPublic/Thread.php(37): TagEss_Model_Category->getCategories(Array)
#6 /home/bodyforum/public_html/library/XenForo/FrontController.php(351): TagEss_XenForo_ControllerPublic_Thread->actionIndex()
#7 /home/bodyforum/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /home/bodyforum/public_html/index.php(13): XenForo_FrontController->run()
#9 {main}

Aanvraagstatus
array(3) {
["url"] => string(79) "http://forum.bodybuilding.nl/topics/beginnende-laatbloeier-zoekt-advies.395003/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Serverlog (it is generated when someone clicks on a thread i think)

Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 3 - library/Zend/Db/Statement/Mysqli.php:77

Gegenereerd Door: Onbekend Account, een moment geleden

Stack Trace
#0 /home/bodyforum/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('\n se...')
#1 /home/bodyforum/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '\n se...')
#2 /home/bodyforum/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('\n se...')
#3 /home/bodyforum/public_html/library/XenForo/Model.php(219): Zend_Db_Adapter_Abstract->query('\n se...', Array, 2)
#4 /home/bodyforum/public_html/library/TagEss/Model/Category.php(22): XenForo_Model->fetchAllKeyed('\n se...', 'category_id')
#5 /home/bodyforum/public_html/library/TagEss/XenForo/ControllerPublic/Thread.php(37): TagEss_Model_Category->getCategories(Array)
#6 /home/bodyforum/public_html/library/XenForo/FrontController.php(351): TagEss_XenForo_ControllerPublic_Thread->actionIndex()
#7 /home/bodyforum/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /home/bodyforum/public_html/index.php(13): XenForo_FrontController->run()
#9 {main}

Aanvraagstatus
array(3) {
["url"] => string(79) "http://forum.bodybuilding.nl/topics/beginnende-laatbloeier-zoekt-advies.395003/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Thanks for reporting. We're investigating.
 
Back
Top Bottom