############################################################################## # Name: Hit Hack 1.07e for UBB 6.30 # # Count the click's for the thread # # von: Easy # # Date: 03-29-2001 # # History : 1.04 if the thread is deletet, the counter xxxxx.hit would # # be deletet too. # # 1.05 the cache page-forum is cleared if the counter increment# # 1.06 delete about the cp the file xxxxx.hit would be deleted # # too # # 1.07 doublecounting by reply # # # # if you see any error's mailto webmaster@sternenfahrervoncatan.de # ############################################################################## ################# # Start Hacking # ################# ######################### #ubb_get_topic.cgi open # ######################### ######### #find : # ######### # is the page available? ################### #BELOW that ADD:: # ################### $userlastaddr = &OpenFileAsString("$vars_config{NonCGIPath}/$exact_path/$_[1].wer"); if ($userlastaddr ne $ENV{'REMOTE_ADDR'}) { &WriteFileAsString("$vars_config{NonCGIPath}/$exact_path/$_[1].hit", &OpenFileAsString("$vars_config{NonCGIPath}/$exact_path/$_[1].hit") + 1); } else { &Unlink("$vars_config{NonCGIPath}/$exact_path/$_[1].wer"); } ##################### #ubb_forum.cgi open # ##################### ######### #find : # ######### &ServeFromCache("ubb_files/forum_page/$exact_path/forum$in{f}-$user_topic_view$extension.cgi"); ################### # Replace with: # ################### &WriteFileAsString("$vars_config{NonCGIPath}/$exact_path/0.hit", &OpenFileAsString("$vars_config{NonCGIPath}/$exact_path/0.hit") + 1); #&ServeFromCache("ubb_files/forum_page/$exact_path/forum$in{f}-$user_topic_view$extension.cgi"); my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/forum_page/$exact_path/forum$in{f}-$user_topic_view$extension.cgi"; if ( (-e $filename) && (-s $filename) && ($in{start_point} eq '') && ($vars_misc{use_cache} ne "no") ) { # print file $_ = &OpenFileAsString($filename); $_ = &ProcessVIEWS($_); print; exit(0); } else { &ServeFromCache("ubb_files/forum_page/$exact_path/forum$in{f}-$user_topic_view$extension.cgi"); } ######### #find : # ######### print &FilterPNTF($ThisHTML); ################### #ABOVE that ADD:: # ################### $ThisHTML = &ProcessVIEWS($ThisHTML); ########################### #ubb_topic_maint.cgi open # ########################### ######### #find : # ######### # delete topic file &Unlink("$vars_config{NonCGIPath}/$exact_path/$in{t}.cgi"); ################### #BELOW that ADD:: # ################### &Unlink("$vars_config{NonCGIPath}/$exact_path/$in{t}.hit"); #################### #cp_prune.cgi open # #################### ######################### #find : !prune by Date # ######################### # delete topic file &Unlink("$vars_config{NonCGIPath}/$exact_path/$_.cgi"); ################### #BELOW that ADD:: # ################### &Unlink("$vars_config{NonCGIPath}/$exact_path/$_.hit"); ############################## #search again !prune by user!# ############################## #if this is the first post, blow away the thread &Unlink("$vars_config{NonCGIPath}/$exact_path/$thread.cgi") or die "$! deleting $thread!"; ################### #BELOW that ADD:: # ################### &Unlink("$vars_config{NonCGIPath}/$exact_path/$thread.hit"); ######################### #ubb_new_reply.cgi open # ######################### ######## #find :# ######## # no problem, so proceed ################### #BELOW that ADD:: # ################### &WriteFileAsString("$vars_config{NonCGIPath}/$exact_path/$in{t}.wer", $ENV{'REMOTE_ADDR'}); #################################### #open file ubb_forum_summary.cgi # #################################### ######## # find # ######## &ServeFromCache("ubb_files/summary/summary.html"); ################### #Replace with # ################### #&ServeFromCache("ubb_files/summary/summary.html"); my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary.html"; if ((-e $filename) && (-s $filename) && ($vars_misc{use_cache} ne "no")) { my $file = &OpenFileAsString($filename); $file = &ProcessVIEWS($file); print &FilterPNTF($file); exit(0); } else { &ServeFromCache("ubb_files/summary/summary.html"); } #endif ######## # find # ######## &ServeFromCache("ubb_files/summary/summary-$in{category}.html"); ################### #Replace with # ################### #&ServeFromCache("ubb_files/summary/summary-$in{category}.html"); my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary-$in{category}.html"; if ((-e $filename) && (-s $filename) && ($vars_misc{use_cache} ne "no")) { my $file = &OpenFileAsString($filename); $file = &ProcessVIEWS($file); print &FilterPNTF($file); exit(0); } else { &ServeFromCache("ubb_files/summary/summary-$in{category}.html"); } #endif ######## # find # ######## print &FilterPNTF($ThisHTML); ################### #ABOVE that ADD:: # ################### $ThisHTML = &ProcessVIEWS($ThisHTML); ######################### # open file ubb_lib.cgi # ######################### ######## # find # ######## # do not remove: 1; ################### #ABOVE that ADD:: # ################### sub ProcessVIEWS { foreach my $line(split(/\r?\n/, $_[0])) { if ($line =~ /<\?PHP echo Hits\(\'([0-9]+)\'\, \'([0-9]+)?\'\) \?\>/) { my $f = $1; my $t = $2; my $v_counter; @this_forum = &GetForumRecord($f); $exact_path = "Forum$f"; if ($this_forum[6] =~ m/private/) { $exact_path .= "/private-$this_forum[7]"; } $v_counter = &FileExists("$vars_config{NonCGIPath}/$exact_path/$t.hit") ? &OpenFileAsVar("$vars_config{NonCGIPath}/$exact_path/$t.hit") : "0"; $_[0] =~ s/\<\?PHP echo Hits\(\'$f\'\, \'$t\'\) \?\>/$v_counter/; } } return $_[0] } ######## # find # ######## } elsif($func eq "Forum") { #################### # BELOW that ADD:: # #################### $colspans++; ########################### #open file ubb_search.cgi # ########################### ######## # find # ######## $ThisHTML = &OpenFileAsVar("$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/misc/ubb_daily_topics.cgi"); ################### #BELOW that ADD:: # ################### $ThisHTML = &ProcessVIEWS($ThisHTML); ######## # find # ######## # get bottom of page from public_common.pl $ThisHTML .= $Footer; print "$ThisHTML"; ################ # replace with # ################ # get bottom of page from public_common.pl $ThisHTML .= $Footer; # print "$ThisHTML"; ######## # find # ######## exit(0); } # end get_daily sr #################### # ABOVE that ADD:: # #################### $ThisHTML = &ProcessVIEWS($ThisHTML); print $ThisHTML; ############################## #vars_wordlets_mods.cgi open # ############################## ######### #find : # ######### %vars_wordlets_mods = ( ################### #BELOW that ADD:: # ################### 'count_on_click' => 'Hits', 'count_on_click_lowercase' => 'hits', ############################ #public_forum_page.pl open # ############################ ######### #find : # ######### $vars_wordlets{total_replies_header} ################### #BELOW that ADD:: # ###################