1
RImark
batch upload to weblinks
  • 2004/11/20 8:35

  • RImark

  • Just popping in

  • Posts: 24

  • Since: 2004/10/20


I'm trying hard to get content up to my site so I can reveal it to the world. I have a bunch of links that I'd like to get up there but I hate the thought of typing each one at a time.

Is there any way to do a batch-upload of Weblinks? I can generate a delimited file or whatever is needed here on my computer.

Thanks!

RImark
N. Kingstown RI USA

2
Herko
Re: batch upload to weblinks
  • 2004/11/20 10:45

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


SQL import, but you'll have to make the import file fit the data structure of the mylinks SQL tables.

Hekro

3
RImark
Re: batch upload to weblinks
  • 2004/11/21 7:38

  • RImark

  • Just popping in

  • Posts: 24

  • Since: 2004/10/20


Thanks Hekro. I wish I had the money to pay for this util, but I don't at the moment. I may attempt to write this util. If it works I will be happy to release it to others as I think this is very valuable.

I guess I should start with the current "add link" PHP code?

Mark




Re: batch upload to weblinks

by Herko on 2004/11/20 5:45:08

SQL import, but you'll have to make the import file fit the data structure of the mylinks SQL tables.

Hekro

4
gppetersen
Re: batch upload to weblinks
  • 2004/11/23 2:19

  • gppetersen

  • Just popping in

  • Posts: 3

  • Since: 2004/11/23


I'm going to have to do some importing myself so I had a look at this.
The MySQL utils that come with MySql can be used. I have shell access, you'll need this too if you do this.

The idea is to dump the db to a text file then use that as an example to create a text file of sql commands.
This can then be used by the MySQL utils to import the links. It wasn't too hard.

In the XOOPS admin, Activate the links, set up the Categories and add a link for an example.

Now get the DB into a text file:
mysqldump [-hhostname if not local] -uuser -ppassword XOOPS > xoops.sql
Assuming the XOOPS db is called xoops, and your MySQL user name is user with a password of password. This will dump ALL of the XOOPS DB to xoops.sql as ascii text.

You'll see your example links in this file.
Have a look at section under
-- Dumping data for table `xoops_mylinks_cat`
to find the number for each link group like this
INSERT INTO xoops_mylinks_cat VALUES (1,0,'News','http://');
in the above link the number for the News cat' is 1. It is a sub'cat' of cat 0, I guess that 0 is top cat'.

You'll need to note the number if you want catogories, other wise just make one general one and add them all to that. The cat number should be 1.

Heres a line I just imported:
----sql-start---
use xoops;

INSERT INTO xoops_mylinks_links VALUES (2,1,'boingboing','http://boingboing.net','',1,1,1101166311,1,0.0000,0,0);
INSERT INTO xoops_mylinks_text VALUES (2,'Boing boing: Interesting things.');
----sql-end----


There are two lines for each link
The first number must increment for the next link eg:
INSERT INTO xoops_mylinks_links VALUES (3,1,'Slashdot','ht..
INSERT INTO xoops_mylinks_text VALUES (3,'Slashdot: tech news

The second number is the Category. I've left all mine as 1, the news Category.

Other then that, change the name and the url in the first line and the description in the second.

save this file as new-links.sql then import them:
mysql -uuser -ppassword XOOPS < new-links.sql

5
script_fu
Re: batch upload to weblinks

Thats one hell of a first post gppetersen! XOOPS needs a way to do this fuction in a easy manner. If only this was a module that you could export the weblinks file. Then upload to other XOOPS sites. I for one would be a happy camper. Weblinks are the most consuming part of building an XOOPS site. Then multiply by about ten different sites = Chaos !!!

Im bookmarking this entire post to what developes...

Thanks for the first tangeable post on how to solve this major problem with xoops...

Login

Who's Online

229 user(s) are online (173 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits