PDA

View Full Version : Hacking "Test"


amykhar
04-30-2003, 02:38 PM
I have a thread in the hacking tips forum about modifying existing hacks. So, just for fun, I thought I would "test" your ability to modify a hack.

Grog6 released a hack to show the forum stats at the bottom of every forum. (Thread name says top, but it's really at the bottom unliess you modify it)

https://vborg.vbsupport.ru/showthread.php?s=&threadid=52215


This hack shows the person who started the most threads in the forum. My test for you is for you to modify the hack so that it shows the TOP 3 thread starters in every forum.

Don't post your code if you get it done. Just a screenshot of it working. No cheating and hardcoding templates! :D

I picked this hack because in some ways it's an easy mod, but in other ways it's a bit trickier because the variable names are French and not as meaningful for the majority of the coders here.

Here's a shot of what I am looking for. Bonus points for you making yours look better.

Remember, no code! just screenshots!

Amy

flup
04-30-2003, 02:40 PM
can i also PM you?
I think i know it already though... :)

amykhar
04-30-2003, 02:41 PM
I'd rather you didn't. I don't want to proofread code :D In this case, a picture is worth 1,000 lines of code (or about 10 tops in this case ;)

Amy

flup
04-30-2003, 02:42 PM
well, i won't do it,...i think i'll get parse errors, lol ;)

sabret00the
04-30-2003, 05:12 PM
yes this would actually be quite great, i can't imagine it be that hard, but i know f-all about hacking so there you go :lol:

flup
04-30-2003, 05:39 PM
;p

Dean C
04-30-2003, 06:11 PM
What a great idea ;)

- miSt

Xenon
04-30-2003, 07:46 PM
I really like your ideas Amy :)

amykhar
04-30-2003, 08:07 PM
Today at 04:46 PM Xenon said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=389575#post389575)
I really like your ideas Amy :)


Cool :D Can't wait to see your entry then ;)

Amy

grog6
04-30-2003, 09:01 PM
Today at 04:38 PM amykhar said this in Post #1 (https://vborg.vbsupport.ru/showthread.php?postid=389405#post389405)

Grog6 released a hack to show the forum stats at the bottom of every forum. (Thread name says top, but it's really at the bottom unliess you modify it)

https://vborg.vbsupport.ru/showthread.php?s=&threadid=52215


It's now shown at the top, just invert a "above" with a "under" ;) in my translation
It's now corrected


Can I participate to this Hacking "test" ?

amykhar
04-30-2003, 10:10 PM
Of course you may Bastien :)

Amy

grog6
04-30-2003, 10:13 PM
Hehe, thx, quite tired, but will try to it now :)

Dark_Wizard
05-01-2003, 12:30 AM
Today at 11:41 AM amykhar said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=389407#post389407)
(or about 10 tops in this case ;)

Amy

Actually simpler than that but I won't say anything...
Cool idea...helps with the wait for vb3.0 :rolleyes:

grog6
05-01-2003, 12:15 PM
Seems to work good :)

Here is the result :p

amykhar
05-01-2003, 01:46 PM
Cool beans :) We put this on our board because we are trying to find moderators with real interest in specific forums. Having 3 top thread starters gave us more candidates.

Amy

Boofo
05-01-2003, 01:50 PM
Now, can you share how you did it? ;)

amykhar
05-01-2003, 01:59 PM
What, don't you want to try, Bob? :D

Amy

Boofo
05-01-2003, 02:08 PM
I tried. I also messed it up. ;)

grog6
05-01-2003, 02:23 PM
I think it could be a good idea, that the most of people try to do this, and we should compare methods after it, and say which is the best :) ?!

Boofo
05-01-2003, 02:25 PM
Alot of us don't know how to do it.

amykhar
05-01-2003, 02:27 PM
How about a nudge in the right direction?

The code in that hack that looks for the top poster is basically a simple algorithm that looks for the highest number in an array. A very trivial way to do this is to set a temp variable called max to 0 and then loop through the array element by element.

Each element in the array is compared with the value in max. If the element is greater than max, max is set to that new value and the testing continues.

If you want to find the biggest 3 elements in the array, you need three temp variables (max1, max2, and max3)

Again, you cycle through the array. First, you check to see if the element in the array is bigger than max3. If it is, you check to seee if it is bigger than max2. If it is, you check to see if it's bigger than max1. If it's bigger than max1, you set max1 to that value.

If it's not bigger than max1, but is bigger than max2, you set max2 to the new value. (This is now the second highest element)

If it's bigger than max3 but not bigger than max2, you update max3 and you have the third highest element.

So, basically, you are looking at some nested loops.

Once you have the three highest numbers, you just use those values to calculate the 3 averages, and boom. You are done.

Amy

grog6
05-01-2003, 02:36 PM
I don't do the same thing at all Amy ;)

I've totally remove the $max variable ;) and create a small loop which order all $couts[] and $nom[] in an DESCending order, so I've only to show $counts[0] and $nom[0], $counts[1] .... to display the number of total best threads creator I want to :)

The advantage, is that I can display a top3, top 5, or top 10 whithout having to modify my code :)

* grog6 loves vb.org, so I can improve my coding and I hope my bad english :p

Boofo
05-01-2003, 02:39 PM
Well, you both lost me on that.