Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Questions for Articles Submission

Quote Reply
Questions for Articles Submission
Hello,

I have a question : I want to let visitors contribute to the contents of my site, by letting them submit their own articles to me, and I think the perfect way to do that is to use links 2.0; I saw a nice example on this website http://www.parcferme.com/add.cgi.

I want to ask whether you can tell me how I can achieve a similar result without using LinksSQL since I have no SQL support.

I can't afford to have a large database of links.db because it's a flat file and I already have over 2000 articles ready to be put up on the net.

I would also like to still be able to use the modify and build function in links 2.0.

A way that I can think of is that when people submit the stories, it executes a mod script that will build .txt files with the ID number (1.txt, 2.txt, 3.txt, 4.txt etc).

After I approve the submission, links 2.0 will then build the html files (1.html, 2.html, 3.html, 4.html etc). I would like to have both .html and .txt version because web space is not a concern for me.

When I want to modify articles, I will be modifying the text files then I will build the html files again afterwards.

It's like having the content of links.db in separate text files with all search, modify and build function all intact. But the thing is that I don't know how to do this since I'm not a Perl Programmer.

Can any of you help me?

Thanks,
Indri

Quote Reply
Re: Questions for Articles Submission In reply to
You could possibly port the External Text Mod used in DBMAN, which is listed in the DBMAN Customization Forum and also in the Resource Center. This Mod will allow you to have the Description field go into a text file associated with the record that is being added. Then you use SSI calls to insert the text from the associated text file into your detailed pages.

For another example of using Links 2.0 for an articles engine, go to http://www.wheelweb.com/directory/.

Also, articles have been discussed in quite a few Threads in the Links 2.0 Customization Forum.

Regards,

Eliot Lee

Quote Reply
Re: Questions for Articles Submission In reply to
Nope, it doesn't work. The .txt files are not being formatted and the text is bunched together and unformatted (same font size etc.)

I am waiting upon JPDeni with a DBMan solution but she has gone missing - or taken a much deserved break

Quote Reply
Re: Questions for Articles Submission In reply to
Hi,
Is is possible to sort of combine the code from External Text Mod with Links 2.0 code to form a process whereby when people submit, it will go to a unvalidated records (each record will be written in a text file). Then when admin view an unvalidated records/modify, it will open up each relevant text file. And then, when the text file is validated/modified, then the links to the shtml page can be created by using links 2.0 "build" function and build the relevant index.html files of the categories? Is this possible? If yes, how is this done?

Indri

Send an E-card to your loved ones. Visit http://ecards.com.sg
--
Quote Reply
Re: Questions for Articles Submission In reply to
if you can figure out how to format the txt file and use the SSI method let me know how - I can't do it.

Quote Reply
Re: Questions for Articles Submission In reply to
Regular expressions should work. For example...
Code:
#!/usr/local/bin/perl
use CGI();
$in = new CGI;
open (FILE, "$in->param('ID').txt") or die $!;
$text = <FILE>;
close (FILE);
$text =~ s/\n/<.br>/g; #convert line breaks to <.br> tags
print "Content-Type: text/html\n\n";
print $text;
(obviously, remove the . in <.br>)

--Drew