Gossamer Forum
Home : Products : DBMan : Customization :

link to newest records MOD

Quote Reply
link to newest records MOD
I've got

print qq!| <A HREF="$db_script_link_url&new_records=1&db_key=*">Newest Additions</A> ! if ($per_view);

giving me the output of the latest 10 records, as designed. The prob is that I can't link to those active links and "view" said record.

I've tried ...&new&view_records, Date-gt=$new&view_records ... included the sb=1 (my date field) ... all to no avail.

This has got to be an easy one. Any clues?
Quote Reply
Re: link to newest records MOD In reply to
The problem is that you are missing view_records=1 in the query string.

It should look like the following:

Code:
print qq! <a href="$db_script_link_url&Date-gt=$new&view_records=1&$db_key=*">View New Records</a> (if $per_view)!;

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited October 16, 1999).]

[This message has been edited by Eliot (edited October 16, 1999).]
Quote Reply
Re: link to newest records MOD In reply to
Eliot,

I took yr cut|copy|paste to:

print qq!| <A HREF="$db_script_link_url&Date-gt=$new&view_records=1&$db_key=*">Newest Additions</a> ! if ($per_view);

...but now I get all 88 records in my database -v- only the last ten, :-0.

I double checked the MOD, db.pl and html.pl files and ever'thin appears correct ...

Do I need to further append an mh=10 and/or sb=1?

JR


Quote Reply
Re: link to newest records MOD In reply to
html_pl.txt & db_pl.txt have been posted to http://www.flash.net/~murgnam/
Quote Reply
Re: link to newest records MOD In reply to
What mod are you using? The code you posted is not the complete mod, so I'm not sure what you're doing.


------------------
JPD





Quote Reply
Re: link to newest records MOD In reply to
...the whole story.

1. I originally was using the What's New MOD, but found that I kept getting 31-Dec-1969 in my Log file. I posted a comment @ http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/001240.html, where the response got my got my Log File working again, but found that my What's New was no longer working, e.g., the What's New MOD was causing me the 1969 probs.

2. I went back to the What's New MOD, found the part about some folks having the 1969 prob, incorporated the

# Replace

$days = 31; # set this one day more than you want records to be considered "new."
# If you want to include records from the previous 7 days, set the number
# to 8.

$new = &get_date(time() - ($days * 86400));

# with

$days = 31; # set this one day more than you want records to be considered "new."
# If you want to include records from the previous 7 days, set the number
# to 8.

$time = time() - ($days * 86400);

my ($sec, $min, $hour, $day, $mon, $year, $dweek, $dyear, $daylight) = localtime($time);
my (@months) = qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
($day < 10) and ($day = "0$day");
$year = $year + 1900;

$new = "$day-$months[$mon]-$year";

... but that didn't work either.

3. I then tried the Newest Records MOD, which with

print qq!| <A HREF="$db_script_link_url&new_records=1&db_key=*">Newest Additions</A> ! if ($per_view);

gave me the last 10 records I was looking for and log was working right, but the output wouldn't let me "view" the record(s) of the active link, e.g., this post.

I can only guess that I screwed up the Date-gt somewhere, as the ...&new_records=1... works (sorta), but the ... Date-gt=$new&view_records=1...does not.

JR

Quote Reply
Re: link to newest records MOD In reply to
Can I see the file where you have the code? I'll need to see each of the files that have a part in it, but I'm still not sure which files they are.

Copy the files to a web-accessible directory -- one where you would place html files -- and rename them to have a .txt extension.



------------------
JPD





Quote Reply
Re: link to newest records MOD In reply to
I guess your problem is because I forgot to add an important bit to the mod. Sorry 'bout that.

Change the link for your "Newest Additions" to

Code:
<A HREF="$db_script_link_url&new_records=1">

That should be all you need to do. The code in sub html_new_records has the information for the search.

You did say

Code:
# Change the number below to the *number* of your counter field or date field
$in{'sb'} = 0;

You probably should change that to

Code:
$in{'sb') = 1;

Also be sure that your date field is set to be field type date, or it won't sort correctly.

Now I'll go add the code to the mod.

------------------
JPD





Quote Reply
Re: link to newest records MOD In reply to
JPD,

That's where I started with this post. If you'd indulge, go to http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.pl, sign in with guest/guest, click the newest additions and you'll see the output I'm looking for, :-)

... but then try to click one of those apparent active links ... you don't get the person's record, just the same page (&new_records=1). I should be able to get to a newest addition's record ... right?, e.g., the talk about &new&view_records.

JR
Quote Reply
Re: link to newest records MOD In reply to
JPD,

That's where I started with this post. If you'd indulge, go to http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.pl, sign in with guest/guest, click the newest additions and you'll see the output I'm looking for, :-)

... but then try to click one of those apparent active links ... you don't get the person's record, just the same page (&new_records=1). I should be able to get to a newest addition's record ... right?, e.g., the talk about &new&view_records.

JR
Quote Reply
Re: link to newest records MOD In reply to
I had read that at the beginning, but I didn't understand what you meant. Basically, I didn't understand that you were using the "short/long" display mod.

You'll need to use the "What's New" mod instead of the "Newest Records" mod so that the search terms will be sent with the link.

I think the problem may stem from the answer you got concerning the log dates being 1969. Is there a way you can figure out what you did with that fix and go back to that? Didn't you say something about that the "What's New" was working until you did the other fix?



------------------
JPD





Quote Reply
Re: link to newest records MOD In reply to
JPD,

I used the What's New and yes it "appeared" to work, 'til I happened to notice the 1969 dates in the log. The fix to the 1969 got my log right, but conversely, I lost the What's New output.

I then, found the Newest Additions mod gave me the output I wanted + my log file was now correct. Was only looking in this thread to be able to link from the newest addition output to the actual record.

What a mess I've caused I think.

In the short term I think I'm gonna leave the newest addition and just have to deal with the output part ... I/we have spent enuff keystrokes/brain cells on this thread

... another item added to my "list of things to do" *sigh* *grin*

Thx 4 the help, :-)

JR
Quote Reply
Re: link to newest records MOD In reply to
The thing is that there's another (simpler) way of going about the fix for the date problem in the log that won't mess up your "What's New." Fixing it now will be easier than fixing it later.

Using the "Newest Records" mod, you will never be able to use the short/long display. The two just cannot work together.

Whatever you want to do, though, is okay.


------------------
JPD





Quote Reply
Re: link to newest records MOD In reply to
Agreed. Perhaps my eyes and nerves are just too bloodshot to continue anymore today. Whomever said Sunday was a day of rest musta been kidding, ugh -- no more DBMan today!
Time for dinner, motrin, and the pillow I think.
Out here
JR