Metaclassofnil.com moved, forum software upgraded

Everything that does not fit into the catagories below.

Moderators: Moderators, General Forum Moderators

Metaclassofnil.com moved, forum software upgraded

Postby PeterT » Fri Jan 18, 2008 12:26 am

Hi all!

As you have undoubtedly noticed, the forum was down for a while because I had to move hosts (which involved a lot of database and file shuffling etc). Because I was already changing a lot anyway I also took this chance to upgrade to phphBB3. So far, the conversion process seems to have worked well, but if any bugs crop up please post about them here.

The change in host and forum software has a few advantages:
  • Better user registration CAPTCHA should mean that I no longer have to activate accounts manually.
  • The performance issues that sometimes came up at the old host should not happen any more.
  • PHPbb3 has better, integrated support for file attachments.

The most important drawback (for you, for me there is also the matter of it being more expensive ;)) is that my new host does not support ruby scripts, so for now the medal script will not update. If anyone has the expertise to rewrite it in php, perl or python then contact me.

I'm sorry for the delay (and the delay in activations that preceeded it), but I now work 40 hours a week and don't have as much time to spend on this as before. With the new forum software at least the account activation problem should be solved.
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Re: Metaclassofnil.com moved, forum software upgraded

Postby PeterT » Fri Jan 18, 2008 12:57 am

Here is the original code for the current medal updating script, in case anyone wants to try porting it:
Code: Select all
require "mysql"

UR_V = "0.6"

CON = ["Classic Contest", ""N" Contest", ""A" Contest",
         ""B" Contest", ""C" Contest", "Design Competition", "End"]
         
LRD = /^.+?: L:? (.*?) D:? (.*?)$/
LR = /^.+?: L:? (.*?)$/
LD = /^.+?: (.*?)$/

l_winners = Hash.new(0)
d_winners = Hash.new(0)
c_winners = Hash.new(0)

L_FAC = D_FAC = C_FAC = 1

CHAMPION_LIGHT = 15
CHAMPION_DARK = 16

ARMADEUS = 14
DARK_MASTER = 13
LIGHT_MASTER = 12
CONTEST_LORD = 11
CONTEST_LEGEND = 10
CONTEST_VETERAN = 9
CONTEST_WINNER = 8

def split_add(match, hash)
   spl = match.split("and").map { |s| s.strip }
   spl.each { |l| hash[l] += 1 }
end

begin
   my = Mysql::new("localhost", "[username]", "[password]", "[dbname]")
   medalpost = my.query("SELECT post_text FROM `phpbb_posts_text` WHERE `post_id`=3685")
   medalpost.each do |row|
      text = row[0].gsub(/\[.*?\]/, "")
      CON.each_index do |i|
         break unless i+1 < CON.length
         reg = Regexp.new(Regexp.escape(CON[i]) + "(.*)" + Regexp.escape(CON[i+1]), Regexp::MULTILINE)
         conlines = reg.match(text)[1]
         conlines.each do |line|
            #puts "line: #{line}"
            if i == CON.length-2
               if m=LD.match(line)
                  #puts "LD: #{m[1]}"
                  split_add(m[1], c_winners)
               end
               next
            end
            if m=LRD.match(line)
               #puts "LRD: #{m[1]} ||| #{m[2]}"
               split_add(m[1], l_winners)
               split_add(m[2], d_winners)
            elsif m=LR.match(line)
               #puts "LR: #{m[1]}"
               split_add(m[1], l_winners)
            end
         end
      end
   end
   
   totals = Hash.new(0)
   l_winners.each { |k,v| totals[k] += v*L_FAC }
   d_winners.each { |k,v| totals[k] += v*D_FAC }
   c_winners.each { |k,v| totals[k] += v*C_FAC }
   
   totals = totals.sort { |a,b| -(a[1]<=>b[1])}
   l_h = l_winners
   d_h = d_winners
   l_winners = l_winners.sort { |a,b| -(a[1]<=>b[1])}
   d_winners = d_winners.sort { |a,b| -(a[1]<=>b[1])}
    c_winners = c_winners.sort { |a,b| -(a[1]<=>b[1])}   
   
   #p l_winners
   #p d_winners
   #p c_winners
   
   tallypost ="[u:63374fd4cb]Overall standing:[/u:63374fd4cb]\n\n"
   totals.each_with_index do |(name, points), i|
      tallypost += "[b:63374fd4cb]#{(i+1).to_s}[/b:63374fd4cb] - [i:63374fd4cb]#{name}[/i:63374fd4cb] - #{points} point#{points>1?'s':''}\n"
   end
   tallypost +="\n\n[u:63374fd4cb]Light medals:[/u:63374fd4cb]\n\n"
   l_winners.each do |name, medals|
      tallypost += "[b:63374fd4cb]#{name}[/b:63374fd4cb] - " + ":lms:"*medals + "\n"
   end
   tallypost +="[color=#DDDDEE:63374fd4cb][/color:63374fd4cb]\n\n[u:63374fd4cb]Dark medals:[/u:63374fd4cb]\n\n"
   d_winners.each do |name, medals|
      tallypost += "[b:63374fd4cb]#{name}[/b:63374fd4cb] - " + ":dms:"*medals + "\n"
   end
   tallypost +="[color=#DDDDEE:63374fd4cb][/color:63374fd4cb]\n\n[u:63374fd4cb]Design medals:[/u:63374fd4cb]\n\n"
   c_winners.each do |name, medals|
      tallypost += "[b:63374fd4cb]#{name}[/b:63374fd4cb] - " + ":cms:"*medals + "\n"
   end
   tallypost += "[color=#DDDDEE:63374fd4cb][/color:63374fd4cb]\n\n(autogenerated on #{Time.now} by updateranking.rb #{UR_V} - DO NOT EDIT THIS POST)"
   
   #puts "UPDATE phpbb_posts_text SET post_text=\"#{my.escape_string(tallypost)}\" WHERE `post_id`=3686"
   
   my.query("UPDATE phpbb_posts_text SET post_text=\"#{my.escape_string(tallypost)}\" WHERE `post_id`=3686")
   
   totals.each do |name, points|
      next if name == "PeterT"
      rank = CONTEST_WINNER
      if l_h[name] >= 15 && d_h[name] >= 10 then rank = ARMADEUS
      elsif l_h[name] >= 15 then rank = LIGHT_MASTER
      elsif d_h[name] >= 10 then rank = LIGHT_MASTER
      elsif points >= 10 then rank = CONTEST_LORD
      elsif points >= 6 then rank = CONTEST_LEGEND
      elsif points >= 3 then rank = CONTEST_VETERAN
      end
      rank = CHAMPION_DARK if d_winners[0][1] == d_h[name]
      rank = CHAMPION_LIGHT if l_winners[0][1] == l_h[name]
      #puts "Making #{name} a #{rank}"
      my.query("UPDATE phpbb_users SET user_rank=#{rank} WHERE `username`=\"#{my.escape_string(name)}\"")
   end
   
ensure
   my.close() if my
end

If you're feeling adventurous you can also try adding the other contest types or additional ouput options ;)
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Re: Metaclassofnil.com moved, forum software upgraded

Postby CN Player » Fri Jan 18, 2008 3:44 am

oh yeah,am I the 1st one back here.
Peter, I think you shall send an email to each member to let they know that the forum is back.
User avatar
CN Player
Light Master
 
Posts: 485
Joined: Thu Feb 15, 2007 5:37 am
Location: China

Re: Metaclassofnil.com moved, forum software upgraded

Postby NickyNick » Fri Jan 18, 2008 1:09 pm

Peter, I'll try to find some time and rewrite it on PHP.
And... welcome back everybody! :)
AR & W:A forever
User avatar
NickyNick
Champion of Light
Champion of Light
 
Posts: 1330
Joined: Sat Dec 30, 2006 10:43 pm
Location: Ukraine - Kharkov

Re: Metaclassofnil.com moved, forum software upgraded

Postby FF » Fri Jan 18, 2008 1:18 pm

Nick, please find what's wrong in this script :)
Peter, thank u for rewiving the forum
User avatar
FF
Light Master
 
Posts: 405
Joined: Thu Apr 05, 2007 4:33 pm
Location: Russia

Re: Metaclassofnil.com moved, forum software upgraded

Postby NickyNick » Fri Jan 18, 2008 1:21 pm

And, Peter: I'm not playing a lot, but thank you for new forum. And, maybe we should finish upgrade with new rank pictures (for Masters and Armadeus)? :wink:
AR & W:A forever
User avatar
NickyNick
Champion of Light
Champion of Light
 
Posts: 1330
Joined: Sat Dec 30, 2006 10:43 pm
Location: Ukraine - Kharkov

Re: Metaclassofnil.com moved, forum software upgraded

Postby JonathanF » Fri Jan 18, 2008 1:38 pm

The forum's back!! :) I better get back to playing ;)
"It's just a reflection of dark past, remains of a ruined, dead, cursed soul, and also another reason for you to hate me..."

-Meyhna'ch
User avatar
JonathanF
Armadillo Lord
Armadillo Lord
 
Posts: 423
Joined: Tue Jan 09, 2007 5:23 pm
Location: Jerusalem, Israel

Re: Metaclassofnil.com moved, forum software upgraded

Postby cablelag » Fri Jan 18, 2008 2:23 pm

Nice. Waiting for your new game :)
cablelag
 
Posts: 18
Joined: Tue Nov 07, 2006 8:22 pm

Re: Metaclassofnil.com moved, forum software upgraded

Postby PeterT » Fri Jan 18, 2008 5:14 pm

CN Player wrote:Peter, I think you shall send an email to each member to let they know that the forum is back.
Good idea, I did that.

NickyNick wrote:And, Peter: I'm not playing a lot, but thank you for new forum. And, maybe we should finish upgrade with new rank pictures (for Masters and Armadeus)? :wink:
I'll see what I can do. I didn't realize we now had an Armadeus :o

cablelag wrote:Nice. Waiting for your new game :)
I'm not Peter Stock -- this really causes a lot of misunderstandings...
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Re: Metaclassofnil.com moved, forum software upgraded

Postby mark_man » Fri Jan 18, 2008 8:34 pm

:D :D :D :D :D :D :D :D :D :D :D :D glad to see you all again
I'm Just A Simple Man.
Please for everyone don't believe ANY scores I post .... :D :twisted:
mark_man
Contest Legend
Contest Legend
 
Posts: 1686
Joined: Sun Sep 10, 2006 1:31 pm
Location: England

Re: Metaclassofnil.com moved, forum software upgraded

Postby NickyNick » Fri Jan 18, 2008 11:36 pm

mark_man wrote::D :D :D :D :D :D :D :D :D :D :D :D glad to see you all again

Hi my old mate!!! :D :D :D I'm so happy to see you! :armadillo:
AR & W:A forever
User avatar
NickyNick
Champion of Light
Champion of Light
 
Posts: 1330
Joined: Sat Dec 30, 2006 10:43 pm
Location: Ukraine - Kharkov

Re: Metaclassofnil.com moved, forum software upgraded

Postby ConstableBrew » Sat Jan 19, 2008 1:57 am

So all it takes to get registered on this site is to force PeterT to change web hosts?
ConstableBrew
 
Posts: 1
Joined: Sat Jan 19, 2008 1:52 am

Re: Metaclassofnil.com moved, forum software upgraded

Postby PeterT » Sat Jan 19, 2008 10:52 am

ConstableBrew wrote:So all it takes to get registered on this site is to force PeterT to change web hosts?
No, force me to change forum versions (which has only become possible recently with the release of phpBB3).

Let's just hope that the new image verification system is enough to deter spambots. Believe it or not, but I'm also a lot happier if I don't have to activate each new user manually :P
PeterT
Site Admin
Site Admin
 
Posts: 473
Joined: Fri May 26, 2006 9:57 pm
Location: Austria

Re: Metaclassofnil.com moved, forum software upgraded

Postby JonathanF » Sat Jan 19, 2008 11:49 pm

Not only the forum's back but markman's back also! That's great!! can't wait to play your levels you made some of the best contests ever!
"It's just a reflection of dark past, remains of a ruined, dead, cursed soul, and also another reason for you to hate me..."

-Meyhna'ch
User avatar
JonathanF
Armadillo Lord
Armadillo Lord
 
Posts: 423
Joined: Tue Jan 09, 2007 5:23 pm
Location: Jerusalem, Israel

Re: Metaclassofnil.com moved, forum software upgraded

Postby JustcallmeDrago » Sun Jan 20, 2008 5:22 pm

CN Player wrote:Peter, I think you shall send an email to each member to let they know that the forum is back.


Heh, I didn't check my email :lol:


It's good to be back.
User avatar
JustcallmeDrago
Contest Veteran
Contest Veteran
 
Posts: 904
Joined: Sun Mar 25, 2007 6:19 pm
Location: Earth

Next

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron