Требуется опция для автоматического добавления хеш-тегов в конце или начале текста поста.

Сами теги предполагается брать из поля типа Tags. Кроме того было бы полезным добавления статических тегов: официальные теги сообщества в контакте, теги на основе типа материала.

Пример

Мы анонсируем поддержку хеш-тегов в контакте.
#паблик_аракадабра, #новости, #хеш-теги, #поддержка

Comments

anpolimus’s picture

Assigned: Unassigned » anpolimus
anpolimus’s picture

Status: Active » Needs review
StatusFileSize
new2.52 KB

Hi.
Please, review my patch.

anpolimus’s picture

UP. Please, somebody review m patch.

kaztur’s picture

StatusFileSize
new45.26 KB

@anpolimus, great Thank You for the patch!

Reposting tags works fine:
vkxp

But there is an error in dblog: Deprecated function: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead в функции vkxp_query() (строка 286 в файле /sites/all/modules/vkxp/vkxp.module).

And a little feature request - is there just change any line in patch to add only in public search by hastags? It is realizing by adding @publicname to each hashtag (e.g. "#nyhashtag@mypublic)".
(Documentation in Vk: https://vk.com/pages?oid=-2158488&p=%D0%9B%D0%BE%D0%BA%D0%B0%D0%BB%D1%8C...)

kaztur’s picture

Also, I suppose the line
$hash_tags[] = '#' . str_replace(' ', '_', $item['name']);

would be better to change to
$hash_tags[] = '#' . str_replace(' ', '', $item['name']);

After all, fused writing of hashtags containing two or more words in Vk as to me is more often than via underscore.

kaztur’s picture

Some problem with compatability with this patch: https://www.drupal.org/node/1677850
When posting to vk with rules and scheduler, hashtags are empty. Is there any solution?

anpolimus’s picture

Thanks for your answer.
I'll retest it again soon.

anpolimus’s picture

Hi, I've retested my code with action and everything is working properly.
http://screencloud.net/v/jvNL

Important thing - tags field should be configured for hash tags support
http://screencloud.net/v/7Sc1

anpolimus’s picture

StatusFileSize
new2.51 KB
anpolimus’s picture

A new patch with

$hash_tags[] = '#' . str_replace(' ', '', $item['name']);

has added.

About publicname. Is it sufficient to get this data from node field (like it is done for hash tag field)?
@kaztur, please answer.

anpolimus’s picture

Needs review again :)

anpolimus’s picture

Up

kaztur’s picture

@anpolimus, #6 repeats again.
In dblog I have to logs, but they seems to be not issues to hashtags:

Notice: Undefined index: name в функции _vkxp_get_node_message() (строка 255 в файле /sites/all/modules/vkxp/vkxp.module).
Deprecated function: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead в функции vkxp_query() (строка 286 в файле /sites/all/modules/vkxp/vkxp.module).

So the first notice (undefined index) appears only id we schedule node publish (no notice when publishing immediately by saving node).

anpolimus’s picture

Issue tags: +Needs manual testing
StatusFileSize
new2.81 KB
anpolimus’s picture

anpolimus’s picture

@kaztur, please retest with the latest patch.

kaztur’s picture

@anpolimus, great thanks!

I have tested the last patch and don't know while, which kind bug is it, but instead of the last hashtag there was posted penultimate tag twice.

E.g.: if we have 3 tags for node: football, ball, play; we will have hashtags posted #football, #ball, #ball.
The same behavior if we post node directly by saving node (without scheduler and rules).

Tested it twice with 2 different nodes.

anpolimus’s picture

Thanks for testing.
Investigating that.

anpolimus’s picture

StatusFileSize
new2.87 KB

A new patch for testing is ready.

kaztur’s picture

@anpolimus, now it works fine. Finally great thank You!
If every maintainer would have been like you... :)

kaztur’s picture

Status: Needs review » Reviewed & tested by the community
anpolimus’s picture

  • Anatoliy Polyakov committed 922ebf0 on 7.x-2.x
    git commit -m 'Issue #2298751 by anpolimus: Добавление хеш-тегов' --...
anpolimus’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Latest patch has been commited. to dev version.

anpolimus’s picture

Status: Patch (to be ported) » Fixed

Task marked as fixed. This commit would be at 7.x-2.21 version.

anpolimus’s picture

Status: Fixed » Closed (fixed)