Modification Name: Hit Hack
Author(s): Brett
Description: Shows hits in forum summary/page
Demo: http://www.pavioni.com/ubb/ultimatebb.php Requirements: UBB 6.7, Mod Wordlets
Download Link: https://www.ubbdev.com/ubb/upload/00006378/HitHack6.7.zip Credits: LK, e@sy, qasic, cal
IF THE NUMBERS ARE NOT SHOWING UP, PLEASE VERIFY THAT UBB_HITS.CGI IS CHMODed TO 755 - Ian
thank you
I ported it for use on my personal site, but it'll be good to check my results against yours
pretty much all I edited was a use vars(%hits) in ultimatebb and it all worked
there were a couple parts where the find parts were not there, it wasn't
that simple.
"pretty much"
Ok, havin a little trouble finding the parts in cp_prune.cgi,
did you look at Allen's 6.6 version? he posted it in the 6.4 thread
Hi Brett,
I tested your hit-hack at your test-board and it seems to be that your hack does not work correctly, if I click the same thread 2,3 or 4 times it counts only 1 hit...
A cache problem?
Allens one works fine with cache and ultimatebb.php
It's my understanding that it should only see one hit as it's one person viewing the thread... Uniqueness and all...
No, I don't think I built any uniqueness system into Hit Hack...
buglet:
*********************
* Open cp2_content.cgi *
*********************
Find: (~275)
=====
# delete topic file
&Unlink("$vars_config{NonCGIPath}/$exact_path/$_.cgi");
needs to be changed to:
*********************
* Open cp2_content.cgi *
*********************
Find: (~1093)
=====
# delete topic file
&Unlink("$vars_config{NonCGIPath}/$exact_path/$topic.cgi");
tho this may only affect 6.7.1
Allen, does the MHP include your little buglet for 6.7.1? If so you may need to update if the error was just in 6.7...
I haven't checked 6.7 recently, the mhp uploaded was tested against the 6.7.1 you see installed there
Anyone know if hit hack will ever support Opera? Not working in the newest ver of opera
It should work perfectly. Go to my forums, you don't see the hits?
This is BASIC js, it's more of an Opera supporting the hit hack
No Ian, I dont see the hits, lol. Open up Opera browser if you have it installed. Im tellin ya, it doesnt show hits
would you look again? (you might have to refresh)
now it works, what'd u do differntly?
changed that appendchild(createTextNode()) thing to innerHTML =
Ok, I'll look into the code later, (leaving for the seinfeld show now) what file is that stored in off hand? Thanks,
so something like ...
document.getElementById('hit$_').innerHTML="$hits{$_}";n~;
?
yeah, do that for all the lines that had "createTextNode" in them
Ian is that a "bug fix" or a one off ?
Should we all do it i guess is the question
It would make it support the big 4 (Mozilla, IE, Opera, Netscape), however, since it's not my mod, it's up to Brett if he wants to add it
Hmmm, I have 3 lines of total code in ubb_hits.cgi
I've changed all 3 to what you said. For example:
document.getElementById('hitf$forums[$_]').innerHTML="$hits{forum} $vars_wordlets_mods{count_on_click_lowercase}";
document.getElementById('hitt$forums[$_]').innerHTML="$hits{$topics[$_]} $vars_wordlets_mods{count_on_click_lowercase}";n~;
ANDdocument.getElementById('hit$_').innerHTML="$hits{$_}";n~;
Still cant show up in Opera. Is that correct syntax? I'll keep workin on this one
Try this also, forgot the other change I made.
In ubb_hits.cgi
FIND:
if (is_ie5up || is_gecko
ADD AFTER:
|| agt.indexOf("opera")
Works Perfect
Thanks for the hack Ian
Originally posted by havoq:
Works Perfect
Thanks for the hack Ian
haha, thank Brett for the hack, thank me for 2 lines of code, one of which Brett taught me
lol, well then, props to Brett as well! Thanks buddy
I could probably figure this out for myself, but I would like to change the displayed wording of "Hits" to "Views".
Thanks for any help.
change
q!count_on_click! => q!Hits!,
q!count_on_click_lowercase! => q!hits!,
to
q!count_on_click! => q!Views!,
q!count_on_click_lowercase! => q!views!,
Originally posted by Ian Spence:
change
q!count_on_click! => q!Hits!,
q!count_on_click_lowercase! => q!hits!,
to
q!count_on_click! => q!Views!,
q!count_on_click_lowercase! => q!views!,
Thanks Ian, you totally ROCK!
Brett, anyway to get this to update with mass move?
I just combined 2 of my forums, and all the moved posts had their counters reset
Originally posted by Brett:
Requirements: UBB 6.7, Mod Wordlets
I'm having trouble finding "Mod Wordlets" up here... is this a 6.4-6.7 Mod?
Interesting error. Example... A thread listed in the last post column under a category and in a forum will display 6 hits from the main board.
When I click on the category to view all forums in that category, it will say that thread that was in the last post column has 66 hits.
When I go to view that post in that forum, and then click back to the category, it will say that the thread has 77 hits. When I go back out to the all category listing, it shows that the last post has 7 hits.
Help please?
-Thanks again
appears to be working for me
Ian, I apologize, but that link in the sig is still for the test board, not production. I will PM you the link to that board. This applies to the same board but it got moved and cats and forums added.
sure, and gimme ftp access to that one so I can fix it then act like it was always working
This is not a bug with this hack. Somehow I managed to upload a test ubb_hits.cgi file that had both innerHTML and appendChild, making everything appear twice
Has this been updated with the fixes listed in the thread here?
Hmm, it appears as if that hit hack is not working for my under the last post section. All of the posts in Last Posts show 0 hits. When I click it and go back, nothing registers... Any ideas? As always, thanks in advance...
don't click back, go back to the main page. it works for me
OK.. I take that back. Some are working and some are not. I'm not sure what the common denominator might be. Check some of the posts lower in the forums. An example would be under traveling, and packing tips.
I'm pretty sure it's cause you don't have at least one post in each forum
I think it's very strange. Check out the polls section, there is only one forum in that category, it has posts in it, and it doesn't show hits.?
Other categories don't have post in every forum and some forums are counting and others are not. I just posted a new topic in a forum that had no posts in it and it isn't counting hits but other existing forums with posts in them are? I don't get it...
I'm pretty sure it's cause you don't have at least one post in each forum
make a post in every forum
I installed the hithack version, and it doesnt show on my board
http://www.huntandlodge.com/cgi-bin/ultimatebb.cgi We dont show howmany hits are on each topic( I havent enabled that).
do I need to enable that in oder to see the page? I really dont want to if I dont have to.
Thanks
Delw
Oh my bad I got this hack confused with the statistic hack, Sorry
Delw
I added this hack, but on the hits column instead of the cell where it should say "Hits" there's just an empty cell ,other numbers shows fine, any advices?
you have the Wordlets Mod installed?
Hello,
I've got this error:
http://www.med-forum.board-world.de/test.jpg Can someone please help me?
Thanks
d-talk
Edit by Ian Spence:
Changed [img] to [url] to prevent stretching of page
I can't tell what's wrong, it's all in french or something...
I would guess he gets a similar problem to mine only for him it doesn't even show numbers and for me it does
Anyway I had the Wortlets Mods installed but I removed this hack, it slows my board too much
Great hack tho
Loooks more german than french; but i'm a little rusty
Yes, it don't shows the numbers.... Mods wordlets is installed...
Originally posted by Gizzy:
Loooks more german than french; but i'm a little rusty
I second that, shame on you allen
edit: and I would say the problems comes from hit.cgi
I installed this hack on a 6.7 board. It works when i click directly to a post but when i click on the category heading i get this
(RequireCodeNoINC) NonCGIPath/Templates/public_forum_page.pl: syntax error at NonCGIPath/Templates/public_forum_page.pl line 476, near "my $last_post_link = ($vars_display{LastPostColOpt} =~ m/LINK|NOTIME/"
Compilation failed in require at CGIPath/ubb_lib.cgi line 928.
Am i missing something?
rehack public_forum_page.pl
Thanks!
Will this hack work with 6.7.2?
I installed this hack on a 6.7.2 board. I haven't received any errors. I do see the "Hits" column on a topic page, but no hits are listed.
Please verify that ubb_hits.cgi has been CHMODed to 755.
If it already is, can I have a link to the forum, and info for an account if it's member's only?
My bad, forgot to set permissions to that file.
Just installed this on 6.7.0. My ultimatebb.php file had different lines but Ian helped me out.
Site seems to be the same speed so far under 5 users but we'll see tomorrow.
Also - I have no word "hits" displayed at the top but the numbers are shown. I do have var_worlets_mods.cgi uploaded. I also see the word "hits" in my admin panel and have the option to change the wording but that had no effect. Im guessing some other file was not correctly edited?
You might double-check the spelling of the code that calls the word in your template, or just edit it to say "hits"
Originally posted by AllenAyres:
You might double-check the spelling of the code that calls the word in your template, or just edit it to say "hits"
I changed the word "hits" to "views" in the control panel/worlets but still its blank. The worlets_mod file was updated with the new info but still theres no change. Its not a big deal though because the hits count is there its just that the column has no name to it.
Stupid question, did you install the wordlets mod or did you just upload the wordlets file?
Originally posted by Gizzy:
Stupid question, did you install the wordlets mod or did you just upload the wordlets file?
Edit - Um ooops, thats what was missing.
The Worlets Mod should be updated thouigh. It says in the txt file 'FILES MODIFIED: cp.cgi, ultimatebb.cgi'.
But theres also vars_wordlets_cp2.cgi as per the instructions
Thanks, it works now by redoing the worlets_mods in the CP
Yeh, sometimes even the most small of issues can render something useless
Originally posted by Nycore:
Originally posted by AllenAyres:
[qb]
You might double-check the spelling of the code that calls the word in your template, or just edit it to say "hits"
[/qb]
I changed the word "hits" to "views" in the control panel/worlets but still its blank. The worlets_mod file was updated with the new info but still theres no change. Its not a big deal though because the hits count is there its just that the column has no name to it.
I meant in the template file itself, but glad you have it working now
Actually I just had errors today. Polls arent working. I got tons of lines about files relating to poles in the error message. I replaced the 3 files from the worlets_mods that I installed and it solved the problem but it removed the "hits" word. lol.
I know I goofed somewhere but figure Id post in the vent that someone lese had issues. I have to go through the install again and see where I sent wrong.
As it stands now my "hits" are working and the site is running normal I just have no word "hits".
edit your template file where the word should appear to just say "hits" instead of $vars_wordlets_mods{hits} or whatever it says
After a rent server upgrade my ubb with hit hack installed, has been displaying an error message. When i rebuild meta data i see the following.
Insecure dependency in unlink while running setuid at /System/Library/Perl/File/Path.pm line 220.
and this in the debug info
StandardHTML stack trace:
at /Applications/4DWebSTAR/WebServer/forums/Templates//cp2_common.pl line 96
main::StandardHTML called at /Applications/4DWebSTAR/WebServer/forums/Templates//cp2_common.pl line 131
main::StandardHTML2() called at Modules/UBBCGI/Carp.pm line 150
UBBCGI::Carp::fatalsToBrowser() called at Modules/UBBCGI/Carp.pm line 86
UBBCGI::Carp::die() called at /System/Library/Perl/File/Path.pm line 220
File::Path::rmtree() called at /System/Library/Perl/File/Path.pm line 186
File::Path::rmtree() called at /Applications/4DWebSTAR/WebServer/cgi-bin/ubb_lib.cgi line 1623
main::ClearSingleForumPageCache() called at /Applications/4DWebSTAR/WebServer/cgi-bin/cp2_maint.cgi line 744
main::refreshwrapper_forumstats() called at /Applications/4DWebSTAR/WebServer/cgi-bin/cp2_maint.cgi line 279
main::refreshing called at cp.cgi line 526
any ideas of what might have happened.
Could i uninstall the hit hack? if so, how?
do the exact opposite of how you installed it. where it told you to add something, remove it, etc
I reinstalled the hack and all the old hits are still visible in the ubb, however any new hits are not accounted for.
Any suggestions?
You can view the old ones but you aren't writing any new ones, something in your install is off. You might try the multihack version, works for me
hmmmm. i've checked the install. The hits are counting inside on the topic pages, just not on the forum summary page.
http://www.closingthegap.org/cgi-bin/ultimatebb.cgi
Where is the multihack version? If my problem cannot be solved, i'll take a look at multihack.
I rehacked the files again and it seems to be working. I'll take it as a small victory.
Thanks.
Hello,
So if you want try:
http://medforum.meduni.com Theres another one?
Thanks
com
You don't need it, it's on the "files modified" list but it's not really modified.
The Hit hack doesn't seem to work in Opera browsers, can anyone confirm that ?
fixes are posted earlier in this thread, believe page #2 or #3
I'mnot ready to give up on this yet, can anyone help me out on how to fix this?
There could be a million possibilities of why won't it increase, re-do the hack from the beginning. Also check the permissions (CHMOD) of /ubb/ForumX/hits.cgi file, it should be set to 777.
Its increasing fine, look at the collums
Oh.. re-do public_forum_page.pl, you didn't add the part which adds a column to the topics list correctly.
I got it fixed, but which page can I not edit so this doesn't show up on the board summary?
I only wanted the views on the inside of the forums themselves.
public_forum_summary.pl
Just undo everything you did there
Hit Hack and I have emotional issues.. I know I forgot something again, the Views isn't showing up above the numbers and I know I chmod'd everything on purpose to try to fix it.
that would mean either you haven't installed the mod wordlets modification, or you haven't modfied public_forum_page.pl correctly. If your users use english only on your forum, you can just put the actual word in that template and skip installed mod_wordlets. mod_wordlets are written into our modifications for our international members, but can always be written directly in whatever language you choose.
I could try the forum page again.. I'll glance over the wordlets again as well.. I'll figure it out.. *collapses*
i've done all the directions to get this to work and its not working
http://www.writerzblock.net/cgi-bin/ultimatebb.cgi Am i missing something??
You don't have a "vars_wordlets_mods.cgi" file under /cgi-bin.
Create a file called vars_wordlets_mods.cgi. Its content:
%vars_wordlets_mods = (
q!count_on_click! => q!Hits!,
q!count_on_click_lowercase! => q!hits!,
);
1;
Upload it to /cgi-bin.
Now go to public_forum_page.pl.
Find:
<b>$vars_wordlets_mods{count_on_click}</b></font>
Replace with:
I did it and now see the hit col.
I dont see any numbers
did I do something wrong again
Seems like somebody edited your ubb_hits.cgi to add Opera support for some reason (although it should already support Opera).
Please re-upload a fresh ubb_hits.cgi file from the first message.
on the post reply
i dont see the date
Is there a way i can add it in??
the date? Is your question related to the "hit hack"?
Originally posted by AllenAyres:
the date? Is your question related to the "hit hack"?
yes
I installed the hit hack
And I see the hits, but do not see the date of the post
Do you have a link to/example of the issue?
http://www.writerzblock.net/cgi-bin/ultimatebb.cgi main page as you see only has the hit number
no date of the posts, and time
Redo public_forum_summary.pl.
i got it to work
thanks very much
Ok this is my 2nd hack I'm trying to install (just found this site yesterday). I installed the "hidden users" hack successfully however, I did not have luck with this one.
I'm on 6.7.3 release.
Here's what I did:
1) Installed Mod Wordlets
https://www.ubbdev.com/ubb/ultimatebb.php/topic/33/71.html#000000 2) Downloaded the files in the first post here and followed all directions in the hits.txt file. I added the ubb_hits.cgi (set permissions correctly) and modified all the files per instructions.
3) Cleared Cache
Looks like ..ForumX/hits.cgi files are being updated.
FORUM:
http://www.christianityforums.com Help!
Paul
Just went back over the entire instructions in the hits.txt file from the first post on this thread checking the files ON the server itself and everything checked out.
Paul
Verify you did the following step
*****************************
* Open public_forum_page.pl *
*****************************
Find: (~205)
=====
my $page_bottom = qq~
Add below:
==========
<script type="text/javascript" src="$vars_config{CGIURL}/ubb_hits.cgi?forum=$in{f};topics=$topicnums"></script>
Ian,
Thanks for the reponse. I did verify the above. It appears to be correct.
Paul
I went over this again and everything seems to check out. I'm willing to give one of the mods temporary ftp access if needed.
Thanks,
Paul
Any chance that someone can help me out here. I'm willing to pay for service.
I'll do it for free but I can't do it till the weekend. Email ispence {AT} gmail {D0T} com with the information for ftp. (You could also just send a Private message with the info here) I'll be able to do everything with that info.