Getting info into a Object..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Timo J

    Getting info into a Object..

    Hi - Im sitting and trying to understand this OOP - and need to create a
    class wich can do the following..

    ShowBlocks() - Displays the data wich is inside it - If empty creates a form
    wich sends the info back to the Object, wich show the stuff..
    AddBlock( $type ) - Creates an empty blok - wich is addet to a blocks area
    object...( Or somethin like it )
    Store() - safes the info into a file, and updates mySQL...

    I have figured out most of the stuff but the way to get the empty block ->
    creating form with some different strings/textbloks and a file -> putting
    stuff into object -> now showing what its looks like and aking if i want to
    add a extra block....... now showing x blocks then asking if i want an extra
    block - i haven“t got a clue of how to do it !

    Does anyone of you have an example with an object thats goes : See im a
    empty object -> here you can put an line into me -> see im not empty now (
    showing the string) do you want to add an extra line ? - ect ect..

    In Advance Thanks !


    Timo.


  • Henk Verhoeven

    #2
    Re: Getting info into a Object..

    Timo J wrote:[color=blue]
    > Does anyone of you have an example with an object thats goes : See im a
    > empty object -> here you can put an line into me -> see im not empty now (
    > showing the string) do you want to add an extra line ? - ect ect..[/color]

    Timo,

    I do not really understand the rest of your mail, so i will just try to
    answer this last question. Yes, we have objects that output a list and
    the user can click a button to add another line. So far it seems what
    you are looking for.

    But our lines represent objects retrieved from the database. SO if the
    user clicks 'Add', he gets a different form that represents the new
    object. He fills out the form, then clicks the 'Create new' button and
    the object is created, validated and stored in the datbase. If he then
    clicks the 'Context' button he gets back into the list, which has a new
    line that shows the object's "label". If he clicks on that line he gets
    back to the object form that now has a 'Update' button so that he can
    modify the object. It seems to me that this is much more then what you
    are trying to do.

    Assuming you just want an object with text lines, i would do the following:
    - create an empty object and let it produce the form. It should put 'Add
    line' submit button in the form.
    - If the user clicks the 'Add line' button, the form is submitted. The
    script then recreates the empty object from the form.
    - The object checks the $_RREQUEST and finds out that the 'Add line'
    button has been pressed and adds an empty line to itself.
    - The objects outputs its form as usual. As there is an empty line in
    the object the empty line will also be in the form.
    - The user fills out the line. Whatever button (except for a cancel
    button) he presses the new line goes into the object and may be saved
    into the database or so.

    Is this what you wanted to do?

    Greetings,

    Henk Verhoeven,


    BTW, for the user it might be nice to have a javascript add the line to
    the form without needing the server, but that has little to do with OOP.

    Comment

    • Timo J

      #3
      Re: Getting info into a Object..


      "Henk Verhoeven" <news@metaclass REMOVE-THIS.nl> skrev i en meddelelse
      news:bu0fa1$dea $1@news1.tilbu1 .nb.home.nl...[color=blue]
      > Timo J wrote:[color=green]
      > > Does anyone of you have an example with an object thats goes : See im a
      > > empty object -> here you can put an line into me -> see im not empty now[/color][/color]
      ([color=blue][color=green]
      > > showing the string) do you want to add an extra line ? - ect ect..[/color]
      >
      > Timo,
      >
      > I do not really understand the rest of your mail, so i will just try to
      > answer this last question. Yes, we have objects that output a list and
      > the user can click a button to add another line. So far it seems what
      > you are looking for.
      >
      > But our lines represent objects retrieved from the database. SO if the
      > user clicks 'Add', he gets a different form that represents the new
      > object. He fills out the form, then clicks the 'Create new' button and
      > the object is created, validated and stored in the datbase. If he then
      > clicks the 'Context' button he gets back into the list, which has a new
      > line that shows the object's "label". If he clicks on that line he gets
      > back to the object form that now has a 'Update' button so that he can
      > modify the object. It seems to me that this is much more then what you
      > are trying to do.
      >
      > Assuming you just want an object with text lines, i would do the[/color]
      following:[color=blue]
      > - create an empty object and let it produce the form. It should put 'Add
      > line' submit button in the form.
      > - If the user clicks the 'Add line' button, the form is submitted. The
      > script then recreates the empty object from the form.
      > - The object checks the $_RREQUEST and finds out that the 'Add line'
      > button has been pressed and adds an empty line to itself.
      > - The objects outputs its form as usual. As there is an empty line in
      > the object the empty line will also be in the form.
      > - The user fills out the line. Whatever button (except for a cancel
      > button) he presses the new line goes into the object and may be saved
      > into the database or so.
      >
      > Is this what you wanted to do?[/color]

      Well more or less..

      Just to claryfy what i specifik is trying to do :

      Create a object - wich create a form with the following blank inputfields
      ( Title, tekst, a link, a picture ) - The user haves two choices

      1 ) fill out the form and submit it - wich results in a new page with the
      info, nicely set up - with a button for saving the article, and a button
      wich adds a new textblock of diffferent type containing ( subtitle , text ,
      picture ) - if he adds a new textblock the object shows any previous objects
      and creates a form with the info for the new text block and so on...

      2) Add textblocks - the user selects additional textblocks or deletes
      textblocks until he thinks the layout is nice and then fill out the createt
      form containing all textblock mondules...

      My idea is to create a object and create an array to store the objects
      before being processed - eg. uploading the files/pictures - generating a new
      filenames, wich all are compressed to one HTML file and stored on the disk
      or in a MysqlDB - and in this way creating a way for easy creating
      artickles, storyes with or withou pictures for my website about diving.

      I have the following problems :

      Creating the object wich can do the above.
      Uploading a picture - resampling it to a specifik size, storing it under a
      new name ( lastfile number++).
      File manipulation - some examples.. my book isent very good on that point..

      Well thats about it.... Im a little stressed this month during my exams, and
      not getting done anything on my website is realy anoying, so just to get a
      little help to do create something or something to work with - to feel that
      im doing something on the website is a true blessing.

      Thanks !

      Timo.
      [color=blue]
      > BTW, for the user it might be nice to have a javascript add the line to
      > the form without needing the server, but that has little to do with OOP.[/color]

      Will it be a better way useing javascript ? Im not the champ on that
      either..


      Comment

      Working...