Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Problems with subscribe.cgi

Quote Reply
Problems with subscribe.cgi
Hi.

There seems to be something rather wrong with my subscribe.cgi. Until a few minutes ago it would overwrite the list.db with every subscribtion (i.e. the list would always consist of exactly one line), but I fixed that by replacing (in sub subscribe)
open (LIST, ">$list")
with
open (LIST, ">>$list")
So now subscribers actually get entered and stay there.

But still, problems remain. people can't unsubscribe because their address is not in the list, or so the system says. But a look into email.db shows me that they are.

I have not previously changed anything in this file. Any ideas what is wrong here?

Oh, and another question, I want to add a variable to the globals array that is passed to the templates. How would I go about that? I have to read in a file and insert it into each page (how I do that does not matter, but globals strikes me as the most practical way).

Thank you,

_ Lasar

Quote Reply
Re: Problems with subscribe.cgi In reply to
the first part I have no clue but hopefully I can answer your second question.

in site_html_templates.pl at the top :::

%globals = (
date => &get_date,

add a variable into the list, if it's in the last position don't forget to close the line above off with a comma " , " and leave the last variable without an ending comma.

then for example in

sub site_html_home {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.

return &load_template ('home.html', {
category => $category,

add the variable to the list, once again becareful with the final commas

last but least don't foeget to out the variable into the template ;-)

good luck

**************************************
on the pages in between ...
Quote Reply
Re: Problems with subscribe.cgi In reply to
There's no list.db file, only email.db.

Thomas
http://links.japanref.com
Quote Reply
Re: Problems with subscribe.cgi In reply to
Its a globals hash not array but anyway.....

To add a new tag just add something like this to the globals hash:

$new_tag => &new_tag,

Then add this new sub just outside the hash...

Code:
sub new_tag {
my $time = scalar localtime;
return $time;
}
Then put <%new_tag%> in add.cgi and view it in your browser. Where ever you put the tag you should see the date and time.



Mods:http://wiredon.net/gt/download.shtml
Installs:http://wiredon.net/gt/


Quote Reply
Re: Problems with subscribe.cgi In reply to
Thanks for help with the global hash (I'm no Perl pro, I never really understood the differences between the different list types), that works fine now.

I haven't yet looked at the subscribe.cgi problem any more, I guess I will just stare at the code until it works or until I manage to rewrite it until it works (which will of course lead to more problems).

Now I'm having problems with the noneglish and yahoo mod. This doesn't seem to be uncommon. It basically works, but subcategories are still displayed with the english name.
To solve this the easy way, how would I go about fetching a field from the cat database
that corresponds to a category? I must say that I have never really understood the data structure used.

Thanks again,

_ Lasar

Quote Reply
Re: Problems with subscribe.cgi In reply to
yewwwww ..... using the language mod ... sticky stuff there. I first attempted to go with that mod but ended scraping it thinking I'd work on it later after everything else was working properly.

How about this -- use images for your category names? Then no matter what the browser what's to do with the page (as per view language setting) your guest will be able to see the category name listing.

????

I donna know it's just an idea.

Good Luck.

**************************************
on the pages in between ...