[QUOTE=Giraffen93;42294323]because it's a huge clusterfuck and is hard to read, i have a hard time reading that
sql tables are real nice, [B]you just have a parent to the id and loop through everything[/B][/QUOTE]
Here I did it in PHP
[code]
$team_menu = array(
'Frank' => array(
'path' => '/team/frank'
),
'Bob' => array(
'path' => '/team/bob'
)
);
$about_menu = array(
'Our Team' => array(
'path' => '/our-team',
'submenu' => $team_menu,
),
'Our Process' => array(
'path' => '/our-process'
)
)
$main_menu = array(
'Home' => array(
'path' => '/'
),
'Portfolio' => array(
'path' => '/portfolio'
),
'About' => array(
'path' => '/about',
'submenu' => $about_menu
),
);
[/code]
That just feels unnecessary to me though..
[QUOTE=Giraffen93;42294056]but they need links too, it becomes a nested clusterfuck in the end
never tried sqlite, might work[/QUOTE]
It has to be nested though... that's the type of menu you are representing. You can use the key as the label and the value as the hyperlink, and you can stop using the array() declaration syntax and use PHP 5.4's [] syntax and it clears up considerably.
[code]
<?php
# Any string => string is label => url
# Any string => array is label => submenu
$menu = [
'SomeLabel' => 'http://www.example.com/',
'SomeMenuLabel' => [
'AnotherLabel' => 'http://ww2.example.com/',
'AThirdOne' => 'http://ww3.example.com/'
],
'AnotherTopLevel' => 'http://ww4.example.com/'
];
?>
[/code]
Seems to be a one-to-one analog to the html, besides the fact that it is more compact and easier to read.
[QUOTE=Svenskunganka;42294348]As expected of our sqrl! You always continiue to amaze me. How come you know everything?[/QUOTE]
I'm not even close to knowing everything haha. I [I]have[/I] been doing this for 12-13 years now though so that helps :P
[QUOTE=Rayjingstorm;42294420]It has to be nested though... that's the type of menu you are representing. You can use the key as the label and the value as the hyperlink, and you can stop using the array() declaration syntax and use PHP 5.4's [] syntax and it clears up considerably.
[code]
<?php
# Any string => string is label => url
# Any string => array is label => submenu
$menu = [
'SomeLabel' => 'http://www.example.com/',
'SomeMenuLabel' => [
'AnotherLabel' => 'http://ww2.example.com/',
'AThirdOne' => 'http://ww3.example.com/'
],
'AnotherTopLevel' => 'http://ww4.example.com/'
];
?>
[/code]
Seems to be a one-to-one analog to the html, besides the fact that it is more compact and easier to read.[/QUOTE]
well i don't have 5.4 sadly
[QUOTE=Giraffen93;42294942]well i don't have 5.4 sadly[/QUOTE]
Still, that's only a minor eyesore. Even with the old-style array declaration syntax it is easy to read:
[code]
<?php
# Any string => string is label => url
# Any string => array is label => submenu
$menu = array(
'SomeLabel' => 'http://www.example.com/',
'SomeMenuLabel' => array(
'AnotherLabel' => 'http://ww2.example.com/',
'AThirdOne' => 'http://ww3.example.com/'
),
'AnotherTopLevel' => 'http://ww4.example.com/'
);
?>
[/code]
It's pretty simple to iterate through it: if the value is a string, make an anchor for it; if its an array, make a submenu and recurse with the submenu array as your new root.
i'll have to do this some other time, if i look at that code my brain just shuts of completely
oh wow 5.4 finally has []?
about time.
also yeah, nested arrays is pretty much the best way, unless you want to write a system that allows you to do something like this:
[code]
$menu = new Menu();
$home = new Button();
$home->setLabel('Home');
$home->setURL('/home');
$homesub = new Menu();
$about = new Button();
$about->setLabel('About');
$about->setURL('/about');
$homesub->addButton($about);
$home->setSubmenu($homesub);
$menu->addButton($home);
[/code]
which is even more confusing now that I've typed it out.
[QUOTE=Giraffen93;42295027]i'll have to do this some other time, if i look at that code my brain just shuts of completely[/QUOTE]
You are very stubborn my friend!
[QUOTE=Giraffen93;42295027]i'll have to do this some other time, if i look at that code my brain just shuts of completely[/QUOTE]
[thumb]http://www.hondagrom.net/forums/attachments/875d1374620718-grom-here-jackie-chan-my-brain-full-fuck-meme-blank-template-lol-wtf.jpg[/thumb]
In all seriousness though I don't understand how it is any different, visually or conceptually, from the HTML it is used to generate. Personally I find it more confusing trying to represent an inherently nested structure (like a cascading menu) in an inherently flat structure (like a SQL table, or similar).
Everyone here has offered good solutions, and you have rejected them all, apparently without much thought beyond a perceived mental block at the very sight of them, so I'm done offering suggestions and I think many others may be too.
Also, you won't even so much as entertain the idea that a different language would be more suited to a situation, when it is the job of the designer to pick the proper tools: when all you have is a hammer, every problem begins to look like nails, and apparently you have a problem with nails.
[highlight](User was banned for this post ("meme face reply" - postal))[/highlight]
[QUOTE=Svenskunganka;42295122]You are very stubborn my friend![/QUOTE]
yes i am
but i've done so much shit today it's unbelievable
[url]http://new.waldorfumea.se/studier/amnen/teater/[/url]
all those submenu texts
and no, i'm not rejecting your ideas, i just can't work with them at the moment
[QUOTE=Giraffen93;42295188]yes i am
but i've done so much shit today it's unbelievable
[url]http://new.waldorfumea.se/studier/amnen/teater/[/url]
all those submenu texts
and no, i'm not rejecting your ideas, i just can't work with them at the moment[/QUOTE]
If it's hard to read the code with all that text, just add some comments between each menu/sub-menu so it's easier to separate them.
[editline]24th September 2013[/editline]
Something like this can't possibly shut down your brain?
[CODE]
$menu = array(
'program' => array(
'path' => '/program/',
'subs' => array(
// No subs here!
),
),
'studier' => array(
'path' => '/studier/',
'subs' => array(
'undervisning' => array(
'path' => '/studier/undervisning',
'subs' => array(
// No subs here!
),
),
'amnen' => array(
'path' = '/studier/amnen',
'subs' => array(
'teater' => array(
'path' => '/studier/amnen/teater',
// No subs here so no reason to make one!
),
'dans' => array(
'path' => '/studier/amnen/dans',
// No subs here so no reason to make one!
),
'musik' => array(
'path' => '/studier/amnen/musik',
// No subs here so no reason to make one!
),
'bild' => array(
'path' => '/studier/amnen/bild',
// No subs here so no reason to make one!
),
'konsthantverk' => array(
'path' => '/studier/amnen/konsthantverk',
// No subs here so no reason to make one!
),
'fysik' => array(
'path' => '/studier/amnen/fysik',
// No subs here so no reason to make one!
),
'matematik' => array(
'path' => '/studier/amnen/matematik',
// No subs here so no reason to make one!
),
'kemi' => array(
'path' => '/studier/amnen/kemi',
// No subs here so no reason to make one!
),
'biologi' => array(
'path' => '/studier/amnen/biologi',
// No subs here so no reason to make one!
),
'moderna_sprak' => array(
'path' => '/studier/amnen/sprak',
// No subs here so no reason to make one!
),
'enskilt_arsarbete' => array(
'path' => '/studier/amnen/enskilt',
// No subs here so no reason to make one!
),
),
),
'resor' => array(
'path' => '/studier/resor',
'subs' => array(
// No subs here!
),
),
'utomlands' => array(
'path' => '/studier/resor',
'subs' => array(
// No subs here!
),
),
),
),
);
[/CODE]
Are you sure it's shutting down your brain or you're just refusing to read it because you're in search of "the best possible solution ever"? If you want something that look good, you should probably use a language that is not PHP.
[QUOTE=TerabyteS_;42296076]Are you sure it's shutting down your brain or you're just refusing to read it because you're in search of "the best possible solution ever"? If you want something that look good, you should probably use a language that is not PHP.[/QUOTE]
Sorry but I can't help but mention this, ignore "drunked"s dumb rating - he goes around rating everything dumb regardless of it's actual content, probably because he can't understand it, I don't know.
Seriously though, PHP isn't the worst language in the world - it's the one I use and I can't find *that many* problems with it :)
[QUOTE=TerabyteS_;42296076]Are you sure it's shutting down your brain or you're just refusing to read it because you're in search of "the best possible solution ever"? If you want something that look good, you should probably use a language that is not PHP.[/QUOTE]
I've just been overworking today (7h+).
How would it look anyway? Most code look similar to me
[QUOTE=Dorkslayz;42296173]Sorry but I can't help but mention this, ignore "drunked"s dumb rating - he goes around rating everything dumb regardless of it's actual content, probably because he can't understand it, I don't know.
Seriously though, PHP isn't the worst language in the world - it's the one I use and I can't find *that many* problems with it :)[/QUOTE]
[url]http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/[/url]
[QUOTE=supersnail11;42297046][url]http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/[/url][/QUOTE]
Yes, PHP is a pretty bad language. But I hate when people attack it with that piece of shit article. You would have had to never of used PHP extensively if you genuinely believe all of it.
Some of the things he says are just plain false. He's like a student trying to surpass his character minimum, using reasons to bash the language regardless if he understands what he's talking about or not.
[url=http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html]Here's a post detailing this.[/url]
[url]http://new.waldorfumea.se/program/naturprogrammet/fysik/[/url]
and bam there we go
and about the article, i agree that some of the stuff is stupid
[QUOTE=jetboy;42298904]Yes, PHP is a pretty bad language. But I hate when people attack it with that piece of shit article. You would have had to never of used PHP extensively if you genuinely believe all of it.
Some of the things he says are just plain false. He's like a student trying to surpass his character minimum, using reasons to bash the language regardless if he understands what he's talking about or not.
[url=http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html]Here's a post detailing this.[/url][/QUOTE]
thank you for posting this
[QUOTE=jetboy;42298904]Yes, PHP is a pretty bad language. But I hate when people attack it with that piece of shit article. You would have had to never of used PHP extensively if you genuinely believe all of it.
Some of the things he says are just plain false. He's like a student trying to surpass his character minimum, using reasons to bash the language regardless if he understands what he's talking about or not.
[url=http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html]Here's a post detailing this.[/url][/QUOTE]
Agreed. I don't like seeing that article thrown around, it dilutes all the good arguments that exist against using PHP in a bunch of uninformed and plain incorrect points that only look swell to anyone who hasn't actually ever used the language.
I've been working on a video content website using HTML5 for the past 7/8 months. Needs refining, but the overall system behind it is alright.
[url]http://nlan.org/video/[/url]
[QUOTE=Silentfood;42306842]I've been working on a video content website using HTML5 for the past 7/8 months. Needs refining, but the overall system behind it is alright.
[url]http://nlan.org/video/[/url][/QUOTE]
I've had so many problems with video.js o.o
Managed to get it pretty much how I want it, but it keeps pulling up the video controls with every little distraction (volume change, steam PM etc.) [url]http://animetwist.net/anime/infinitestratos/1[/url]
I realized i wanted to finish this to replace my assignment notebook
[t]http://i.imgur.com/nwcRCPb.png[/t]
[url]http://jung3o.com/doForget/[/url]
It's usable atm, but still thinking if I should make this so people can login and actually be able to access their todo list.
right now it uses localstorage
[editline]25th September 2013[/editline]
fucking cursor.
i made a thing, you should see it in action!
[hd]http://www.youtube.com/watch?v=31xSuHEdNbU[/hd]
Got fed up of having to remember my position in podcasts that I listen to, there are some apps already but none have a web front-end or a desktop application. So I made myself a small application using Node as the backend.
[IMG]http://puu.sh/4AJq3.png[/IMG]
It runs on my pi, downloads the new episodes when available and syncs them to my devices when I open the web page in a hacky kind of way.
Gonna make a mobile app because chrome refuses to run javascript when the phone's screen is off so it doesn't update the progress.
Also used it as an excuse to learn SASS, all the colors on the page are defined from one base color so I can change the theme when I get bored.
[B][I]FUUUUUUUUUUUUCK YES![/I][/B] Just landed the first iteration of a big project with an awesome freelance client. It's a local place that does summer camps for kids and adult classes for wilderness survival (hunting, foraging, homesteading) and archery and bowmaking and blacksmithing and stuff like that. I'm initially helping upgrade/build out their class registration system but it's going to evolve into something really cool in the future (but I can't talk about that yet)
This is the first freelance work I've been interested in for a while and I quoted a lot higher than I did the last time I did freelance work and they went for it without missing a beat. I also quoted hourly instead of fixed bid, which is new for me. I used to always do fixed bid unless it was contract work for other agencies. I'm definitely confident that I'm worth the higher rate, but I was reaaaaally unsure whether they'd think so too.
Also kind of funny thing about this one.. I've only shown them one thing I've built and it was just a quick view of the homepage for the company I'm working at now. My portfolio isn't even live right now so I know they haven't seen that. Goes to show that if you make a point of getting to know your client and their business and business problems you can prove that you know what you're doing without them seeing work yet!
Opinions?
[t]http://puu.sh/4ARVt.png[/t]
[QUOTE=Dorkslayz;42317253]Opinions?
[t]http://puu.sh/4ARVt.png[/t][/QUOTE]
no stack trace?
or filename and line number?
[QUOTE=KmartSqrl;42317311]no stack trace?
or filename and line number?[/QUOTE]
It's was more focused at the end user, not developers. It's just to kinda let the user know that something's gone wrong I guess.
[QUOTE=Dorkslayz;42317469]It's was more focused at the end user, not developers. It's just to kinda let the user know that something's gone wrong I guess.[/QUOTE]
You should [I]never[/I] expose implementation information to end users in error messages.
1) No one using your product is going to understand or care what class or function or any of that means in the error message. They just want to know something didn't work and what they should do about it.
2) You run the risk of revealing sensitive information. Who knows what other libraries you're using are going to show in their error messages. You might reveal API keys or passwords on accident.
I'm afraid it will just confuse users further. All you need to do is notify that something didn't work, and provide is a way for them to get back to the homepage/try the process again.
[editline]26th September 2013[/editline]
Rate clocks
Sorry, you need to Log In to post a reply to this thread.