Tagging System For Topics

Started by SMFHacks.com Team, December 19, 2006, 10:59:20 AM

Previous topic - Next topic

Kimmie

#240
couple of real quick questions - the only permission is "Manage Tags" and says Users can modify the tag settings and add and remove tags. However, without this permission even checked,


1. I noticed that every single member has access to add tags to anyone elses posts, and also delete anyones tags (this is without the permission checked). How can I change it so they can only add tags to their own topics and remove their own tags? (I tested this out with a test account that is in a regular member group)

2. When replies are made to a topic that has been tagged, the tags move down to the reply post and do not stay with the actual post that was tagged. (this happens for only "some" members - tested this out on a test account as well). If a topic has several replies, one would have to literally go to the end of that topic to remove or add a tag to that topic.  This also causes a problem when adding tags to topics that dont have any. THe problem being that since the "Add Tag" link is now on the last reply of that topic, adding a tag links it to that post, not the original post.

vbgamer45

1. Requires cusotm code.

2. Mod is for tagging of topics not tagging of each post.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kimmie

#242
Quote from: vbgamer45 on June 15, 2008, 09:00:31 PM
1. Requires cusotm code.

So anyoyne can change, delete, and add tags to anyone elses topics. (not a good idea as that feature would and probably will be abused)

Quote2. Mod is for tagging of topics not tagging of each post.

Yes I know it is supposed to tag the topic not an indivual post. That doesnt answer my question..lol. I need to know why, as replies are made to a topic that has tags, the actual tags keep moving down (to the bottom of the latest reply), instead of staying with the original post in the topic (which is what was tagged). If a topic has multiple replies, you have to go to the very end of the topic (to the last reply) in order to add tags, remove tags, etc. It would be much simpler if the tags stayed put.


I am also curious as to why there is even a permission on each membergroup if theyt can already add and delete a tag on "anyones" topic. (I tested that setting out on a regular test account and nothing changed)

kai920

Quote from: Kimmie on June 16, 2008, 12:25:16 AM
If a topic has multiple replies, you have to go to the very end of the topic (to the last reply) in order to add tags, remove tags, etc. It would be much simpler if the tags stayed put.
This is a good point. perhaps simple code can be added so that the tags display both above and below the entire topic.

127.0.0.1

When a tagged topic is deleted, the corresponding topic is not deleted from the tags_log (unless something is just borked with my installation).

Kimmie

Quote from: 127.0.0.1 on June 17, 2008, 12:17:41 AM
When a tagged topic is deleted, the corresponding topic is not deleted from the tags_log (unless something is just borked with my installation).

The best way to handle this (I learned the hard way) is to make sure all tags are removed from a topic "before" the topic is deleted. This will also remedy the issue it being the only topic using those specific tags and the  tags still showing up in the tag cloud.

Luckily on my site, I dont allow anyone to delete anything (not even staff) which allows me to control both those issues.

Kimmie

#246
Found glitch with the tag cloud, thought I would also mention it here because I am not sure if its a code issue on the cloud or in the mod (also mentioned it on the TP site incase its an issue with the code for the tag cloud)... its not linking the same tag words correctly. If the same exact tag word is put on multiple topics, but not in the same order, it creates duplicate tags in the cloud - and also will not pull correctly when the tag is clicked on.

Example: (3 topics)

1st topics tags:   Jokes
2nd topics tags: Comedy, Jokes
3rd Topics tags: Comedy, Jokes

(the "jokes" tag is in the 1st spot on topic 1 and in the 2nd spot on topics 2,3)

There will be 2 seperate tags in the cloud for "jokes". When each tag is clicked on, 1 brings up only 1 topic, the other brings up the other 2 topics. When I changed the order of the tags so that the tag "jokes" was in the 1st spot on all of them, it removed the 2nd tag in the cloud and then when the tag "jokes" was clicked on, all 3 topics then appeared on the list like they are supposed to.

kai920

Are you sure you don't have extra space(s) in front of "jokes"?

Kimmie

Quote from: kai920 on June 18, 2008, 04:56:00 AM
Are you sure you don't have extra space(s) in front of "jokes"?


Thanks for the fast response :)

Someone over at TP asked me something similar - wanting to know if the tags were typed in using spaces like this:

Comedy, Jokes <----Space inbetween the comma and Jokes

or like this:

Comedy,Jokes  <----- no spaces inbetween the comma and Jokes.

I actually wondered about this being as the mod is not specific in the instructions it labels under the tag box, so what I did was assumed it was set up like pms are set up when sending to mulitiple people (it uses a space after the comma). I will test their theory and see if that is indeed the problem. If it is the case, and if the mod cannot be changed so that it doesnt matter if they are seperated by a space after the comma or not, the instructions when the mod is installed really need to reflect this because most people will assume tht there needs to be one.

kai920

I agree 100%, the default behavior should strip spaces in front of and after tags (but not in between).

You just need to look up a bit... I had already asked about this and Niko provided an easy fix :)

Kimmie

Quote from: kai920 on June 18, 2008, 12:13:21 PM
I agree 100%, the default behavior should strip spaces in front of and after tags (but not in between).

You just need to look up a bit... I had already asked about this and Niko provided an easy fix :)


I Didnt have time to read thru the whole topic at the time. I will have to try Niko's fix and see if it will work.

I still however, need someone to tell me how to remove the tags once a topic has been deleted. (I have two tags I need to remove - when I was testing out the tags I didnt know it wouldnt delete the tags when you delete a topic and I deleted one)

I also would like to ask if the ability to sort the topics that come up when you click on a tag will ever be added (like you can sort regular topics). Either sorting by Subject or by Started By would be great. 

127.0.0.1

#251
Quote from: Kimmie on June 17, 2008, 10:53:19 AM
Quote from: 127.0.0.1 on June 17, 2008, 12:17:41 AM
When a tagged topic is deleted, the corresponding topic is not deleted from the tags_log (unless something is just borked with my installation).

The best way to handle this (I learned the hard way) is to make sure all tags are removed from a topic "before" the topic is deleted. This will also remedy the issue it being the only topic using those specific tags and the  tags still showing up in the tag cloud.

Luckily on my site, I dont allow anyone to delete anything (not even staff) which allows me to control both those issues.

That is too inefficient. Just imagine a scenario where you have to mass delete topics. Repetitious tasks like this should be done automatically. I hope the developer addresses this issue in upcoming versions.

Also I have not tested the following but I wonder how merged or split topics are handled with this mod.

I really like the idea of tagging topics but to add to my list of suggestions for this mod before I start using it:

1. Implement AJAX to add/delete tags.
2. Make necessary deletions from the tag table when a topic is deleted.


PS Including a tool in the admin center to recalculate/repopulate the tag info would be convenient.

Kimmie

#252
Quote from: 127.0.0.1 on June 25, 2008, 06:45:54 PM
Quote from: Kimmie on June 17, 2008, 10:53:19 AM
Quote from: 127.0.0.1 on June 17, 2008, 12:17:41 AM
When a tagged topic is deleted, the corresponding topic is not deleted from the tags_log (unless something is just borked with my installation).

The best way to handle this (I learned the hard way) is to make sure all tags are removed from a topic "before" the topic is deleted. This will also remedy the issue it being the only topic using those specific tags and the  tags still showing up in the tag cloud.

Luckily on my site, I dont allow anyone to delete anything (not even staff) which allows me to control both those issues.

That is too inefficient. Just imagine a scenario where you have to mass delete topics. Repetitious tasks like this should be done automatically. I hope the developer addresses this issue in upcoming versions.

Also I have not tested the following but I wonder how merged or split topics are handled with this mod.

I really like the idea of tagging topics but to add to my list of suggestions for this mod before I start using it:

1. Implement AJAX to add/delete tags.
2. Make necessary deletions from the tag table when a topic is deleted.


PS Including a tool in the admin center to recalculate/repopulate the tag info would be convenient.

well although its not to inefficient for me since I dont mass delete anything, I can see your point if someone would need to perform that task.

As for splitting, a tag is attached to the topic not a post so if you split out post(s), that tag will still remain with the original topic it was attached to. If you want the new topic you just made to also have tags you have to add them (its a "new" topic).

As for merging, I just tried it, and there "is" a problem with it. I merged two topics together that each had a tag and the new topic only took on the tag of the first topic made. When I split the post back out, the 2nd tag didnt return to that topic. Whick means, now i have ANOTHER tag out there just floating around..lol

Unfotunately, it doesnt look like the mod creator thought this through all the way before they posted it.

I'm also curious as to what would happen should one uninstall the mod (without manually removing all the tags first).

ichuan

#253
Quote from: 127.0.0.1 on June 17, 2008, 12:17:41 AM
When a tagged topic is deleted, the corresponding topic is not deleted from the tags_log (unless something is just borked with my installation).

i've fixed this by editing 'RemoveTopic.php' in smf's 'source' folder as follows:

1. append these code at the end of RemoveTopic.php:
function removeTags($topic)
{
    global $db_prefix;
    //find tagsid
    $result = db_query("
SELECT ID_TAG FROM {$db_prefix}tags_log
WHERE ID_TOPIC = $topic", __FILE__, __LINE__);
if (!mysql_num_rows($result))
   return;
$tagsid = array();
while ($row = mysql_fetch_assoc($result)){
        if ((int)mysql_result(db_query("SELECT COUNT(ID_TAG) FROM {$db_prefix}tags_log WHERE ID_TAG={$row['ID_TAG']}"),0) == 1)
  $tagsid[] = $row['ID_TAG'];
}
   
    //delete tags_log
db_query("
        DELETE FROM {$db_prefix}tags_log
    WHERE ID_TOPIC = $topic", __FILE__, __LINE__);
    //delete tags
db_query("
        DELETE FROM {$db_prefix}tags
    WHERE ID_TAG IN (" . implode(', ', $tagsid) . ")", __FILE__, __LINE__);
}


2. search for 'removeTopics($topic);' in this file, and append 'removeTags($topic);' under it

3. search for '$full_topic = removeMessage($_REQUEST['msg']);' in this file, and append codes below under it:
if ($full_topic)
   removeTags($topic);


i've test it on my site and it works fine.
attached is my modified 'RemoveTopic.php', may this help you.

ChaosEnergy

Hi

I cant see any effort of the Permission Manage Tags
Also the Suggest Tags permission in xml, does not appear anywhere

I like to have only some membergroups to be able to add/suggest tags
not the generic user
Chaos Empire ®

vbgamer45

Suggest tags is not built into the mod yet.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kimmie

Starting to see issues with this mod. Example, you want to remove a tag and add the same tag only a different spelling (capital versus lower case), its putting the original tag back on.

Example:

Original tag: "books"
You remove that one and add "Books"
It updates and has the original one back on ("books" with lower case B).

This wouldnt be that big of an issue however both show up on the tag cloud and only the topics with the tag "books" show up when you click that tag (and only the topics with "Books" show up when you click on that tag".

Any ideas why this is happening?

Also, the tags page doesnt line up right. The tag cloud is left aligned and the topics section is centered.

digit

FYI - I just downloaded and installed this mod for 2.0 beta 3.1.

After installing, I received an error can not find smf_tags table.  I looked in phpmyadmin and sure enough the table wasn't there. (and I am not sure why,....  everything else seemed to install ok)

SO - I manually created the table from the 1.x version...

CREATE TABLE IF NOT EXISTS {$db_prefix}tags
(ID_TAG mediumint(8) NOT NULL auto_increment,
tag tinytext NOT NULL,
approved tinyint(4) NOT NULL default '0',
PRIMARY KEY  (ID_TAG))



...It seems to be working fine.

If not, please let me know what I need to do.

Obviously, the 2.0 version creates the table like this....

$columns = array(
array(
'name' => 'id_tag',
'type' => 'mediumint',
'size' => 8,
'null' => false,
'auto' => true,
),
array(
'name' => 'tag',
'type' => 'tinytext',
),
array(
'name' => 'approved',
'type' => 'tinyint',
'size' => 4,
'default' => 0,
'null' => false,
),
);

$indexes = array(
array(
'type' => 'primary',
'columns' => array('id_tag'),
),


);

$smcFunc['db_create_table']($db_prefix . 'tags', $columns, $indexes, array(), 'update_remove');



It looks like I am missing some columns or something...... but I don't know how to manually run the sql command (from the 2.0 mod... to create it!

Thanks in advance for your help!


Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

vbgamer45

Yeah the 2.0 version should have been pulled from the mod site it is not supported at this time. 2.0 changed a lot of stuff which will take me a long time to update all my mods.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

digit

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Advertisement: