]> git.mxchange.org Git - friendica-addons.git/commitdiff
Bird Avatar Generator
authorfabrixxm <fabrix.xm@gmail.com>
Wed, 24 Nov 2021 11:05:12 +0000 (12:05 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Wed, 24 Nov 2021 11:05:12 +0000 (12:05 +0100)
80 files changed:
birdavatar/README.md [new file with mode: 0644]
birdavatar/avatars/accessorie_1.png [new file with mode: 0644]
birdavatar/avatars/accessorie_10.png [new file with mode: 0644]
birdavatar/avatars/accessorie_11.png [new file with mode: 0644]
birdavatar/avatars/accessorie_12.png [new file with mode: 0644]
birdavatar/avatars/accessorie_13.png [new file with mode: 0644]
birdavatar/avatars/accessorie_14.png [new file with mode: 0644]
birdavatar/avatars/accessorie_15.png [new file with mode: 0644]
birdavatar/avatars/accessorie_16.png [new file with mode: 0644]
birdavatar/avatars/accessorie_17.png [new file with mode: 0644]
birdavatar/avatars/accessorie_18.png [new file with mode: 0644]
birdavatar/avatars/accessorie_19.png [new file with mode: 0644]
birdavatar/avatars/accessorie_2.png [new file with mode: 0644]
birdavatar/avatars/accessorie_20.png [new file with mode: 0644]
birdavatar/avatars/accessorie_3.png [new file with mode: 0644]
birdavatar/avatars/accessorie_4.png [new file with mode: 0644]
birdavatar/avatars/accessorie_5.png [new file with mode: 0644]
birdavatar/avatars/accessorie_6.png [new file with mode: 0644]
birdavatar/avatars/accessorie_7.png [new file with mode: 0644]
birdavatar/avatars/accessorie_8.png [new file with mode: 0644]
birdavatar/avatars/accessorie_9.png [new file with mode: 0644]
birdavatar/avatars/bec_1.png [new file with mode: 0644]
birdavatar/avatars/bec_2.png [new file with mode: 0644]
birdavatar/avatars/bec_3.png [new file with mode: 0644]
birdavatar/avatars/bec_4.png [new file with mode: 0644]
birdavatar/avatars/bec_5.png [new file with mode: 0644]
birdavatar/avatars/bec_6.png [new file with mode: 0644]
birdavatar/avatars/bec_7.png [new file with mode: 0644]
birdavatar/avatars/bec_8.png [new file with mode: 0644]
birdavatar/avatars/bec_9.png [new file with mode: 0644]
birdavatar/avatars/body_1.png [new file with mode: 0644]
birdavatar/avatars/body_2.png [new file with mode: 0644]
birdavatar/avatars/body_3.png [new file with mode: 0644]
birdavatar/avatars/body_4.png [new file with mode: 0644]
birdavatar/avatars/body_5.png [new file with mode: 0644]
birdavatar/avatars/body_6.png [new file with mode: 0644]
birdavatar/avatars/body_7.png [new file with mode: 0644]
birdavatar/avatars/body_8.png [new file with mode: 0644]
birdavatar/avatars/body_9.png [new file with mode: 0644]
birdavatar/avatars/eyes_1.png [new file with mode: 0644]
birdavatar/avatars/eyes_2.png [new file with mode: 0644]
birdavatar/avatars/eyes_3.png [new file with mode: 0644]
birdavatar/avatars/eyes_4.png [new file with mode: 0644]
birdavatar/avatars/eyes_5.png [new file with mode: 0644]
birdavatar/avatars/eyes_6.png [new file with mode: 0644]
birdavatar/avatars/eyes_7.png [new file with mode: 0644]
birdavatar/avatars/eyes_8.png [new file with mode: 0644]
birdavatar/avatars/eyes_9.png [new file with mode: 0644]
birdavatar/avatars/hoop_1.png [new file with mode: 0644]
birdavatar/avatars/hoop_10.png [new file with mode: 0644]
birdavatar/avatars/hoop_2.png [new file with mode: 0644]
birdavatar/avatars/hoop_3.png [new file with mode: 0644]
birdavatar/avatars/hoop_4.png [new file with mode: 0644]
birdavatar/avatars/hoop_5.png [new file with mode: 0644]
birdavatar/avatars/hoop_6.png [new file with mode: 0644]
birdavatar/avatars/hoop_7.png [new file with mode: 0644]
birdavatar/avatars/hoop_8.png [new file with mode: 0644]
birdavatar/avatars/hoop_9.png [new file with mode: 0644]
birdavatar/avatars/tail_1.png [new file with mode: 0644]
birdavatar/avatars/tail_2.png [new file with mode: 0644]
birdavatar/avatars/tail_3.png [new file with mode: 0644]
birdavatar/avatars/tail_4.png [new file with mode: 0644]
birdavatar/avatars/tail_5.png [new file with mode: 0644]
birdavatar/avatars/tail_6.png [new file with mode: 0644]
birdavatar/avatars/tail_7.png [new file with mode: 0644]
birdavatar/avatars/tail_8.png [new file with mode: 0644]
birdavatar/avatars/tail_9.png [new file with mode: 0644]
birdavatar/avatars/wing_1.png [new file with mode: 0644]
birdavatar/avatars/wing_2.png [new file with mode: 0644]
birdavatar/avatars/wing_3.png [new file with mode: 0644]
birdavatar/avatars/wing_4.png [new file with mode: 0644]
birdavatar/avatars/wing_5.png [new file with mode: 0644]
birdavatar/avatars/wing_6.png [new file with mode: 0644]
birdavatar/avatars/wing_7.png [new file with mode: 0644]
birdavatar/avatars/wing_8.png [new file with mode: 0644]
birdavatar/avatars/wing_9.png [new file with mode: 0644]
birdavatar/bird_src.ora [new file with mode: 0644]
birdavatar/birdavatar.php [new file with mode: 0644]
birdavatar/lang/C/messages.po [new file with mode: 0644]
birdavatar/templates/settings.tpl [new file with mode: 0644]

diff --git a/birdavatar/README.md b/birdavatar/README.md
new file mode 100644 (file)
index 0000000..4eb8fd8
--- /dev/null
@@ -0,0 +1,14 @@
+# Bird Avatar Generator
+
+Generate a default avatar based on David Revoy's bird-avatar-generator https://www.peppercarrot.com/extras/html/2019_bird-generator/index.php
+
+## License:
+
+**Artworks:**
+PNG and ORA files licensed under: [CC-By 4.0](https://creativecommons.org/licenses/by/4.0/) 
+attribution: David Revoy with the following exception: Generated pictures used as Avatar 
+(for blog,forum,social-network) don't need direct attribution and so, can be used 
+
+**Original code**
+Original PHP code is licensed under the short and simple permissive:
+[MIT License](https://en.wikipedia.org/wiki/MIT_License)
diff --git a/birdavatar/avatars/accessorie_1.png b/birdavatar/avatars/accessorie_1.png
new file mode 100644 (file)
index 0000000..decd748
Binary files /dev/null and b/birdavatar/avatars/accessorie_1.png differ
diff --git a/birdavatar/avatars/accessorie_10.png b/birdavatar/avatars/accessorie_10.png
new file mode 100644 (file)
index 0000000..f8e4529
Binary files /dev/null and b/birdavatar/avatars/accessorie_10.png differ
diff --git a/birdavatar/avatars/accessorie_11.png b/birdavatar/avatars/accessorie_11.png
new file mode 100644 (file)
index 0000000..783e968
Binary files /dev/null and b/birdavatar/avatars/accessorie_11.png differ
diff --git a/birdavatar/avatars/accessorie_12.png b/birdavatar/avatars/accessorie_12.png
new file mode 100644 (file)
index 0000000..dde3b6c
Binary files /dev/null and b/birdavatar/avatars/accessorie_12.png differ
diff --git a/birdavatar/avatars/accessorie_13.png b/birdavatar/avatars/accessorie_13.png
new file mode 100644 (file)
index 0000000..64fe705
Binary files /dev/null and b/birdavatar/avatars/accessorie_13.png differ
diff --git a/birdavatar/avatars/accessorie_14.png b/birdavatar/avatars/accessorie_14.png
new file mode 100644 (file)
index 0000000..66f3d84
Binary files /dev/null and b/birdavatar/avatars/accessorie_14.png differ
diff --git a/birdavatar/avatars/accessorie_15.png b/birdavatar/avatars/accessorie_15.png
new file mode 100644 (file)
index 0000000..decd748
Binary files /dev/null and b/birdavatar/avatars/accessorie_15.png differ
diff --git a/birdavatar/avatars/accessorie_16.png b/birdavatar/avatars/accessorie_16.png
new file mode 100644 (file)
index 0000000..aa01159
Binary files /dev/null and b/birdavatar/avatars/accessorie_16.png differ
diff --git a/birdavatar/avatars/accessorie_17.png b/birdavatar/avatars/accessorie_17.png
new file mode 100644 (file)
index 0000000..43f6968
Binary files /dev/null and b/birdavatar/avatars/accessorie_17.png differ
diff --git a/birdavatar/avatars/accessorie_18.png b/birdavatar/avatars/accessorie_18.png
new file mode 100644 (file)
index 0000000..43f6968
Binary files /dev/null and b/birdavatar/avatars/accessorie_18.png differ
diff --git a/birdavatar/avatars/accessorie_19.png b/birdavatar/avatars/accessorie_19.png
new file mode 100644 (file)
index 0000000..43f6968
Binary files /dev/null and b/birdavatar/avatars/accessorie_19.png differ
diff --git a/birdavatar/avatars/accessorie_2.png b/birdavatar/avatars/accessorie_2.png
new file mode 100644 (file)
index 0000000..f850aab
Binary files /dev/null and b/birdavatar/avatars/accessorie_2.png differ
diff --git a/birdavatar/avatars/accessorie_20.png b/birdavatar/avatars/accessorie_20.png
new file mode 100644 (file)
index 0000000..43f6968
Binary files /dev/null and b/birdavatar/avatars/accessorie_20.png differ
diff --git a/birdavatar/avatars/accessorie_3.png b/birdavatar/avatars/accessorie_3.png
new file mode 100644 (file)
index 0000000..3e572e1
Binary files /dev/null and b/birdavatar/avatars/accessorie_3.png differ
diff --git a/birdavatar/avatars/accessorie_4.png b/birdavatar/avatars/accessorie_4.png
new file mode 100644 (file)
index 0000000..f850aab
Binary files /dev/null and b/birdavatar/avatars/accessorie_4.png differ
diff --git a/birdavatar/avatars/accessorie_5.png b/birdavatar/avatars/accessorie_5.png
new file mode 100644 (file)
index 0000000..d70aedd
Binary files /dev/null and b/birdavatar/avatars/accessorie_5.png differ
diff --git a/birdavatar/avatars/accessorie_6.png b/birdavatar/avatars/accessorie_6.png
new file mode 100644 (file)
index 0000000..7e91f4a
Binary files /dev/null and b/birdavatar/avatars/accessorie_6.png differ
diff --git a/birdavatar/avatars/accessorie_7.png b/birdavatar/avatars/accessorie_7.png
new file mode 100644 (file)
index 0000000..20b6b50
Binary files /dev/null and b/birdavatar/avatars/accessorie_7.png differ
diff --git a/birdavatar/avatars/accessorie_8.png b/birdavatar/avatars/accessorie_8.png
new file mode 100644 (file)
index 0000000..3453d5f
Binary files /dev/null and b/birdavatar/avatars/accessorie_8.png differ
diff --git a/birdavatar/avatars/accessorie_9.png b/birdavatar/avatars/accessorie_9.png
new file mode 100644 (file)
index 0000000..decd748
Binary files /dev/null and b/birdavatar/avatars/accessorie_9.png differ
diff --git a/birdavatar/avatars/bec_1.png b/birdavatar/avatars/bec_1.png
new file mode 100644 (file)
index 0000000..cf290f7
Binary files /dev/null and b/birdavatar/avatars/bec_1.png differ
diff --git a/birdavatar/avatars/bec_2.png b/birdavatar/avatars/bec_2.png
new file mode 100644 (file)
index 0000000..5b1be9a
Binary files /dev/null and b/birdavatar/avatars/bec_2.png differ
diff --git a/birdavatar/avatars/bec_3.png b/birdavatar/avatars/bec_3.png
new file mode 100644 (file)
index 0000000..3739b55
Binary files /dev/null and b/birdavatar/avatars/bec_3.png differ
diff --git a/birdavatar/avatars/bec_4.png b/birdavatar/avatars/bec_4.png
new file mode 100644 (file)
index 0000000..e16d0d5
Binary files /dev/null and b/birdavatar/avatars/bec_4.png differ
diff --git a/birdavatar/avatars/bec_5.png b/birdavatar/avatars/bec_5.png
new file mode 100644 (file)
index 0000000..8a1be08
Binary files /dev/null and b/birdavatar/avatars/bec_5.png differ
diff --git a/birdavatar/avatars/bec_6.png b/birdavatar/avatars/bec_6.png
new file mode 100644 (file)
index 0000000..5bd87c2
Binary files /dev/null and b/birdavatar/avatars/bec_6.png differ
diff --git a/birdavatar/avatars/bec_7.png b/birdavatar/avatars/bec_7.png
new file mode 100644 (file)
index 0000000..b71b04f
Binary files /dev/null and b/birdavatar/avatars/bec_7.png differ
diff --git a/birdavatar/avatars/bec_8.png b/birdavatar/avatars/bec_8.png
new file mode 100644 (file)
index 0000000..fbf95a0
Binary files /dev/null and b/birdavatar/avatars/bec_8.png differ
diff --git a/birdavatar/avatars/bec_9.png b/birdavatar/avatars/bec_9.png
new file mode 100644 (file)
index 0000000..16a2d2e
Binary files /dev/null and b/birdavatar/avatars/bec_9.png differ
diff --git a/birdavatar/avatars/body_1.png b/birdavatar/avatars/body_1.png
new file mode 100644 (file)
index 0000000..490d75e
Binary files /dev/null and b/birdavatar/avatars/body_1.png differ
diff --git a/birdavatar/avatars/body_2.png b/birdavatar/avatars/body_2.png
new file mode 100644 (file)
index 0000000..0c6e36f
Binary files /dev/null and b/birdavatar/avatars/body_2.png differ
diff --git a/birdavatar/avatars/body_3.png b/birdavatar/avatars/body_3.png
new file mode 100644 (file)
index 0000000..ccbcf0f
Binary files /dev/null and b/birdavatar/avatars/body_3.png differ
diff --git a/birdavatar/avatars/body_4.png b/birdavatar/avatars/body_4.png
new file mode 100644 (file)
index 0000000..14a295b
Binary files /dev/null and b/birdavatar/avatars/body_4.png differ
diff --git a/birdavatar/avatars/body_5.png b/birdavatar/avatars/body_5.png
new file mode 100644 (file)
index 0000000..2e06406
Binary files /dev/null and b/birdavatar/avatars/body_5.png differ
diff --git a/birdavatar/avatars/body_6.png b/birdavatar/avatars/body_6.png
new file mode 100644 (file)
index 0000000..cf6195d
Binary files /dev/null and b/birdavatar/avatars/body_6.png differ
diff --git a/birdavatar/avatars/body_7.png b/birdavatar/avatars/body_7.png
new file mode 100644 (file)
index 0000000..dc1b34b
Binary files /dev/null and b/birdavatar/avatars/body_7.png differ
diff --git a/birdavatar/avatars/body_8.png b/birdavatar/avatars/body_8.png
new file mode 100644 (file)
index 0000000..07d571f
Binary files /dev/null and b/birdavatar/avatars/body_8.png differ
diff --git a/birdavatar/avatars/body_9.png b/birdavatar/avatars/body_9.png
new file mode 100644 (file)
index 0000000..9dd1da4
Binary files /dev/null and b/birdavatar/avatars/body_9.png differ
diff --git a/birdavatar/avatars/eyes_1.png b/birdavatar/avatars/eyes_1.png
new file mode 100644 (file)
index 0000000..2d347cb
Binary files /dev/null and b/birdavatar/avatars/eyes_1.png differ
diff --git a/birdavatar/avatars/eyes_2.png b/birdavatar/avatars/eyes_2.png
new file mode 100644 (file)
index 0000000..584afa9
Binary files /dev/null and b/birdavatar/avatars/eyes_2.png differ
diff --git a/birdavatar/avatars/eyes_3.png b/birdavatar/avatars/eyes_3.png
new file mode 100644 (file)
index 0000000..5434f9c
Binary files /dev/null and b/birdavatar/avatars/eyes_3.png differ
diff --git a/birdavatar/avatars/eyes_4.png b/birdavatar/avatars/eyes_4.png
new file mode 100644 (file)
index 0000000..7c9cee1
Binary files /dev/null and b/birdavatar/avatars/eyes_4.png differ
diff --git a/birdavatar/avatars/eyes_5.png b/birdavatar/avatars/eyes_5.png
new file mode 100644 (file)
index 0000000..89859b2
Binary files /dev/null and b/birdavatar/avatars/eyes_5.png differ
diff --git a/birdavatar/avatars/eyes_6.png b/birdavatar/avatars/eyes_6.png
new file mode 100644 (file)
index 0000000..7acdd69
Binary files /dev/null and b/birdavatar/avatars/eyes_6.png differ
diff --git a/birdavatar/avatars/eyes_7.png b/birdavatar/avatars/eyes_7.png
new file mode 100644 (file)
index 0000000..098a066
Binary files /dev/null and b/birdavatar/avatars/eyes_7.png differ
diff --git a/birdavatar/avatars/eyes_8.png b/birdavatar/avatars/eyes_8.png
new file mode 100644 (file)
index 0000000..64267cf
Binary files /dev/null and b/birdavatar/avatars/eyes_8.png differ
diff --git a/birdavatar/avatars/eyes_9.png b/birdavatar/avatars/eyes_9.png
new file mode 100644 (file)
index 0000000..1807e04
Binary files /dev/null and b/birdavatar/avatars/eyes_9.png differ
diff --git a/birdavatar/avatars/hoop_1.png b/birdavatar/avatars/hoop_1.png
new file mode 100644 (file)
index 0000000..d160693
Binary files /dev/null and b/birdavatar/avatars/hoop_1.png differ
diff --git a/birdavatar/avatars/hoop_10.png b/birdavatar/avatars/hoop_10.png
new file mode 100644 (file)
index 0000000..f842670
Binary files /dev/null and b/birdavatar/avatars/hoop_10.png differ
diff --git a/birdavatar/avatars/hoop_2.png b/birdavatar/avatars/hoop_2.png
new file mode 100644 (file)
index 0000000..e2f089d
Binary files /dev/null and b/birdavatar/avatars/hoop_2.png differ
diff --git a/birdavatar/avatars/hoop_3.png b/birdavatar/avatars/hoop_3.png
new file mode 100644 (file)
index 0000000..b985f34
Binary files /dev/null and b/birdavatar/avatars/hoop_3.png differ
diff --git a/birdavatar/avatars/hoop_4.png b/birdavatar/avatars/hoop_4.png
new file mode 100644 (file)
index 0000000..cde95f8
Binary files /dev/null and b/birdavatar/avatars/hoop_4.png differ
diff --git a/birdavatar/avatars/hoop_5.png b/birdavatar/avatars/hoop_5.png
new file mode 100644 (file)
index 0000000..1fc8312
Binary files /dev/null and b/birdavatar/avatars/hoop_5.png differ
diff --git a/birdavatar/avatars/hoop_6.png b/birdavatar/avatars/hoop_6.png
new file mode 100644 (file)
index 0000000..95a7f49
Binary files /dev/null and b/birdavatar/avatars/hoop_6.png differ
diff --git a/birdavatar/avatars/hoop_7.png b/birdavatar/avatars/hoop_7.png
new file mode 100644 (file)
index 0000000..389d538
Binary files /dev/null and b/birdavatar/avatars/hoop_7.png differ
diff --git a/birdavatar/avatars/hoop_8.png b/birdavatar/avatars/hoop_8.png
new file mode 100644 (file)
index 0000000..b0cf84c
Binary files /dev/null and b/birdavatar/avatars/hoop_8.png differ
diff --git a/birdavatar/avatars/hoop_9.png b/birdavatar/avatars/hoop_9.png
new file mode 100644 (file)
index 0000000..f58e8d2
Binary files /dev/null and b/birdavatar/avatars/hoop_9.png differ
diff --git a/birdavatar/avatars/tail_1.png b/birdavatar/avatars/tail_1.png
new file mode 100644 (file)
index 0000000..e544ca3
Binary files /dev/null and b/birdavatar/avatars/tail_1.png differ
diff --git a/birdavatar/avatars/tail_2.png b/birdavatar/avatars/tail_2.png
new file mode 100644 (file)
index 0000000..5ca71c8
Binary files /dev/null and b/birdavatar/avatars/tail_2.png differ
diff --git a/birdavatar/avatars/tail_3.png b/birdavatar/avatars/tail_3.png
new file mode 100644 (file)
index 0000000..aebf9b4
Binary files /dev/null and b/birdavatar/avatars/tail_3.png differ
diff --git a/birdavatar/avatars/tail_4.png b/birdavatar/avatars/tail_4.png
new file mode 100644 (file)
index 0000000..e549eb2
Binary files /dev/null and b/birdavatar/avatars/tail_4.png differ
diff --git a/birdavatar/avatars/tail_5.png b/birdavatar/avatars/tail_5.png
new file mode 100644 (file)
index 0000000..7bf9a2d
Binary files /dev/null and b/birdavatar/avatars/tail_5.png differ
diff --git a/birdavatar/avatars/tail_6.png b/birdavatar/avatars/tail_6.png
new file mode 100644 (file)
index 0000000..081446a
Binary files /dev/null and b/birdavatar/avatars/tail_6.png differ
diff --git a/birdavatar/avatars/tail_7.png b/birdavatar/avatars/tail_7.png
new file mode 100644 (file)
index 0000000..99d3888
Binary files /dev/null and b/birdavatar/avatars/tail_7.png differ
diff --git a/birdavatar/avatars/tail_8.png b/birdavatar/avatars/tail_8.png
new file mode 100644 (file)
index 0000000..338a82a
Binary files /dev/null and b/birdavatar/avatars/tail_8.png differ
diff --git a/birdavatar/avatars/tail_9.png b/birdavatar/avatars/tail_9.png
new file mode 100644 (file)
index 0000000..eda337d
Binary files /dev/null and b/birdavatar/avatars/tail_9.png differ
diff --git a/birdavatar/avatars/wing_1.png b/birdavatar/avatars/wing_1.png
new file mode 100644 (file)
index 0000000..14aadd7
Binary files /dev/null and b/birdavatar/avatars/wing_1.png differ
diff --git a/birdavatar/avatars/wing_2.png b/birdavatar/avatars/wing_2.png
new file mode 100644 (file)
index 0000000..5b5c25c
Binary files /dev/null and b/birdavatar/avatars/wing_2.png differ
diff --git a/birdavatar/avatars/wing_3.png b/birdavatar/avatars/wing_3.png
new file mode 100644 (file)
index 0000000..bb84cdf
Binary files /dev/null and b/birdavatar/avatars/wing_3.png differ
diff --git a/birdavatar/avatars/wing_4.png b/birdavatar/avatars/wing_4.png
new file mode 100644 (file)
index 0000000..44ad10e
Binary files /dev/null and b/birdavatar/avatars/wing_4.png differ
diff --git a/birdavatar/avatars/wing_5.png b/birdavatar/avatars/wing_5.png
new file mode 100644 (file)
index 0000000..f7a8fcb
Binary files /dev/null and b/birdavatar/avatars/wing_5.png differ
diff --git a/birdavatar/avatars/wing_6.png b/birdavatar/avatars/wing_6.png
new file mode 100644 (file)
index 0000000..c29b31e
Binary files /dev/null and b/birdavatar/avatars/wing_6.png differ
diff --git a/birdavatar/avatars/wing_7.png b/birdavatar/avatars/wing_7.png
new file mode 100644 (file)
index 0000000..a4ed661
Binary files /dev/null and b/birdavatar/avatars/wing_7.png differ
diff --git a/birdavatar/avatars/wing_8.png b/birdavatar/avatars/wing_8.png
new file mode 100644 (file)
index 0000000..ed0738c
Binary files /dev/null and b/birdavatar/avatars/wing_8.png differ
diff --git a/birdavatar/avatars/wing_9.png b/birdavatar/avatars/wing_9.png
new file mode 100644 (file)
index 0000000..07d59f8
Binary files /dev/null and b/birdavatar/avatars/wing_9.png differ
diff --git a/birdavatar/bird_src.ora b/birdavatar/bird_src.ora
new file mode 100644 (file)
index 0000000..c88532a
Binary files /dev/null and b/birdavatar/bird_src.ora differ
diff --git a/birdavatar/birdavatar.php b/birdavatar/birdavatar.php
new file mode 100644 (file)
index 0000000..3e0eca5
--- /dev/null
@@ -0,0 +1,266 @@
+<?php
+/**
+ * Name: Bird Avatar Generator
+ * Description: Generate a default avatar based on David Revoy's bird-avatar-generator https://www.peppercarrot.com/extras/html/2019_bird-generator/index.php
+ * Version: 1.0
+ * Author: Fabio <https://kirgroup.com/profile/fabrixxm>
+ */
+
+use Friendica\App;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
+use Friendica\Core\Renderer;
+use Friendica\Core\Worker;
+use Friendica\Database\DBA;
+use Friendica\DI;
+use Friendica\Model\Contact;
+use Friendica\Model\Photo;
+use Friendica\Model\Profile;
+use Friendica\Network\HTTPException\NotFoundException;
+
+define("BIRDAVATAR_SIZE", 256);
+
+/**
+ * Installs the addon hook
+ */
+function birdavatar_install()
+{
+       Hook::register('avatar_lookup', 'addon/birdavatar/birdavatar.php', 'birdavatar_lookup');
+       Hook::register('addon_settings', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings');
+       Hook::register('addon_settings_post', 'addon/birdavatar/birdavatar.php', 'birdavatar_addon_settings_post');
+
+       Logger::log('registered birdavatar');
+}
+
+/**
+ * Bird avatar user settings page
+ */
+function birdavatar_addon_settings(App $a, &$s)
+{
+       if (!local_user()) {
+               return;
+       }
+
+       $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/birdavatar/');
+       $s .= Renderer::replaceMacros($t, [
+               '$postpost'     => !empty($_POST['birdavatar-morebird']) || !empty($_POST['birdavatar-emailbird']),
+               '$uncache'      => time(),
+               '$uid'          => local_user(),
+               '$usebird'      => DI::l10n()->t('Use Bird as Avatar'),
+               '$morebird'     => DI::l10n()->t('More Random Bird!'),
+               '$emailbird'    => DI::l10n()->t('Reset to email Bird'),
+               '$seed'         => DI::pConfig()->get(local_user(), 'birdavatar', 'seed', false),
+               '$header'       => DI::l10n()->t('Bird Avatar Settings'),
+               '$setrandomize' => DI::l10n()->t('Set default profile avatar or randomize the bird.'),
+       ]);
+}
+
+/**
+ * Bird avatar user settings POST handle
+ */
+function birdavatar_addon_settings_post(App $a, &$s)
+{
+       if (!local_user()) {
+               return;
+       }
+
+       if (!empty($_POST['birdavatar-usebird'])) {
+               $url = DI::baseUrl()->get() . '/birdavatar/' . local_user() . '?ts=' . time();
+
+               $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
+               if (!DBA::isResult($self)) {
+                       notice(DI::l10n()->t("The bird has not found itself."));
+                       return;
+               }
+
+               Photo::importProfilePhoto($url, local_user(), $self['id']);
+
+               $condition = ['uid' => local_user(), 'contact-id' => $self['id']];
+               $photo     = DBA::selectFirst('photo', ['resource-id'], $condition);
+               if (!DBA::isResult($photo)) {
+                       notice(DI::l10n()->t('There was an error, the bird flew away.'));
+                       return;
+               }
+
+               DBA::update('photo', ['profile' => false], ['profile' => true, 'uid' => local_user()]);
+
+               $fields = ['profile' => true, 'album' => DI::l10n()->t('Profile Photos'), 'contact-id' => 0];
+               DBA::update('photo', $fields, ['uid' => local_user(), 'resource-id' => $photo['resource-id']]);
+
+               Photo::importProfilePhoto($url, local_user(), $self['id']);
+
+               Contact::updateSelfFromUserID(local_user(), true);
+
+               // Update global directory in background
+               Profile::publishUpdate(local_user());
+
+               info(DI::l10n()->t('Meow!'));
+               return;
+       }
+
+       if (!empty($_POST['birdavatar-morebird'])) {
+               DI::pConfig()->set(local_user(), 'birdavatar', 'seed', time());
+       }
+
+       if (!empty($_POST['birdavatar-emailbird'])) {
+               DI::pConfig()->delete(local_user(), 'birdavatar', 'seed');
+       }
+}
+
+/**
+ * Returns the URL to the bird avatar
+ *
+ * @param $a array
+ * @param &$b array
+ */
+function birdavatar_lookup(App $a, &$b)
+{
+       $user = DBA::selectFirst('user', ['uid'], ['email' => $b['email']]);
+       if (DBA::isResult($user)) {
+               $url = DI::baseUrl()->get() . '/birdavatar/' . $user['uid'];
+       } else {
+               $url = DI::baseUrl()->get() . '/birdavatar/' . md5(trim(strtolower($b['email'])));
+       }
+
+       switch ($b['size']) {
+               case 300: $url .= "/4"; break;
+               case 80: $url .= "/5"; break;
+               case 48: $url .= "/6"; break;
+       }
+
+       $b['url']     = $url;
+       $b['success'] = true;
+}
+
+function birdavatar_module()
+{
+}
+
+/**
+ * Returns image for user id
+ *
+ * @throws NotFoundException
+ *
+ */
+function birdavatar_content(App $a)
+{
+       if (DI::args()->getArgc() < 2 || DI::args()->getArgc() > 3) {
+               throw new NotFoundException(); // this should be catched on index and show default "not found" page.
+       }
+
+       if (is_numeric(DI::args()->getArgv()[1])) {
+               $uid = intval(DI::args()->getArgv()[1]);
+               $condition = ['uid' => $uid,
+                               'account_expired' => false, 'account_removed' => false];
+               $user = DBA::selectFirst('user', ['email'], $condition);
+
+               if ($user === false) {
+                       throw new NotFoundException();
+               }
+
+               $seed = DI::pConfig()->get($uid, "birdavatar", "seed", md5(trim(strtolower($user['email']))));
+       } elseif (!empty(DI::args()->getArgv()[1])) {
+               $seed = DI::args()->getArgv()[1];
+       } else {
+               throw new NotFoundException();
+       }
+
+       $size = 0;
+       if (DI::args()->getArgc() == 3) {
+               $size = intval(DI::args()->getArgv()[2]);
+       }
+
+       // start generation
+       ob_start();
+
+       // render the picture:
+       build_bird($seed, $size);
+
+       ob_end_flush();
+
+       exit();
+}
+
+/**
+ * ====================
+ * CAT-AVATAR-GENERATOR
+ * ====================
+ *
+ * @authors: Andreas Gohr, David Revoy
+ *
+ * This PHP is licensed under the short and simple permissive:
+ * [MIT License](https://en.wikipedia.org/wiki/MIT_License)
+ *
+ **/
+
+function build_bird($seed = '', $size = 0)
+{
+       // init random seed
+       if ($seed) {
+               srand(hexdec(substr(md5($seed), 0, 6)));
+       }
+
+       // throw the dice for body parts
+       $parts = [
+               'tail'       => rand(1,9),
+               'hoop'       => rand(1,10),
+               'body'       => rand(1,9),
+               'wing'       => rand(1,9),
+               'eyes'       => rand(1,9),
+               'bec'        => rand(1,9),
+               'accessorie' => rand(1,20)
+       ];
+
+       // create backgound
+       $bird = @imagecreatetruecolor(BIRDAVATAR_SIZE, BIRDAVATAR_SIZE)
+               or die("GD image create failed");
+       $white = imagecolorallocate($bird, 255, 255, 255);
+       imagefill($bird, 0, 0, $white);
+
+       // add parts
+       foreach ($parts as $part => $num) {
+               $file = dirname(__FILE__) . '/avatars/' . $part . '_' . $num . '.png';
+
+               $im = @imagecreatefrompng($file);
+               if (!$im) {
+                       die('Failed to load ' . $file);
+               }
+               imageSaveAlpha($im, true);
+               imagecopy($bird, $im, 0, 0, 0, 0, BIRDAVATAR_SIZE, BIRDAVATAR_SIZE);
+               imagedestroy($im);
+       }
+
+       // scale image
+       if ($size > 3 && $size < 7) {
+               switch ($size) {
+                       case 4:
+                               $size = 300;
+                               break;
+                       case 5:
+                               $size = 80;
+                               break;
+                       case 6:
+                               $size = 48;
+                               break;
+               }
+
+               $dest = imagecreatetruecolor($size, $size) or die("GD image create failed");
+               imagealphablending($dest, false);
+               imagesavealpha($dest, true);
+               imagecopyresampled($dest, $bird, 0, 0, 0, 0, $size, $size, BIRDAVATAR_SIZE, BIRDAVATAR_SIZE);
+               imagedestroy($bird);
+               $bird = $dest;
+       }
+
+       // restore random seed
+       if ($seed) {
+               srand();
+       }
+
+       header('Pragma: public');
+       header('Cache-Control: max-age=86400');
+       header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
+       header('Content-Type: image/jpg');
+       imagejpeg($bird, null, 90);
+       imagedestroy($bird);
+}
diff --git a/birdavatar/lang/C/messages.po b/birdavatar/lang/C/messages.po
new file mode 100644 (file)
index 0000000..35db252
--- /dev/null
@@ -0,0 +1,54 @@
+# ADDON birdavatar
+# Copyright (C) 
+# This file is distributed under the same license as the Friendica birdavatar addon package.
+# 
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2021-11-24 12:04+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: birdavatar.php:49
+msgid "Use Bird as Avatar"
+msgstr ""
+
+#: birdavatar.php:50
+msgid "More Random Bird!"
+msgstr ""
+
+#: birdavatar.php:51
+msgid "Reset to email Bird"
+msgstr ""
+
+#: birdavatar.php:53
+msgid "Bird Avatar Settings"
+msgstr ""
+
+#: birdavatar.php:54
+msgid "Set default profile avatar or randomize the bird."
+msgstr ""
+
+#: birdavatar.php:72
+msgid "The bird has not found itself."
+msgstr ""
+
+#: birdavatar.php:81
+msgid "There was an error, the bird flew away."
+msgstr ""
+
+#: birdavatar.php:87
+msgid "Profile Photos"
+msgstr ""
+
+#: birdavatar.php:97
+msgid "Meow!"
+msgstr ""
diff --git a/birdavatar/templates/settings.tpl b/birdavatar/templates/settings.tpl
new file mode 100644 (file)
index 0000000..a31acfd
--- /dev/null
@@ -0,0 +1,24 @@
+<span id="settings_birdavatar_inflated" class="settings-block fakelink" 
+       style="{{if $postpost}}display: none;{{else}}display: block;{{/if}}" 
+       onclick="openClose('settings_birdavatar_expanded'); openClose('settings_birdavatar_inflated');">
+               <h3>{{$header}}</h3>
+</span>
+<div id="settings_birdavatar_expanded" class="settings-block" 
+       style="{{if $postpost}}display: block;{{else}}display: none;{{/if}}">
+       <span class="fakelink" onclick="openClose('settings_birdavatar_expanded'); openClose('settings_birdavatar_inflated');">
+               <h3>{{$header}}</h3>
+       </span>
+       <img src="{{$basepath}}/birdavatar/{{$uid}}?{{$uncache}}">
+       <p>{{$setrandomize}}</p>
+       <div class="settings-submit-wrapper" >
+               <button type="submit" name="birdavatar-usebird"
+                       class="btn btn-primary settings-submit" value="{{$usebird}}">{{$usebird}}</button>
+               
+               <div class="btn-group" role="group" aria-label="...">
+                       <button type="submit" name="birdavatar-morebird"
+                               class="btn btn-default settings-submit" value="{{$morebird}}">{{$morebird}}</button>
+                       <button type="submit" name="birdavatar-emailbird" {{if !$seed}}disabled{{/if}}
+                               class="btn btn-default settings-submit" value="{{$emailbird}}">{{$emailbird}}</button>
+               </div>
+       </div>
+</div>