Say you have two links directories, lets call them site a and site b.
Site a has a category called "Accommodation" and has an established list of links in that category.
Then I create a category on Site b also called accommodation, and rather than creating a new set of links, I want to you use the information I already have on site a for that category.
What is the best, and easiest way to either... Import the links from the "accommodation" category on site a to the "accommodation" category on site b. Or altenatively, display the info from site a on site b, by sharing a database between the two sites.
I realise that by sharing a database I can display links from site a, on site b, using a toplist, but the problem with that is the link details page for site b, will open the details page for site a, plus site b will not be searcheable that way.
I thought about automatically creating XML files using custom templates with no wrapper and a toplist, then importing the xml file to site b. Problem is, using the xml import in the admin panel, if I imoport a link that is already in the link directory, will it create a dulicate link?
Any ideas on the best way to share links between two directories?
There's no easy way to share a single category. I believe mysql's INSERT...SELECT syntax would be the key to importing, but I've never used it before. Something like
INSERT INTO desination_links (*) SELECT * FROM source_links WHERE catid=x;
I think. Replacing x with the desired catid. Though that'd require the category use the same id numbers on both sites. That would insert duplicates however, so you'd have to run the duplicate checker after the query.
I guess another solution would be to use phpmyadmin to copy the table to a temporary one, remove the id column, download a .sql file of links where catid=x, use a text editor to change the catid number to the new desired one, and then upload the result to the destination table.
Of course, these importing methods are one-time and don't sync up when the original site data changes.
Problem is, using the xml import in the admin panel, if I imoport a link that is already in the link directory, will it create a dulicate link?
Depends on your duplicate prevention settings selections. If you have it set to prevent duplicate submissions then it should exclude them. However, it won't update changes to existing listings.
Is it possible to have two installs share the same links and categories table in mysql? If so then I can use toplists to filter the displayed categories and links in site b.
I know you used to be able to tell the script which table to use for each item in config.php, but that no longer seems to be the case.
Comments on Sharing link details between two sites.
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
Say you have two links directories, lets call them site a and site b.
Site a has a category called "Accommodation" and has an established list of links in that category.
Then I create a category on Site b also called accommodation, and rather than creating a new set of links, I want to you use the information I already have on site a for that category.
What is the best, and easiest way to either... Import the links from the "accommodation" category on site a to the "accommodation" category on site b. Or altenatively, display the info from site a on site b, by sharing a database between the two sites.
I realise that by sharing a database I can display links from site a, on site b, using a toplist, but the problem with that is the link details page for site b, will open the details page for site a, plus site b will not be searcheable that way.
I thought about automatically creating XML files using custom templates with no wrapper and a toplist, then importing the xml file to site b. Problem is, using the xml import in the admin panel, if I imoport a link that is already in the link directory, will it create a dulicate link?
Any ideas on the best way to share links between two directories?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
There's no easy way to share a single category. I believe mysql's INSERT...SELECT syntax would be the key to importing, but I've never used it before. Something like
INSERT INTO desination_links (*)
SELECT *
FROM source_links WHERE catid=x;
I think. Replacing x with the desired catid. Though that'd require the category use the same id numbers on both sites. That would insert duplicates however, so you'd have to run the duplicate checker after the query.
I guess another solution would be to use phpmyadmin to copy the table to a temporary one, remove the id column, download a .sql file of links where catid=x, use a text editor to change the catid number to the new desired one, and then upload the result to the destination table.
Of course, these importing methods are one-time and don't sync up when the original site data changes.
Problem is, using the xml import in the admin panel, if I imoport a link that is already in the link directory, will it create a dulicate link?
Depends on your duplicate prevention settings selections. If you have it set to prevent duplicate submissions then it should exclude them. However, it won't update changes to existing listings.
Forum Regular
Usergroup: Customer
Joined: Nov 27, 2006
Total Topics: 187
Total Comments: 465
Is it possible to have two installs share the same links and categories table in mysql? If so then I can use toplists to filter the displayed categories and links in site b.
I know you used to be able to tell the script which table to use for each item in config.php, but that no longer seems to be the case.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Seems to not be possible anymore, it just auto-loads every table with the specified prefix.
For the knowledge bases I use all the same tables and just a different set of files/templates and a tweak to override the 'censor' values.