Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. def infozettelAll
  2. users = User.find_all()
  3. zettel, faktor = createInfMain
  4. for user in users
  5. createInfDetail user, faktor, user.nickname+".jpg", zettel
  6. puts Time.new
  7. end
  8. end
  9.  
  10. #====from here: not realy important
  11.  
  12. def createInfDetail user, faktor, filename, img
  13.  
  14. text = Magick::Draw.new
  15. text.font_family = 'Arial'
  16. text.pointsize = 3.5*faktor
  17. text.font_weight = Magick::NormalWeight
  18.  
  19. event = User.find_by_sql("select * from event")
  20. ips = user.ip
  21. ersteIp=ips[0]
  22. if user.ip.length == 1
  23. text.font_weight = Magick::BoldWeight
  24. text.annotate(img, 1,1,160*faktor,183*faktor,"Deine IP:")
  25. text.font_weight = Magick::NormalWeight
  26. else
  27. text.font_weight = Magick::BoldWeight
  28. text.annotate(img, 1,1,160*faktor,183*faktor,"Deine IP's:")
  29. text.font_weight = Magick::NormalWeight
  30. end
  31. count = 0
  32. for ip in ips do
  33. text.annotate(img, 1,1,160*faktor,190*faktor+count*3.5*faktor,ip.ip)
  34. count += 1
  35. end
  36. text.font_weight = Magick::BoldWeight
  37. text.annotate(img, 1,1,60*faktor,121*faktor, ersteIp.ip)
  38. text.font_weight = Magick::NormalWeight
  39.  
  40. img.write("public/images/generate/fertig/"+filename)
  41. end
Add Comment
Please, Sign In to add comment