Gossamer Forum
Home : Products : Links 2.0 : Customization :

hits counting, counting, counting...

Quote Reply
hits counting, counting, counting...
at the end of each links in links.db i have this

|0|No|No|0|0|Yes

I was told the last yes is for receiving emails, so if everything else is either a NO or a 0,

how come the Hits folder in the Data folder still keeps on counting and adding files for each hit to any certain link????????

My Hits folder is overflowing with those hits files, what did i do wrong that they are still counting like the Rabbits?????

Or, what would i have to change to finally stop the counting????

Quote Reply
Re: [gossy] hits counting, counting, counting... In reply to
Did you know that after you do a rebuild from your admin section, the hits file in your data folder resets and empties itself, so did you rebuild the directory after carrying out the mods. Sorry if this is teaching you to suck eggs.
Quote Reply
Re: [stu2000] hits counting, counting, counting... In reply to
In Reply To:
Did you know that after you do a rebuild from your admin section, the hits file in your data folder resets and empties itself, so did you rebuild the directory after carrying out the mods. Sorry if this is teaching you to suck eggs.


thanks for that first answer to my research (i have been aspending time looking for answers in other posts, nothing in this direction ecxept my own postings and mod regarding this).

Now, you are right, that's how it used to be originally, but then i modified Links2 to stop jamming me limited webspace with all these backups and other stuff.

Now i no longer have any of the 3 folders "Hits, Cool" or "New" nor is Links2 building backup anymore. (i like it lean as you see). (The info on that mod you can review here http://www.gossamer-threads.com/...earch_string;#221191

I am sure it is a side effect of this mod what happens, but i have uncommented all counting as far as i know, so either there is something i have overlooked or something i simply do not know is happening and it seems no posts have been made with a similar problem.

P.S. i have a buse SE, i could not afford to leave the db longer then 24 hours without validating and rebuilding, so that certainly isn't the problem and again, it does no longer delete the hits files in the Hits folder in Admin because of my mod.

I really hope someone knows more on this.
Quote Reply
Re: [gossy] hits counting, counting, counting... In reply to
Have you looked in the jump.cgi? Remove the following to stop counting...

Code:
# Bump the counter one.
if (open (HIT, "<$db_hits_path/$id")) {
my ($count, $old_time, @IP, $ip, $visited);
chomp ($count = <HIT>);
chomp ($old_time = <HIT>);
chomp (@IP = <HIT>);
(($time - $old_time) > 21600) and (@IP = ());
foreach $ip (@IP) {
$ip eq $ENV{'REMOTE_ADDR'} and ($visited++ and last);
}
if (!$visited) {
push (@IP, $ENV{'REMOTE_ADDR'});
$count = $count + 1;
open (HIT, ">$db_hits_path/$id") or &error ("Can't open for output counter file. Reason: $!");
if ($db_use_flock) { flock (HIT, 2) or &error ("Can't get file lock. Reason: $!"); }
local $" = "\n";
print HIT "$count\n$time\n@IP";
close HIT;
}
}
else {
open (HIT, ">$db_hits_path/$id") or &error ("Can't increment counter file. Reason: $!");
print HIT "1\n$time\n$ENV{'REMOTE_ADDR'}";
close HIT;
}
}
else {
&error ("No link specified!");
}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] hits counting, counting, counting... In reply to
WinkCool Say no more, good advice is better advice!!!!

Thanks for that, i have uncommented that section in jump.pl already and run some tests and there seems so far to be no side effect and no more counting, got to observe the testing a bit longer over the next few days, but it seems that was the ACTUAL final missing piece in a complete "stop everything that uses to much disk space " mod.

Once all tests are certainly without any side effects i'll update my mod at

http://useroo.freeyellow.com/links2-mod.html

Thanks again
Quote Reply
one more question regarding mod In reply to
Now that i have tested your suggestion successfully (as it seems so far)

i wonder if maybe i could go back to use the jump.pl thing for the link.html template again as in

<a href="<%db_cgi_url%>/jump.pl?ID=<%ID%>" Target="New">

instead of just

<a href="<%URL%>" Target="New">

without this triggering again any counting of any hits?????

(I miss the linksID displayed in the browser to easier find links that need deletion or any sort of editing)
Quote Reply
Re: [gossy] one more question regarding mod In reply to
Yes, you should be able to go through jump, without any more problems.Wink


Leonard
aka PerlFlunkie
Quote Reply
Re: [gossy] one more question regarding mod In reply to
How about

<A HREF="<%URL%>" TARGET="New" class="mLink8" onmouseover="window.status=' Click here to Visit <%ID%> <%clean_title%>'; return true" onmouseout="window.status=' '; return true;"><%Title%></A>

Then you could just delete the unnecessary jump.cgi file from your server not to mention eliminating the overhead of calling another program...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] one more question regarding mod In reply to
Thanks, that looks like an elegant suggestion, will definitively test this out.
Quote Reply
Re: [esm] one more question regarding mod In reply to
In Reply To:
How about

<A HREF="<%URL%>" TARGET="New" class="mLink8" onmouseover="window.status=' Click here to Visit <%ID%> <%clean_title%>'; return true" onmouseout="window.status=' '; return true;"><%Title%></A>

Then you could just delete the unnecessary jump.cgi file from your server not to mention eliminating the overhead of calling another program...
Quote Reply
Re: [esm] one more question regarding mod In reply to
Great, my reply to your suggestion didn't show up once more, this forum really only works in IE.

Here once more the problem i encountered and the "one more" question that resulted out of it:

After i pasted your lines

<A HREF="<%URL%>" TARGET="New" class="mLink8" onmouseover="window.status=' Click here to Visit <%ID%> <%clean_title%>'; return true" onmouseout="window.status=' '; return true;"><%Title%></A>

into link.html and tested it i got a repeated ERROR message where the links would normally appear saying something like Unknown tag <%clean_title%>

I do not know what all the things in your suggested lines are for, so i'd like to ask if you know where the problem is?????
Quote Reply
Re: [gossy] one more question regarding mod In reply to
I can see what was trying to be done above, you obviously haven't got clean_title define anywhere, just change the clean tile to <%Title%>. Now this will show up in your status bar as something like:-

Click here to visit 88 My links

Where 88 is your ID number and My links is the title of one of your links.

The actual link itself will just be shown as the tile of your link and the link will lead to the URL entered not your jump script as links has set as default.

I hope this makes sense
Unsure

Stu2000

- Top 100 forums / GT Links 2.0 websites -

Last edited by:

stu2000: Nov 24, 2002, 12:12 PM
Quote Reply
Re: [gossy] one more question regarding mod In reply to
I took a quick look through the files, and saw no routine to build a 'clean title.' You may need to create one; modify an existing sub that looks up by the ID (in db_utils.pl or nph_build.pl), and change the output (qq=) to create an unlinked title. Name it 'sub build_clean_title.' It should probably go at the bottom of nph_build, just before the last line (1;). Good luck!


Leonard
aka PerlFlunkie
Quote Reply
Re: [gossy] one more question regarding mod In reply to
just a couple of things.

First, before I posted the msg I noted my use of clean_title and class=mlink8 but decided not to change them. While it was not a test, I was rather curious as to how you would respond.

Turns out the answer for clean_title is very simple: scroll down to the bottom of this page and enter the word clean_title in the seach box and click the search button. The other is almost as easy. Go to Google.com and search for CSS.

Sometimes you just have to do some stuff yourself.

A year ago I didn't know what CSS was...and while I will never be an expert, I can at least use it and understand it. Look at some recent posts by the PerlFlunkie and Stu2000. Both have said that knew nothing in the beginning...now look at them...providing help to others. And you should be well on your way to understanding Links 2, if not now, then shortly.

For example, go back and look at your opening question in this thread. You ask what is |0|No|No|0|0|Yes

IMHO, you should have figured that out by now. You asked about it before and it has been explained. If you don't understand it, you may want to take a computer course.

I don't want that come across as mean. Folks are very helpful on this forum...that is it's purpose. But you have a responsibility to learn as much as you can. It's OK to be a "taker" when you first start here...and while you may never be a "giver" or be able to do what Stealth, Andy, Paul, Sponge and Fuzzy do, you should be able to figure out some of the simple stuff like Title or clean_title or what |0|No|No|0|0|Yes
means.

I will be the first to admit that I don't know much...and probably should know more.

BTW, if you have an apostrophe in the Title ( such as: Alice's HomePage ), you will get a javascript error...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] one more question regarding mod In reply to
Must admit, I did not do a search for an answer. Sometimes what first comes to mind is NOT the easiest way to do things (like my post above...).

Ya want punctuation, use the nonenglish mod. It only has a few minor quirks, but overall it works pretty good.


Leonard
aka PerlFlunkie
Quote Reply
Re: [stu2000] one more question regarding mod In reply to
Nope, as the other experts say, just changing "clean_title" to "title" of course returns the same, "unknown tag title".

Either i would need some style sheet (but in which dir would i dump that file, in the main dir or any of the cgi dirs????


That much to Stu2000 suggestion.

To PerlFlunkie's suggestion:

Sometimes one is lucky and comes into this forum with a question and gets a totally accurate easy to understand and imply answer like the first one you provided i surely appreciated, and other times you come in here and... well you know equally much than you knew before (not to blame anyone for that).

In case of your suggestion " modify an existing sub"

You know, for a perl flunkie that's easy, for a non scripter who knows only how to uncomment when someone tips my nose right into it, that's just like the doctor who asks a driving by rocker to perform this heart surgery, it might work, it might not, the patient could die....

In short, i better don't try this and go for the easy try with the old jump id tag or leave it at the simple url tag.

To esm:

No, i am far from understanding Links2, honestly.

I have done what i could and posted my mod in case anyone would ever want to do the same, but what portion of the script tells which other script to tell the other script to tell that template.......

no, i don't know and i'll probably never get to because i feel i better don't go to deep into cgi stuff as i am the artist who is into the design of web sites, the looks not the behind the scene works

(see what i mean here http://useroo.businessresearchsources.com/

Visual work and cgi are to different things to easily combine colors or just plain symbols in black on white are different things too, i understand colors http://www.artists-in-residence.com/~useroo/

So, when it comes to cgi the only way to learn is to ASK!

As you see on the above link css is not totally foreign to me, i just haven't used it much because it isn't working in NS4.7 but now with NS7 that is different of course.

How to combine css with cgi... no idea yet.

At first i simply thought PerlFlunkies suggestion would simply be a onmouse over effect that would normally display the URL but when you move the cursor over it the link ID. Since he didn't mention the css i did not assume it's needed, if i would post i would mention such or any possible side effects, just like i did in my mod.

Last edited by:

gossy: Nov 24, 2002, 10:13 PM
Quote Reply
Re: [PerlFlunkie] one more question regarding mod In reply to
fortunately for me, Stealth has repeated it often enough in msgs that even I can remember to do that. The one thing that I have found is that while searching, I read msgs that helps me with other problems/solutions. Steadlth has helped me even when he didn't know it...!

and yes, I should install the non-english mod...what can I say; I just need one of those ROUND TUITs...! Tell me more about the quirks, though.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] one more question regarding mod In reply to
...lost in the forums...

Yes, I find that, when I browse around trying to find an answer to whatever I'm working on, I find SEVERAL more things I want to check out/add on, to! So, I print some, copy some, and add some to faves.

Nonenglish quirks:
  • Will not properly display a linked title (breadcrumb navigation) on lower (subcat) pages; it only shows current category. I have a fix for that, but was waiting to post it until I solve the next quirk:
  • Does not properly display in title bar (You know, at the very top of your browser.) Acts the same as above item.
  • Does not properly display in drop-downs on add or modify pages. It lists everything, but not together, so 'cat/subcat/subcat2' is just 'cat' then 'subcat' then 'subcat2', on new lines.


Other than that (I think), it's a great mod. I like using '&,' and real punctuation. Just noticed a(nother) quirk in these forums: that bulleted list is not displaying correctly, it jammed my paragraphs together!


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] one more question regarding mod In reply to
the tilte tag is case sensitive it should be <%Title%>. I hope this helps. If not I will post a new sub routine to define the tag, or as suggest above do a search a in fourms for title clean

Last edited by:

stu2000: Nov 25, 2002, 12:08 PM
Quote Reply
Re: [gossy] one more question regarding mod In reply to
first lesson:

perform a seach of this forum. Most of the answers are already here. Just look at the answers to posts: most refer the questioner to another msg in the forum or to a Resource.

second lesson:

Perl is case sensitive. Title, title, TiTlE, TITLE and tiTle are all different variables. Look first at links.def for the correct spelling. Otherwise, look at the MOD instructions for any variables.

Once again not to be mean, but if you don't now understand or know how to figure out how to use title in the javascript example, you probably won't understand the hard stuff. In complexity the title thing is about a zero on a scale of 10. ( not to worry, I'm trying to understand the stuff that gets to a level 5 ).

Just as an observation, if you don't learn the cgi/html side, you will probably be frustrated with getting answers to you questions. Nothing wrong with being on the "art" side. but if you want to do it yourself, you will need to advance your understaning of the LINKS coding and how computer programs work.

you may never be a doctor but you need to learn some nursing skills to avoid bleeding to death...


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] one more question regarding mod In reply to
SmileCool (2 big mafia smiles.

Life is easy if you know how - or if somebody rubs your nose in it.

No stylesheet required, just the change from "title" to "Title" and it works as hoped for.

Thanks Gene, (have i earned the Dr. title now - guess not before x-mas...?)
Quote Reply
Re: [gossy] one more question regarding mod In reply to
LOL

well, you certainly have a good sense of humor. that may be half the battle. and you are looking in the wrong place if you want blessing from me - better to get them from someone who knows what's going on.....I still have trouble finding the bathroom and that's bad cause as you get to be my age, the plumbing don't work like it used to...

Now, on to more Links 2 coding!


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."