Omnimaga
General Discussion => Technology and Development => Web Programming and Design => Topic started 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:
$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:
$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?
-
Sounds like fun!
-
Sounds pretty cool to me. :)
-
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.
-
Ok, it is now public! Enjoy!
Note that i still have to program things like user management, commenting etc.
-
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
-
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
-
Seems like i should switch to EEC then :P
-
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.
-
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
-
You can post now comments - in tree form :D
-
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
-
Awesorunome :D but how much % are bots? :P
-
Um, like, 80? :P
-
Lol 80% bots, 20% lobsters ? :P
-
20% coolness ;)
-
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
-
Sounds neat ! :D
-
So now there's more things then IRC
-
Hehe, yeah, I planned that feature since ages, in fact.
-
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
-
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
-
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
-
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:
- You might already have an account there, no sorunome.de acc needed
- More debate?
- Email notifications
- more stuff?
Con:
- Current comments will get lost
- Needing a third party website
So, any thoughts on this?
-
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.
-
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.
-
So you guys are thinking it would be better to use an external commenting system?
-
Buy me a beer (http://www.sorunome.de/beer)! Or buy me a cider (http://www.sorunome.de/cider)!
-
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
-
It calculates from all the donations who likes ciders and beers in relation to the amount and displays the percents :P
-
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.