vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   New Posting Features - Automatic tags (https://vborg.vbsupport.ru/showthread.php?t=179772)

buro9 05-18-2008 10:00 PM

Automatic tags
 
Description

With vBulletin tags you can either set to require tags be completed or not. However requiring tags to be completed can easily result in low-quality tags that don't provide SEO value to your forum. With that in mind the thread title often provides better keywords than the tags that the user is forced to enter.

What this modification does is:

When a thread is started, has the user filled in tags?
Yes: Then we do nothing.
No: Then take the thread title, and strip out all words that would be invalid tags and are in the stop words list and use the remaining words as tags.

Example

User enters:
  • Thread title = We like the social group email mod
  • Thread tags =
vBulletin records the new thread as:
  • Thread title = We like the social group email mod
  • Thread tags = email, group, social
Which isn't an entirely bad set of tags and is better than none, and better than the user typing in gibberish (IMHO).

Installing

Installation REQUIRES FILE MODIFICATION. If you are not happy doing this, don't install this mod.

In the file /includes/functions_newpost.php

Find (near line 409):
PHP Code:

if ($type == 'thread' AND $post['taglist'])


Replace that with:
PHP Code:

// HACK : START : AUTO TAG
//      if ($type == 'thread' AND $post['taglist'])
//      {
        
if ($type == 'thread')
        {

                if (!
$post['taglist']) {
                        
$temptags split(' ',$post['title']);
                        
$newtags = array();
                        require(
DIR '/includes/searchwords.php');
                        foreach (
$temptags as $tagtext) {
                                if (
strlen($tagtext) <= || in_array(strtolower($tagtext), $badwords)) {
                                        
// Do nothing
                                
} else {
                                        
array_push($newtags,$tagtext);
                                }
                        }
                        
$post['taglist'] = join(',',$newtags);
                }
// HACK : END : AUTO TAG 

Uninstalling

Open the file /includes/functions_newpost.php

Find:
PHP Code:

// HACK : START : AUTO TAG 

Delete everything up to:
PHP Code:

// HACK : END : AUTO TAG 

Insert in that space:
PHP Code:

if ($type == 'thread' AND $post['taglist'])


Screenshots

Screenshots don't really make sense... read the description.

License

You are free to modify, create derivatives, produce any version of this that you wish even for commercial use, just leave in the code an attribution credit that contains the Url to http://www.buro9.com/

Effectively it's this:
https://vborg.vbsupport.ru/external/2008/05/9.png
Title: Automatic tags by B?ro9 is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.

HaYLaZ 05-19-2008 09:11 AM

I accepted this modification but I took error;

Parse error: parse error, unexpected $end in C:\AppServ\www\vbulletin\includes\functions_newpos t.php on line 1730

CThiessen 05-19-2008 09:19 AM

Hi,
pretty good idea. Do you think it might be possible in the future to check against an own positive List?
I think I do have about 100 Tags with the Main Words that Guest are looking for.

Christian

buro9 05-19-2008 09:32 AM

Quote:

Originally Posted by HaYLaZ (Post 1524530)
I accepted this modification but I took error;

Parse error: parse error, unexpected $end in C:\AppServ\www\vbulletin\includes\functions_newpos t.php on line 1730

The bit of code to be modified is around line 410.

Line 1730 is the very end of the file. It would suggest that there is a problem with the file that you have edited... check the code in the file that it ends with "?>".

I applied this hack to a file with no other modifications, and it does not create an error.

buro9 05-19-2008 09:33 AM

Quote:

Originally Posted by CThiessen (Post 1524539)
Hi,
pretty good idea. Do you think it might be possible in the future to check against an own positive List?
I think I do have about 100 Tags with the Main Words that Guest are looking for.

Christian

I don't see why not. This is why I allow derivative works... if you have a feature that you want implemented, go ahead and implement it :)

buro9 05-19-2008 09:36 AM

Actually... on the parse error... double check the number of brackets, the installation advice originally missed one, but it's now corrected.

CThiessen 05-19-2008 09:50 AM

Quote:

Originally Posted by buro9 (Post 1524552)
if you have a feature that you want implemented, go ahead and implement it :)

I can?t do that, I do not have the knowledge. :( Only Ideas.
next Step than is to Change words.
If somebody is writing:
  • American Airlines
  • Lufthansa
  • Delta Airlines
Change it in:
  • Fligth
or that ever to meet our special Keywords.
Christian

PS: I will install but in the Moment I can?t use FTP from here.

7lanet 05-19-2008 10:48 AM

Thanks ^_^
very good

buro9 05-19-2008 11:23 AM

It should work with arabic too if tags work with arabic. You can change the code to fit your needs if you feel it's not suited for you :)

7lanet 05-19-2008 11:33 AM

Can I make it too in reply

buro9 05-19-2008 11:36 AM

Quote:

Originally Posted by 7lanet (Post 1524655)
Can I make it too in reply

That sentence doesn't really make sense to me.

Do you mean that you want to populate tags for a thread if there are no tags already and someone responds to the thread? If so, this may be possible.

maxicep 05-19-2008 11:42 AM

Perfect

Installed !

7lanet 05-19-2008 11:54 AM

I mean
The amendment that I have done only for new post
But old post does not add topics
Can I make my words appear in new reply

buro9 05-19-2008 12:03 PM

Quote:

Originally Posted by 7lanet (Post 1524669)
I mean
The amendment that I have done only for new post
But old post does not add topics
Can I make my words appear in new reply

Yeah, I like that idea too.

I'll have to check to see whether I know about the thread at this point and whether updating the post will affect the thread... it may not.

leeman 05-19-2008 12:07 PM

<font color="Lime">*Installed*</font>

jasculs 05-19-2008 01:00 PM

What's the possibility of making automatic tags for threads that already exist?

Zaiaku 05-19-2008 01:03 PM

This would really be good if it did it for older post too. Is there a way to make it add tags weither or not tags are added?

buro9 05-19-2008 01:13 PM

What are you looking for?
1) Incrementally fixing old threads by populating tags if those threads are replied to?
or
2) Generating tags for all threads that have none?

buro9 05-19-2008 01:14 PM

To be honest I don't think doing all non-tagged threads would be difficult... the code is already up there and I'd just have to iterate over all threads.

maxicep 05-19-2008 01:17 PM

Quote:

Originally Posted by Zaiaku (Post 1524717)
This would really be good if it did it for older post too. Is there a way to make it add tags weither or not tags are added?

Yes, certainly ...

Zaiaku 05-19-2008 01:32 PM

Well the reason I would like it added to all threads with r without tags is just as discribe in the first post. It may use better tags then the ones already listed. Of course it would be a 1 time run since you don't want it to keep trying to add tags to all the threads over and over again.

M-Tuning 05-19-2008 01:39 PM

Works like a charm!

Good work.

MetalORock 05-19-2008 03:19 PM

very great hack thanks :)

GlitterKill 05-19-2008 06:00 PM

I have to agree that adding a feature/option to have it go back and generate tags for old, untagged threads would be great!

maxicep 05-19-2008 06:24 PM

I seen some problems and i removed it for now.

Example:
forum, maxicep.com maxicepdsadasdasd, melodi, mobile, phone

U will get error that "need min 3 character in tags for open thread"

because tags are looking
forum, maxicep.com, maxicepdsadasdasd, me, lodi, mobile, phone

It has problem on some thread titles like which include "<" or ">" character also ","

Just try and see.

If i set to all limits to no limit on tag system options, than no problem but it isnt fine.

Hornstar 05-19-2008 08:17 PM

excellent mod. thanks very much for this, I will install it later this week.

tpearl5 05-19-2008 09:22 PM

This reminds me of a good ol vb 2.0 hack :) Nice and simple too!

Installed!

Edit: Need to exclude non-word characters For example, see the tags on this thread:
http://cellphoneforums.net/htc/t2758...-s710-vox.html

paramegsoft 05-20-2008 03:24 AM

welcome

very nice mod buro9

but please

how i can do it to some forums only

like forum id 4 and 5

and how i activate it in rss forums which get news from another sites

abrecher 05-20-2008 04:18 AM

Quote:

Originally Posted by maxicep (Post 1524983)
I seen some problems and i removed it for now.

Example:
forum, maxicep.com maxicepdsadasdasd, melodi, mobile, phone

U will get error that "need min 3 character in tags for open thread"

because tags are looking
forum, maxicep.com, maxicepdsadasdasd, me, lodi, mobile, phone

It has problem on some thread titles like which include "<" or ">" character also ","

Just try and see.

If i set to all limits to no limit on tag system options, than no problem but it isnt fine.

This is EXACTLY what I've been waiting for! This user definitely is making a good point and I hope his issues will be addressed in future versions.

I also would LOVE to be able to run a script which would backdate this for all old threads.

maxicep 05-20-2008 08:35 AM

Quote:

Originally Posted by tpearl5 (Post 1525147)
This reminds me of a good ol vb 2.0 hack :) Nice and simple too!

Installed!

Edit: Need to exclude non-word characters For example, see the tags on this thread:
http://cellphoneforums.net/htc/t2758...-s710-vox.html

Tags are looking very bad. :o

peterska2 05-20-2008 09:33 AM

nice one! I've been keeping an eye out for something like this.

/me tags thread to download and install later

masterross 05-20-2008 10:26 AM

@buro9

mate do u familiar with AJAX?
I think will be better if it's AJAX based hack which takes the words from thread title immediately after we left the title field and put the suggestion in tags field.
So users will have possibility to edit unwanted tags.

DubaiHost 05-20-2008 10:37 AM

Perfect Idea .. !
Installed

wtrk 05-20-2008 03:30 PM

good idea. tagged for when i update to 3.7.0. thanks!

jim6763nva 05-20-2008 04:37 PM

Thank you for this - works great!

Jim

Newfarm 05-20-2008 04:50 PM

masterross's idea is actually very, very cool.

That being said, installed and crossing fingers for some fancy ajax implementation ;)

TruthElixirX 05-21-2008 01:53 AM

I have a weird question.

If I have tags off, will this still auto add them in the background, so to speak?

We're wanting to wait a bit to enable tags, but when we do, would this modification have been working in the background?

EDIT::

Found a work around for this. Thanks for the hack!

DestekForumu 05-24-2008 08:34 PM

thank you

jim6763nva 05-25-2008 02:29 AM

How difficult would it be to do this for RSS posts?

xorex 05-25-2008 10:31 PM

nice !! Ingeniously.....

coder genius :D


All times are GMT. The time now is 07:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01459 seconds
  • Memory Usage 1,835KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete