Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Small mod but how to do?

Quote Reply
Small mod but how to do?
I would write some data to an external file;
say we choose via sql the last 5 new hits, but now i would write them over link2.html (a modified template) to an external file with the complete html in it.

Next step: I would <Include> this text to any place i would have it. BUT: I would like to choose the http://adress not the servers adress to get this file.

So from the end: 1. rewrite the include-function not to get via server-path but from anywhere in world the .txt file.
2. write a new function to get data via sql, pass them to link2.html and save the stuff to an .txt file somewhere under my www-dir.

Some ideas to that?


Quote Reply
Re: Small mod but how to do? In reply to
I'm not sure why you'd want the <%include%> file on another server. But, to do that you'd need to link in the LWP routines or study the nph-verify and verify-child scripts for how to get external links.

Unless you control that server, linking in external include files can be somewhat dangerous. Also, if you are generating those files on each build, how will you write to that server? Or are you trying to split this up across two servers? If so, I'm not even going to try to think about that at this time.

If you look at how I wrote the top-5 search terms, it takes the items, and stores them in a variable. You could write that variable out to a file, rather than storing it, simply by changing the final line of the subroutine. You can pass the data to any "template" you want to using the format of any of the site_html_nnn subroutines, or you could make a direct call to &load_template yourself. (You don't get access to the %GLOBALS if you do that.)

This could then be written out to a file.

None of this is hard, or has not been shown how to do it, except the fetch the file from a foreign URL. I'm sure that is only a few lines of code, but it's much more safe and easier to keep all your templates and include files in one place.



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Small mod but how to do? In reply to
Think of the following to understand my needs:
Say we have 5 people for writing articles; normally they send it via email and i build them inside my homepage.
When i could use extern files and an tag for every, i could open them somewhere else (and not on my mainserver, cause this one is so closed as i could do it).
Now i entered two times five new fields inside my cat-table and a tag inside my template; then i could set on/off for every cat, getting the file from the adress i save in the adress-field. Easy thing, isnt it.

Sometimes i think, i could do so much more with my links, if i would know some basic-things; but its hard to lern perl first, than understand maybe the ways links goes.

But heaven helps, i will try this this night again :-)
Robert



Quote Reply
Re: Small mod but how to do? In reply to
This presents a lot of problems... I would still upload them to your server, even you default them to a semi-public FTP directory, it would be better than trying to pull them off external servers. Something about this doesn't sit well with me from a security and maintennance point of view.

Actually, this would be a good integration project with Gossamer Mail, to allow by-mail submissions to the site, giving Links it's own mail box, and the ability to pull submitted articles from the mailbox.

I can actually see implementing someting like this... since most of the code is already (almost certainly) written into the Goassamer Mail program already, all that would need to be done is to modify some routines to create a process to get the mail from that ID. Sort of a mailing list "digest" sideways :)



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/