The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Mass assign categories to CMS articles
I've recently set up new categories of CMS articles and would like to retrospectively add articles to categories. I can do them manually one at a time, but that takes a long time.
Is there an easy mysql query I can use to add categories to articles based on specific keywords in the article titles? For example, if the article title contains the word "Football" then add it to the football category (bearing in mind that articles can belong to multiple categories). Thanks in advance for any help! |
#2
|
|||
|
|||
Just a quick bump in the hope somebody has some ideas!
|
#3
|
||||
|
||||
This is something you would have to either code yourself or hire someone to code more and likely. There is no easy answer for this. A competent PHP coder may be able to code this into your site for you.
|
#4
|
|||
|
|||
Yeah, I get it needs writing. That's why I'm asking in the Programming Discussions forum.
I'm sure it can be done just with an SQL query in a similar way to how mass assigning of prefixes was when I asked before: https://vborg.vbsupport.ru/showthread.php?t=299427 I'd attempt it myself if I wasn't so terrified of messing up the query and wrecking things! --------------- Added [DATE]1416676693[/DATE] at [TIME]1416676693[/TIME] --------------- Looking at the database, it seems it needs a new row inserted into cms_nodecategory, consisting of just categorid and nodeid. If that's all it is, it shouldn't be too hard. But is there anything else I should be aware of? I've glanced through the cms tables and don't immediately see anything else referencing articles -> categories. Assuming that's the case, I guess it'd be something like: INSERT INTO cms_nodecategory (categoryid, nodeid) VALUES (x, y); but Google tells me INSERT doesn't support a WHERE statement, so I can't add anything WHERE article.title LIKE '%Z%' So I'm guessing it needs some kinda SELECT stuff first, but I'm out of my depth at that point! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|