DarkAngelBGE Posted July 31, 2004 Report Share Posted July 31, 2004 Yeah, the bug has not really been fixed, but when I first looked at it I couldn't figure out what was causing it, but I will try another time.I just figured it is not useful to lose so much time on it, if there is such a nice workaround. Quote Link to comment Share on other sites More sharing options...
DarkAngelBGE Posted July 31, 2004 Report Share Posted July 31, 2004 You guys beat me to it. Okay this is where the problem is:$info['downs'] = abs ($info['rep'] - $info['ups']);As you see when 'rep' is bigger (because I changed it manually), the 'ups' do not change. That's why there will be more 'downs'. So I just have to change that formula here. Quote Link to comment Share on other sites More sharing options...
DarkAngelBGE Posted July 31, 2004 Report Share Posted July 31, 2004 And here is the solution: $DB->query("SELECT r.CODE, m.rep FROM members m LEFT JOIN reputation r ON (m.id = r.member_id and r.CODE = '01') WHERE m.id = '$memid' GROUP BY m.id"); $ups = ''; $downs = '' while( $info = $DB->fetch_row() ) { if( $info['CODE'] == '01' ) $ups += 1; else $downs += 1; } $manually = abs( $info['rep'] - ($info['ups'] + $info['downs']) ); $DB->query("SELECT m.id, m.name, m.rep FROM members m LEFT JOIN reputation r ON (m.id = r.member_id and r.CODE = '01') WHERE m.id = '$memid' GROUP BY m.id"); $info = $DB->fetch_row(); $info['upss'] = $ups; $info['downs'] = $downs; $info['manually'] = $manually;Need another query to actually iterate over the rep changes and to assign the ups and downs. Now when we have done that we compare the real rep number to the sum of the ups and downs. The difference between them is the amount of rep that was manually changed, which we will need to supply the skin with to have some field "Manually changed'.Well, I am not going to use this as I once in a while recount the reputation statistics and, as last time, manually changed rep gets lost then. So we will stick with the current method. Just wanted to proove that I could solve this if I wanted to. Quote Link to comment Share on other sites More sharing options...
Lorian Posted July 31, 2004 Report Share Posted July 31, 2004 *Is utterly confused on PHP coding* Um, whatever you say Tim Quote Link to comment Share on other sites More sharing options...
CodeOptimist Posted July 31, 2004 Report Share Posted July 31, 2004 Timmy: You're missing an ending ; on $downs='' The current solution is fine with me (manually giving the GoTM/MoTM awards) - simple but effective Quote Link to comment Share on other sites More sharing options...
akya Posted August 1, 2004 Report Share Posted August 1, 2004 *looks at Tim's solution**tries to understand**understands*Yep I figure most of it out you should make some tutorials Tim Quote Link to comment Share on other sites More sharing options...
Curufinwe Posted August 1, 2004 Author Report Share Posted August 1, 2004 (*looks at Tim's solution**tries to understand**understands**looking again**doesn't understand at all**gives up**goes and post in "Word Association" *Anyway, it is easier to change the rep manually good job Timbo and thanks for the rep changes too Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.