Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Sorunome on October 28, 2013, 06:47:41 am

Title: Sorunome.de re-write
Post by: Sorunome 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 (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:

Any thoughts/ideas?
Title: Re: Sorunome.de re-write
Post by: Jim Bauwens on October 28, 2013, 06:49:15 am
Sounds like fun!

Spoiler For Spoiler:
:devil:
Title: Re: Sorunome.de re-write
Post by: Streetwalrus on October 28, 2013, 06:49:54 am
Sounds pretty cool to me. :)
Title: Re: Sorunome.de re-write
Post by: Sorunome 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.
Title: Re: Sorunome.de re-write
Post by: Sorunome 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.
Title: Re: Sorunome.de re-write
Post by: Sorunome 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
Title: Re: Sorunome.de re-write
Post by: Deep Toaster 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
Title: Re: Sorunome.de re-write
Post by: Sorunome on December 18, 2013, 07:48:27 am
Seems like i should switch to EEC then :P
Title: Re: Sorunome.de re-write
Post by: Lunar Fire 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.
Title: Re: Sorunome.de re-write
Post by: Sorunome 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
Title: Re: Sorunome.de re-write
Post by: Sorunome on December 21, 2013, 10:15:20 am
You can post now comments - in tree form :D
Title: Re: Sorunome.de re-write
Post by: Sorunome 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
Title: Re: Sorunome.de re-write
Post by: DJ Omnimaga on July 13, 2014, 03:38:43 pm
Awesorunome :D but how much % are bots? :P
Title: Re: Sorunome.de re-write
Post by: Sorunome on July 13, 2014, 04:06:29 pm
Um, like, 80? :P
Title: Re: Sorunome.de re-write
Post by: Streetwalrus on July 13, 2014, 07:40:47 pm
Lol 80% bots, 20% lobsters ? :P
Title: Re: Sorunome.de re-write
Post by: Sorunome on July 14, 2014, 01:10:02 am
20% coolness ;)
Title: Re: Sorunome.de re-write
Post by: Sorunome on July 18, 2014, 01:04:21 pm
Oh look! Users with an account can save Slideshow Collections into the cloud now, and thus have fixed, and waaaaaay shorter urls: http://www.sorunome.de/webdeveloping/slideshow
Title: Re: Sorunome.de re-write
Post by: Streetwalrus on July 18, 2014, 02:15:34 pm
Sounds neat ! :D
Title: Re: Sorunome.de re-write
Post by: Princetonlion.tibd on July 18, 2014, 02:18:12 pm
So now there's more things then IRC
Title: Re: Sorunome.de re-write
Post by: Sorunome on July 18, 2014, 02:18:35 pm
Hehe, yeah, I planned that feature since ages, in fact.
Title: Re: Sorunome.de re-write
Post by: Princetonlion.tibd on July 18, 2014, 02:20:35 pm
Hehe, yeah, I planned that feature since ages, in fact.
I felt weird when the only thing new after I logged in (for the first time) was IRC. And it looked out of place :P
 Any other planned features we should know about? I promise I won't spam the guest book with it :P
Title: Re: Sorunome.de re-write
Post by: Sorunome on July 18, 2014, 02:21:20 pm
well, currently i can't come up wtih any, but you may have noticed that, after you logged in, you can comment on waaaaaaaaaaaay more pages
Title: Re: Sorunome.de re-write
Post by: Princetonlion.tibd on July 18, 2014, 02:22:43 pm
well, currently i can't come up wtih any, but you may have noticed that, after you logged in, you can comment on waaaaaaaaaaaay more pages
I rarely comment, but I think I did on one program (I think it was fake)
You should implement !peanuts and/or different types of Soru/Omni brand nuts
Title: Re: Sorunome.de re-write
Post by: Sorunome on September 26, 2014, 08:56:36 am
So, about the comments, I thought about starting to use http://intensedebate.com/ instead of my own system....but I wanted to know your guys's opinion.
So, here are the pros and cons for switching i thought of:

Pro:

Con:

So, any thoughts on this?
Title: Re: Sorunome.de re-write
Post by: Deep Toaster on September 27, 2014, 12:49:56 pm
What about Disqus? It seemed to be a nice one last time I checked. Don't know how it is with importing existing comments though.
Title: Re: Sorunome.de re-write
Post by: DJ Omnimaga on September 30, 2014, 11:48:24 am
Disqus is not bad but it doesn't work on some mobile devices and requires a Disqus account to post. It could be an alternative since it's very popular on news sites.

In my case I usually just used Cutenews when I made my own sites but I don't know if it's still updated and if it's secure.
Title: Re: Sorunome.de re-write
Post by: Sorunome on October 04, 2014, 06:31:38 am
So you guys are thinking it would be better to use an external commenting system?
Title: Re: Sorunome.de re-write
Post by: Sorunome on October 05, 2014, 12:09:38 pm
Buy me a beer (http://www.sorunome.de/beer)! Or buy me a cider (http://www.sorunome.de/cider)!
Title: Re: Sorunome.de re-write
Post by: Princetonlion.tibd on October 05, 2014, 12:11:04 pm
So 2/3 prefer cider? and 1/3 beer?
/me wonders is soru will actually use the donated money to buy ciders and beers :P
Title: Re: Sorunome.de re-write
Post by: Sorunome on October 05, 2014, 12:13:46 pm
It calculates from all the donations who likes ciders and beers in relation to the amount and displays the percents :P
Title: Re: Sorunome.de re-write
Post by: DJ Omnimaga on October 05, 2014, 06:24:07 pm
So you guys are thinking it would be better to use an external commenting system?
It depends. Just as long as we don't need to make a different account than on the website to use it since having to use two different accounts on the same site would be kinda annoying. Most people use DISQUIS or Facebook for comments but Facebook comments are really annoying for two reasons: Sometimes it will share the comment on your public wall even if there is no box to uncheck to prevent that (that happens sometimes), which is kinda an issue privacy-wise, and people who don't use Facebook won't be able to comment.