Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Export links from one cat and subcat

Quote Reply
Export links from one cat and subcat
Hi,

How I can export all links from one main category and subcategories? (with Links SQL 2.1.2)

I have found this thread but not work http://www.gossamer-threads.com/...forum.cgi?post=71716

Thank you in advance!

-----------------------
Nomada
Quote Reply
Re: [Nomada] Export links from one cat and subcat In reply to
Hi,

I'm actually working on this issue now, since I need to export some categoris, and import them into a new database, on another Links SQL instance.

I might get to it tonight, (I might not), but it's high on my list, since I have some topics I moved from one domain to another, and they are out of place and missing, and don't look right.

I was actually hoping to make it a script, nothing fancy, but you'd enter the few parameters you wanted, and run it. No plugin, or fancy interface.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Export links from one cat and subcat In reply to
Hi Pugdog,

I have try an SQL query that works fine:

SELECT L.*, C.Full_Name, R.LinkID FROM lsql_links as L, lsql_catlinks as R, lsql_category as C
WHERE L.ID=R.LinkID AND R.CategoryID=C.ID AND C.Full_Name LIKE 'MyExportCategory%'

* The Full_Name LIKE sentence allow you get all links from MyExportCategory/subcategory/subcategory...

Also to export into a file:

SELECT L.*, C.Full_Name, R.LinkID INTO OUTFILE 'links_by_cat.txt'
FROM lsql_links as L, lsql_catlinks as R, lsql_category as C
WHERE L.ID=R.LinkID AND R.CategoryID=C.ID AND C.Full_Name LIKE 'MyExportCategory%'



Cheers!

-----------------------
Nomada
Quote Reply
Re: [Nomada] Export links from one cat and subcat In reply to
Hi,

That's a good start, and I'll give it a shot, but what I want to do, ultimately, is to be able to export a tree (category and subcats). This is why a perl script is needed, to keep track of the categories that need to be exported.

Get a category, find all subcats, then export all those subcats.

For two or three categories, manually is not bad. But when a tree may have a few (or more) sub cats, it gets time consuming. Then there is some housekeeping to do to clean up after, and to prepare the new database to accept them.

Mostly grunt work <G>


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.