Version PHP 5.6combuster wrote:@strelok-by: your PHP-Version could be out of date. Be sure to use a up-to-date PHP version. However, I will try to ommit the mb_strlen, because its not enabled by default: https://github.com/RobertHeim/phpbb-ext ... /issues/42 (already fixed in master branch)
No, just a hoster not activated mbstringcombuster wrote:Be sure to use a up-to-date PHP version
This is not right, you should replace the code in /ext/robertheim/topictags/service/tags_manager.phpcombuster wrote:However, I will try to ommit the mb_strlen, because its not enabled by default
Code: Select all
if (mb_strlen($query, 'UTF-8') < 3)
{
return array();
}
Code: Select all
if(function_exists('mb_strlen'))
{
if (mb_strlen($query, 'UTF-8') < 3)
{
return array();
}
}
else
{
$dummy = array();
if (preg_match_all("/.{1}/us", $query, $dummy) < 3)
return array();
}
You should always use a up-to-date PHP version.пхпBBGuRu wrote:No, just a hoster not activated mbstringcombuster wrote:Be sure to use a up-to-date PHP version
Code: Select all
General Error
SQL ERROR [ sqlite3 ]
near "t": syntax error [1]
SQL
UPDATE phpbb_rh_topictags_tag t SET t.count = ( SELECT COUNT(tt.id) FROM phpbb_topics topics, phpbb_forums f, phpbb_rh_topictags tt WHERE tt.tag_id = t.id AND topics.topic_id = tt.topic_id AND f.forum_id = topics.forum_id AND f.rh_topictags_enabled = 1 )
Thanks for hint. I will have a look to this, you will find updates there: https://github.com/RobertHeim/phpbb-ext ... /issues/43jbanana wrote: Seems to me sqlite3 is not liking the table alias in update query.
Code: Select all
--- H:/phpbbstyles/phpbb-ext-topictags-0.0.12-BETA/service/tags_manager (2).php Sat Nov 08 13:15:02 2014
+++ H:/phpbbstyles/phpbb-ext-topictags-0.0.12-BETA/service/tags_manager.php Tue Jan 06 15:18:13 2015
@@ -70,12 +70,12 @@
// https://www.phpbb.com/community/viewtopic.php?f=461&t=2263646
// so we would need 2 queries, but this is slow... so we use subqueries and hope - yeah! :D
- $sql = 'DELETE t
- FROM ' . $this->table_prefix . TABLES::TAGS . ' t
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TAGS . '
WHERE NOT EXISTS (
SELECT 1
FROM ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
- WHERE tt.tag_id = t.id
+ WHERE tt.tag_id = ' . $this->table_prefix . TABLES::TAGS . '.id
)';
$this->db->sql_query($sql);
@@ -101,9 +101,9 @@
}
}
// delete all tag-assignments where the tag is not valid
- $sql = 'DELETE tt
- FROM ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
- WHERE ' . $this->db->sql_in_set('tt.tag_id', $ids_of_invalid_tags);
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TOPICTAGS . '
+ WHERE ' . $this->db->sql_in_set('tag_id', $ids_of_invalid_tags);
$this->db->sql_query($sql);
$removed_count = $this->db->sql_affectedrows();
@@ -120,12 +120,12 @@
public function delete_assignments_where_topic_does_not_exist()
{
// delete all tag-assignments where the topic does not exist anymore
- $sql = 'DELETE tt
- FROM ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TOPICTAGS . '
WHERE NOT EXISTS (
SELECT 1
FROM ' . TOPICS_TABLE . ' topics
- WHERE topics.topic_id = tt.topic_id
+ WHERE topics.topic_id = ' . $this->table_prefix . TABLES::TOPICTAGS . '.topic_id
)';
$this->db->sql_query($sql);
$removed_count = $this->db->sql_affectedrows();
@@ -161,13 +161,13 @@
$forums_sql_where = ' AND ' . $this->db->sql_in_set('f.forum_id', $int_ids);
}
// Deletes all topic-assignments to topics that reside in a forum with tagging disabled.
- $sql = 'DELETE tt
- FROM ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TOPICTAGS . '
WHERE EXISTS (
SELECT 1
FROM ' . TOPICS_TABLE . ' topics,
' . FORUMS_TABLE . " f
- WHERE topics.topic_id = tt.topic_id
+ WHERE topics.topic_id = ' . $this->table_prefix . TABLES::TOPICTAGS . '.topic_id
AND f.forum_id = topics.forum_id
AND f.rh_topictags_enabled = 0
$forums_sql_where
@@ -726,13 +726,13 @@
*/
public function calc_count_tags()
{
- $sql = 'UPDATE ' . $this->table_prefix . TABLES::TAGS . ' t
- SET t.count = (
+ $sql = 'UPDATE ' . $this->table_prefix . TABLES::TAGS . '
+ SET count = (
SELECT COUNT(tt.id)
FROM ' . TOPICS_TABLE . ' topics,
' . FORUMS_TABLE . ' f,
' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
- WHERE tt.tag_id = t.id
+ WHERE tt.tag_id = ' . $this->table_prefix . TABLES::TAGS . '.id
AND topics.topic_id = tt.topic_id
AND f.forum_id = topics.forum_id
AND f.rh_topictags_enabled = 1
@@ -783,18 +783,18 @@
// delete assignments where the new tag is already assigned
$topic_ids_already_assigned = $this->get_topic_ids_by_tag_id($tag_to_keep_id);
- $sql = 'DELETE tt FROM ' . $this->table_prefix . TABLES::TOPICTAGS. ' tt
- WHERE ' . $this->db->sql_in_set('tt.topic_id', $topic_ids_already_assigned) . '
- AND tt.tag_id = ' . (int) $tag_to_delete_id;
+ $sql = 'DELETE FROM ' . $this->table_prefix . TABLES::TOPICTAGS. '
+ WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids_already_assigned) . '
+ AND tag_id = ' . (int) $tag_to_delete_id;
$this->db->sql_query($sql);
// renew assignments where the new tag is not assigned, yet
$sql_ary = array(
- 'tt.tag_id' => $tag_to_keep_id,
+ $this->table_prefix . TABLES::TOPICTAGS . '.tag_id' => $tag_to_keep_id,
);
- $sql = 'UPDATE ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
+ $sql = 'UPDATE ' . $this->table_prefix . TABLES::TOPICTAGS . '
SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE tt.tag_id = ' . (int) $tag_to_delete_id;
+ WHERE ' . $this->table_prefix . TABLES::TOPICTAGS . '.tag_id = ' . (int) $tag_to_delete_id;
$this->db->sql_query($sql);
$this->delete_tag($tag_to_delete_id);
@@ -809,14 +809,14 @@
*/
public function delete_tag($tag_id)
{
- $sql = 'DELETE tt
- FROM ' . $this->table_prefix . TABLES::TOPICTAGS . ' tt
- WHERE tt.tag_id = ' . ((int) $tag_id);
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TOPICTAGS . '
+ WHERE tag_id = ' . ((int) $tag_id);
$this->db->sql_query($sql);
- $sql = 'DELETE t
- FROM ' . $this->table_prefix . TABLES::TAGS . ' t
- WHERE t.id = ' . ((int) $tag_id);
+ $sql = 'DELETE
+ FROM ' . $this->table_prefix . TABLES::TAGS . '
+ WHERE id = ' . ((int) $tag_id);
$this->db->sql_query($sql);
}
@@ -830,11 +830,11 @@
public function rename($tag_id, $new_name_clean)
{
$sql_ary = array(
- 't.tag' => $new_name_clean,
+ $this->table_prefix . TABLES::TAGS . '.tag' => $new_name_clean,
);
- $sql = 'UPDATE ' . $this->table_prefix . TABLES::TAGS . ' t
+ $sql = 'UPDATE ' . $this->table_prefix . TABLES::TAGS . '
SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE t.id = ' . ((int) $tag_id);
+ WHERE ' . $this->table_prefix . TABLES::TAGS . '.id = ' . ((int) $tag_id);
$this->db->sql_query($sql);
return $this->count_topics_by_tags(array($new_name_clean), 'AND', true);
}
Code: Select all
http://site/tag/%25D0%25B1%25D0%25BB%25D1%258F
Code: Select all
http://site/tag/бля