Updates from Joel L Toggle Comment Threads | Keyboard Shortcuts

  • Joel L 15:13 on May 25, 2011 Permalink |  


    Assumption: you finished your calculator test like you all promised, and understood everything you created.

    The basis of the calculator task was:

    1. Create a form
    2. Upon submitting the form, do something with the submitted data (value in text input)
    3. Do something based on the calculation result from step 2. (i.e. show result to user)

    Silver’s question below asks how to:

    1. Create a form (name, email, password)
    2. Opon submitting the form, do something with the submitted data.
    3. Do something based on the result from step 2. (ie. Show “Account created!” message or “Error!” message)

    The Google Docs link I posted last Thursday (http://fkingtiny.com/59) shows how you can save data using the API, given the data from a submitted form.

    Step 2 is $save = $API->user_save([DATA FROM _POST])
    Step 3 is if ($save[‘status’] == ‘ok’) { OK MSG } else { ERROR MSG }

    • Joel L 15:37 on May 25, 2011 Permalink | Log in to Reply

      It is about time for you to understand that if you want to accomplish something, you have to sit down and really think about the core principles of programming – 
      there’s a very basic logic behind everything, but most of you seem to want to Start Using Databases, without really understanding why and how.

      If you don’t agree, please explain how the above 3-step process is difficult to deduce.

    • Sander 18:14 on May 25, 2011 Permalink | Log in to Reply

      Would the code for saving ratings work pretty much in the same manner? Since its the only place I can actually put the API to use, I’m working on integrating the API with my ratings page, so that I might be able to save ratings. How do I shot web?

  • Joel L 14:32 on May 25, 2011 Permalink |  

    Have you all completed the “calculator” test/task?

    Share the results.

  • Joel L 13:15 on May 20, 2011 Permalink |  

    Please try to start working on your apps as soon as possible, and ask questions as soon as possible, so I’ll actually have time to answer them.


    Understand that when you ask something, I have to:

    • download and open your various files.
    • study your code and understand what it does
    • figure out answer
    • write answer

    Because there are 6 of you, and everybody’s code functions differently, I’m basically starting from scratch for every question.

    Well formulated questions are good, because
    1) easier to answer
    2) develop your brain


  • Joel L 06:24 on May 19, 2011 Permalink |  


    ~/Dropbox/[Folder you shared with me]/api/

    investigate index.php until 95% understanding is reached.

  • Joel L 11:05 on May 17, 2011 Permalink |  

    BB http://fkingtiny.com/52

  • Joel L 10:24 on May 17, 2011 Permalink |  

    Somewhat-sample of UX task 

    Home page

    • has top rated fridges (w/ their ratings). Why – these are probably high quality stuff, and appeal to most users.
    • can open each fridge to see contents and owner details. Why – too much info to fit on front page (into the top-rated list)
  • Joel L 10:01 on May 17, 2011 Permalink |  

    posted without comment


  • Joel L 08:43 on May 8, 2011 Permalink |

    RateMyFood, for Wednesday 

    By Wednesday 08:00 AM you will deliver to me your RateMyFood application.

    The UI must be feature-complete — i.e. no “Oh, I haven’t got around to adding x yet” things.

    Has all forms for data entry.
    Has links that take me from one page to another.
    Homepage is index.php

    Submit requests for help and clarifications before the deadline, not after.

    No USB sticks.

    • Paavo Viilup 19:13 on May 8, 2011 Permalink | Log in to Reply

      Make it so.

    • alex 18:04 on May 10, 2011 Permalink | Log in to Reply

      I have a two questions at the moment. My first question would be that in my index file I have the logged in function whether it is true or false. When it is true all of the pages can be accessed but when it is false then only the login and register pages are accessible. Now the problem is that when it is false and I want to display only the login and register pages then I want to do this without the navigation. At the moment when i turn it to false then the navigation is also there and is disturbing. I also shared the whole thing with you in dropbox if you want to have a look at it. The second problem is that on the so to say userpage when I want to go to the second page then it goes to the home page. I can’t seem to pinpoint the error. Maybe you can find it and tell me.

      • Joel L 18:14 on May 10, 2011 Permalink | Log in to Reply

        If you don’t want to show the navigation for non-logged-in users, just use:

        <?php if ($logged_in) { ?>
        # navigation menu
        <?php } ?>

        Remember, if statements have to be used whenever you want to show/change something based on some condition.

        “The second problem is that on the so to say userpage when I want to go to the second page then it goes to the home page.”

        What “user page”, what “second page”?

        Please use the names that you use on your php page, so I’ll understand a bit more! 🙂

        • alex 18:23 on May 10, 2011 Permalink | Log in to Reply

          I am not sure I understand the first solution in using a id for the navigation menu 😀 I know I am dumb 😀

          But the second problem is that on the webpage when you go to the friends frides page then by clicking on a friend it opens up the userpage or the friends fridge and on that page there is a button next to go to the second page. The first page is userpage.php and the second one is userpage2. I have referenced in userpage to go to userpage2 by clicking next but for some reason it takes me to home.php.

          • Joel L 18:30 on May 10, 2011 Permalink | Log in to Reply

            re: using #id – wordpress ate the php tags and I didn’t notice at first. Fixed now.

            re: userpage2 – you must add it to the $allowed_pages array.

            • alex 18:38 on May 10, 2011 Permalink

              K got it working thanks a lot, but is it okay or what is it lacking just to know what to add there or improve?

              Another question too. Is it possible to implement the code in a way that when somebody clicks on the login button and then gets logged in so that a person does not have to change the logged_in statement? Or is a database needed in order to do that?

              One more. As you have noticed that every item that you click brings you to a rating page. The only thing is that I have not figured out how to make it so that if you click on a food item then it takes you to that specific food item and lets it rate that. Basically only the picture and info have to change. Any ideas?

            • Joel L 18:59 on May 10, 2011 Permalink

              Well, does the page have all the functionality you want? For example, where’s the search results page?
              Is the food category menu always visible? Even on the login page? Why? Why not?
              Why are links in the My Friends table not identifiable as links? Why are the emails not clickable?

              If I click a category, what do I see? Are these food items in my fridge only? Or all fridges in the system? How do I know which?

              Just keep polishing existing functionality, don’t worry about login code yet.

            • Joel L 19:09 on May 10, 2011 Permalink

              Re: different food items – we’ll come to that later.

    • Sander 19:11 on May 10, 2011 Permalink | Log in to Reply

      Not wanting to keep my user pages as facebook pages, i started creating separate user pages. To access these pages, I need to perform arrayception. Namely, on the user page (not the wrapper anymore) i need to have another array of pages and some more PHP code. So how do i shot w- i mean, how do i get the pages to show up? Right now, I have Silver’s page in a separate users folder (the PHP actually works, go figure), but when i try to see his profile page, the home page is shown instead.

      • Joel L 19:20 on May 10, 2011 Permalink | Log in to Reply

        And where might I be able to see your code?

        • Sander 19:21 on May 10, 2011 Permalink | Log in to Reply

          It’s on my USB stick! (putting it on dropbox atm)

        • Sander 19:36 on May 10, 2011 Permalink | Log in to Reply

          Btw, the problem is most probably on the “friendz.php” page

          • Joel L 19:47 on May 10, 2011 Permalink | Log in to Reply

            If you go to ?page=friendz&user=Usersilver, then
            1. The friendz.php page is included
            2. The friends page includes the silver page.


            If the index.php page includes the friends page, and both start with , then the resulting page has a structure like:


            and this is… err, wrong.

            Please review the original sample I made.

            The pages that you include into index.php must only have the fragments that change, not the entire html page structure.

            • Sander 19:53 on May 10, 2011 Permalink

              Hmmm…so how bad is it if i leave in the facebook integration (for users) ?

            • Joel L 20:03 on May 10, 2011 Permalink

              integration == links?

            • Sander 20:07 on May 10, 2011 Permalink

              Pretty much, yeah. Or could i just copypasta a nifty facebook plugin of some sort?

            • Joel L 20:10 on May 10, 2011 Permalink

              First, make everything else work perfectly!

            • Sander 20:14 on May 10, 2011 Permalink

              What’s missing?
              Anyway, I’ve removed all of the unnecessary tags, but I’m still rather hazy on how to make the actual user specific page show up….

            • Joel L 20:19 on May 10, 2011 Permalink

              fixed it for you.

              $allowed_users vs $allowed_pages.

              i.e. if you copy-paste stuff, make sure to also change things…

    • Silver 15:26 on May 11, 2011 Permalink | Log in to Reply

      better late then never, right?

  • Joel L 07:46 on May 6, 2011 Permalink |  

    Easy Cloud 

    For those of you that don’t have Dropbox yet, create an account here: http://db.tt/jCagps2

    Then create a folder named ITGS + your name, and share it with me (joel.limberg@eesti.ee)

    And always put your whatever-homeworks there, because:
    a) no USB-stick juggling
    b) no I-left-it-home
    c) it’s the future.

    (Also, you don’t even have to install the Dropbox desktop app if you don’t want to. You can use just the website.)

  • Joel L 08:35 on May 1, 2011 Permalink |

    The partially php-ized site is here: http://fkingtiny.com/4x

    To reiterate – homework for next time is:

    make your site dynamic (has common “wrapper” (index.php), can switch between pages; has functional logged in/logged out states)
    also, improve the UI further

    and ask questions here, or in person, or via email, or via facebook, or whereever.

    Aim is to get your application into a state where it’s perfectly usable, only without actually showing or saving real data (that will come later).

    • Brent 20:31 on May 2, 2011 Permalink | Log in to Reply

      ma võtsin su koodijupikese, ja vaatasin saiti. Kui ma vahetan $logged_in = “false” —> “true” peale siis mulle tuli error, et sul on 52. rida vigane, seoses include($path), küsimus oleks siis, et miks?

    • Joel L 20:36 on May 2, 2011 Permalink | Log in to Reply

      Rida 43-44 ütlevad, et kui on $logged_in, siis luba lehed “‘home’, ‘my_ratings’, ‘my_settings’, ‘member_settings'”

      aga reaalselt pole ühtegi lehte peale home.php olemas, ja siis kui mingit mitte-home lehte üritad vaadata, ei leia ta soovitud (olematut) faili üles

      kui $logged_in = false, siis seda ei juhtu, kuna lubatud on ainult ‘home’, ja kood ei ürita kunagi ühtegi teist lehte include()-da

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc