Author Topic: Sorunome.de re-write  (Read 18788 times)

0 Members and 1 Guest are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Sorunome.de re-write
« on: October 28, 2013, 06:47:41 am »
Yep, I am re-writing sorunome.de - from scratch!
I've been working on it since quite some time now.
EDIT: public! www.sorunome.de

At first look it looks more or less the same like the current one, but the software behind it is so much more awesome!
First of all, every single request for that domain gets re-directed to the same php script, the url path as a parameter.
From there i check for if you want, let's say, an image.
Copying the image and then displaying it, pretty simple. But i also allowed it to server-side rescale it before sending - only by modifying the path!
Let's take a look: http://sorunome.reubenquest.net/*/75/media/knex/ballmachines/crazy/crazy_top.jpg
the /*/75/ is the important path, first you say width, then height. If it is * that means it'll get fixed to match the proportions. If you completley omit that you get the original.

Ok, images aside, the awesomeness just began!
When calling a normal page it looks it up in a database - the database only has the id, url fragment, the content. the title and te ref-id
The ref-id points to the other page where that is the child of, like ballmachines pointing to knex will be triggerd at /knex/ballmachines.
It also creates the naviagation out of that.

Wait, there is still another thing that makes it 20% cooler - the content is stored in BB-Code and gets parsed to HTML - with a self-written bb-code parser!
the bb-code parser also makes defining tags VERY easy.
This for example will create the [b] tag:
Code: [Select]
$bbParser->addTag('b',function($type,$s,$attrs,$bbParser){
        return '<b>'.$bbParser->parse($s).'</b>';
},[],'bold');
First parameter of addTag is the tag name, so b. The second one is the function that'll get called to parse that tag, the third one is a array of all attributes allowed, the 4th one is help text (not used yet, lol)
So for [url] it looks like this:
Code: [Select]
$bbParser->addTag('url',function($type,$s,$attrs,$bbParser){
        if (isset($attrs['url'])) {
                if (filter_var($attrs['url'],FILTER_VALIDATE_URL))
                        return '<a href="'.$attrs['url'].'">'.$bbParser->parse($s).'</a>';
                return $bbParser->returnBB($type,$s,$attrs);
        }
        if (filter_var($s,FILTER_VALIDATE_URL))
                return '<a href="'.$s.'">'.$s.'</a>';
        return $bbParser->returnBB($type,$s,$attrs);
},['url'],'Display URL');

So yeah, todos:
  • GUI way of editing the DB, currently i use phpmyadmin
  • comments on each page!
  • Add bbCode parser whitelisting/blacklisting
  • stuff?

Any thoughts/ideas?
« Last Edit: December 18, 2013, 07:49:12 am by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sorunome.de re-write
« Reply #1 on: October 28, 2013, 06:49:15 am »
Sounds like fun!

Spoiler For Spoiler:
:devil:

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Sorunome.de re-write
« Reply #2 on: October 28, 2013, 06:49:54 am »
Sounds pretty cool to me. :)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #3 on: October 28, 2013, 06:51:28 am »
ha, thanks guys!
I also forgot something in the todo list: when calling $bbParser->parse() i want to add that you can specify which tags get whitelisted/blacklisted, and then use that bb-code parser also for the comments.
« Last Edit: October 28, 2013, 06:51:41 am by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #4 on: December 13, 2013, 01:31:39 pm »
Ok, it is now public! Enjoy!

Note that i still have to program things like user management, commenting etc.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #5 on: December 15, 2013, 02:42:23 pm »
Yay, my super secure account system is working and *almost* done, all i need to add is that you can stay logged in based on cookies :)

So yeah, i actually RSA encrypt the passwords before sending to the server so that nobody that'll monitor your network will be able to read 'em :)

So, create an account >:D
« Last Edit: December 15, 2013, 02:42:37 pm by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Sorunome.de re-write
« Reply #6 on: December 17, 2013, 09:36:46 pm »
So I tried your beta site instead and got the default nginx pageā€”then realized you'd put it in public already.

Yay website refactoring \o/

Nice to hear about encryption. Now there's yet another reason for us to break RSA >:D
« Last Edit: December 17, 2013, 09:37:18 pm by Deep Thought »




Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #7 on: December 18, 2013, 07:48:27 am »
Seems like i should switch to EEC then :P

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: Sorunome.de re-write
« Reply #8 on: December 18, 2013, 11:39:08 am »
Hey Sorunome,

Your website works great. I looked around a bit and found only one bug. Your spoilers "Show" buttons don't work. Other than that it looks awesome.
Your drill is the drill that will pierce the heavens!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #9 on: December 18, 2013, 02:03:36 pm »
Yeah, i know that, that is because those come from instructables and that is that instructables embed thingy i wrote which does that, thanks anyways :)

EDIT: Also, https://github.com/Sorunome/Homepage
Look at all those comments O.O
« Last Edit: December 18, 2013, 02:17:27 pm by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #10 on: December 21, 2013, 10:15:20 am »
You can post now comments - in tree form :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #11 on: July 13, 2014, 02:05:36 pm »
Wait, in my todo here was bb-code stuff I already finished ages ago :P
And comments, too, i guess i'll have to edit the first post.

Anyways, what I wanted to say is that I finally got around making my analytics software differentiate from bots visit stuff and non-bot stuff :D
It can be soooooo awesome to use this software, to add new pages as it is sooooo easy :3

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Sorunome.de re-write
« Reply #12 on: July 13, 2014, 03:38:43 pm »
Awesorunome :D but how much % are bots? :P

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sorunome.de re-write
« Reply #13 on: July 13, 2014, 04:06:29 pm »
Um, like, 80? :P

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Sorunome.de re-write
« Reply #14 on: July 13, 2014, 07:40:47 pm »
Lol 80% bots, 20% lobsters ? :P