Announcement

Collapse
No announcement yet.

An American Cares

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • An American Cares

    An American Cares

    I need some help. I have some early legistative interest stirred up for an idea I have. Essentially what it is is a program where the US Post Office would sell prepaid boxes for sending stuff overseas to needy families/institutions (Akin to the CARE Package program for Europe after WWII). You can see more details here http://www.AnAmericanCares.com/History . (To get an idea of what follows you will need to read the link.)

    Having some background (and contacts) in the legislative arena (I did quite a bit of intensive citizen lobbying some years back) I believe this idea has a good chance of success. However my experience tells me that a selling point is going to be a demonstration website. And here's where I need the help.

    I can see in my head what is needed at this point. If it were a PB program then it would be no problem but doing it in HTML is beyond my skill level. If I could run a PB program instead of an html web page it would be terrific. Is such a thing possible? If so could someone provide an example of how to do it?

    At this point what I need help with is:

    1) loading an array of data items into an Option box. (see http://www.anamericancares.com/Choose_Destination.html for two sample Option boxes I set up). The data in these choice boxes (and there will be several more than just these) will be dynamic in that there will likely be additions/changes to the lists occasionally and the lists will be used in several different html pages. It's just not practical to edit each page every time a list change will be made.

    2) On the left side of the pages you see a Links list (using CSS sheets). Is it possible to load a file into a CSS sheet? (in this case one file would serve many different pages). I could then do the same thing loading data into TextAreas, for example.

    I will need help with a LOTS of things with this website (promoting AAC down the road) BUT AT THIS STAGE these are the two things I need most. If any can help, it's a worthwhile endeavor (no money in it for anybody anywhere though, all strictly volunteer stuff).

    Note, while I have no real Java Script experience, I have used it on a Cut&Paste level making minor alterations to get various JS code snippets to work. I suspect something like JS is going to be needed here. Again a PB executable would be absolutely super but probably not possible.
    It's a pretty day. I hope you enjoy it.

    Gösta

    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

  • #2
    Gösta,

    Don't let HTML intimidate you. Its really not that hard to do. You can incorporate PB, but the output from your PB program has to be HTML, which is nothing more than text with special formatting codes added in.

    I would recommend you start with wysiwygwebbuilder. There probably isn't an easier way to create decent looking pages. Then you can add pb programs behind the scenes to fill combo-boxes, update fields, rotate graphics, just about anything you need.

    I actually started a tutorial here some time ago on how to use PB to create HTML output. I had intended to expand on it more, but got sidetracked on another project. However, if you look it up, I think you'll see how easy it actually is.
    Software makes Hardware Happen

    Comment


    • #3
      >>>...PB program instead of an html web page it would be terrific. Is such a thing possible? ...<<<

      Possible, yes, (in a manner of speaking).

      I asked the same question a while back and the short answer is that the user would have to download the .EXE program. AV's might not like that.
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.

      Comment


      • #4
        Joe,

        Don't let HTML intimidate you. Its really not that hard to do. You can incorporate PB, but the output from your PB program has to be HTML, which is nothing more than text with special formatting codes added in.
        HTML does not "intimidate" me. I've been using it for at least 12 years, not very fluently maybe, but ...


        I would recommend you start with wysiwygwebbuilder. There probably isn't an easier way to create decent looking pages. Then you can add pb programs behind the scenes to fill combo-boxes, update fields, rotate graphics, just about anything you need.

        I don't want to use any web building software (too limiting at this point). And Appearance is not what I'm after (again at this point). What I need is a working demo prototype to display functionality (at this point).

        Once the functionality I think is needed can be demonstrated, then someone/others far more proficient/talented than me can build the front end appearance stuff (eye candy).

        What would really help, if you really think wysiwygwebbuilder is the way to go, is build a webpage to look like http://www.anamericancares.com/Choose_Destination.html using PB to fill in the Option blocks, then post it on your website or sendme the code to try out.

        I actually started a tutorial here some time ago on how to use PB to create HTML output. I had intended to expand on it more, but got sidetracked on another project. However, if you look it up, I think you'll see how easy it actually is.
        I've done that before, outputting data with html coding using PB to generate the code. That not what I'm after here, nor what I asked for help on.


        Mel,

        DL'ing an exe isn't a viable option for this project. What I need to do is access a database (or files) dynamically. Once established I don't see the files changing often but there will be several different pages accessing them so it's not practical hard coding the data into each page

        I asked specifically for help with two things (at this point): (see above post for more details)

        1) loading a file into a CSS sheet.

        2) loading a file (array) into an option box.

        Actually writing this reply, it occurs to me is that what I want (in PB principle) is to have "Include" files to use when a page loads.

        For example, here is the code on the "Choose" page:
        <form method="Post" Action="Mailto:me">
        World Areas:
        <Select Name="World_Area" Size="1">
        <Option Select>
        <Option>Africa - East
        <Option>Atlantic Island
        <Option>Caribbean
        <Option>Africa - West
        <Option>United States
        <Option>North America
        <Option>Europe
        <Option>Eastern Europe
        <Option>Latin America
        <Option>Southeast Asia
        <Option>East Asia
        <Option>Oceania
        <Option>Russia
        <Option>Kazakhstan
        </select>
        </Form>
        <form method="Post" Action="Mailto:me">
        Countries:
        <Select Name="Country" Size="1">
        <Option Select>
        <Option>India
        <Option>Pakistan
        <Option>Afghanistan
        <Option>Sri Lanka
        <Option>Myanmar
        <Option>Maldives
        <Option>Lebanon
        <Option>Jordan
        <Option>Syria
        <Option>Iraq
        </select>
        </Form>
        Functionally what I'd like to do is:


        <form method="Post" Action="Mailto:me">
        World Areas:
        <Select Name="World_Area" Size="1">
        <Option Select>
        <Load "../DB_Files/World_Area_Options.txt" >
        </select>
        </Form>

        <form method="Post" Action="Mailto:me">
        Countries:
        <Select Name="Country" Size="1">
        <Option Select>
        <Load '(Approriate Countries file based on World_Area choice)'>
        </select>
        </Form>
        (Note I know the POSTing action is not correct, but okay for now).

        As I said before maybe the above could be done with Javascript, or maybe CGI, I just don't know. Posting a snippet demonstrating an example of either that I could just drop into the html to test would be super.

        When replying with help please keep in mind the object of this project (outlined in http://www.anamericancares.com/History ). Thanks.
        Last edited by Gösta H. Lovgren-2; 8 Dec 2007, 09:02 AM.
        It's a pretty day. I hope you enjoy it.

        Gösta

        JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
        LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

        Comment


        • #5
          To better demonstrate what I am looking for (at this point), take a look at:

          http://www.anamericancares.com/Choose_Destination.html

          I really appreciate any help any offers. Again demo code snippets that can be dropped into html code for demo are REALLY appreciated.
          It's a pretty day. I hope you enjoy it.

          Gösta

          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

          Comment


          • #6
            Gösta,

            what you are looking for is called AJAX, there are many examples in this (internet forum), also search for "XMLHttpRequest"

            also http://w3schools.com has some good examples,
            Last edited by Brad D Byrne; 8 Dec 2007, 08:14 PM.

            Comment


            • #7
              here's one of the better tutorials,

              http://www.xul.fr/xul.html

              the site leans towards XUL (which you might not want) but the AJAX stuff is focused on XML as well as XUL

              Comment


              • #8
                Thanks Brad. I'll look into it maybe tomorrow. I have done some parsing of XML in PB so that experience will give a little headstart (I hope).
                It's a pretty day. I hope you enjoy it.

                Gösta

                JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                Comment


                • #9
                  Originally posted by Gösta H. Lovgren-2 View Post
                  Joe,
                  HTML does not "intimidate" me. I've been using it for at least 12 years, not very fluently maybe, but ...
                  Ok, then I mis-understood your original comment:
                  I can see in my head what is needed at this point. If it were a PB program then it would be no problem but doing it in HTML is beyond my skill level. If I could run a PB program instead of an html web page it would be terrific.
                  What would really help, if you really think wysiwygwebbuilder is the way to go, is build a webpage to look like http://www.anamericancares.com/Choose_Destination.html using PB to fill in the Option blocks, then post it on your website or sendme the code to try out.
                  Not sure what "way to go" means here, but it was only a suggestion. I'm sorry if my ideas wasted your time here, I was just trying to provide some options based on my understanding of what you were asking. Building an option block in PB code and spitting it out to HTML is no big deal, but I guess that's not what your looking to do.
                  Software makes Hardware Happen

                  Comment


                  • #10
                    Gösta, a couple notes,

                    first many of the ajax examples you will find might no longer work, because the newer browsers have stopped supporting "cross-site scripting" for security reasons, so in other words your ajax stuff can only access files from the same domain that requests the files, no problem for what you want to do, but for many of the examples you might get a "permission denied"

                    also, a lot of what you are trying to do doesn't necessarily need ajax, it's just a faster way to get the pages loaded,

                    here is a good site for css/dhtml/javascript etc.

                    http://www.huntingground.freeserve.c...n/mainfram.htm

                    the way he builds his pages can be confusing to get the actual source of the examples so I pulled one out for you here,

                    http://www.intelifaqs.com/test/DatabaseExample.html

                    that example is only dhtml, no ajax

                    but it might help show what can be done, (maybe only use ajax for the discriptions)

                    also, look thru huntingground, it has a lot of good examples!

                    Comment


                    • #11
                      Here's a very clean example from Apple's development site:

                      http://developer.apple.com/internet/...e/example.html

                      It uses an XML datasource, and some javascript classes to load the data into the combo boxes.

                      FWIW, you're probably going to want to go with PHP or RoR with a MySQL database to get this done quickly and easily.
                      --pdf

                      Comment


                      • #12
                        Originally posted by Paul Franks View Post
                        FWIW, you're probably going to want to go with PHP or RoR with a MySQL database to get this done quickly and easily.
                        Paul's 100% right there!!

                        to do everything you will want to do with this type of a project, it will take a lot of time, especially since you are a beginner at this. the CMS frameworks such as RubyOnRails, Joomla etc, already have a ton of scripts and tools written to do exactly what you want. with one you could likely have a site 100% running in a couple weeks, else it could take you months,

                        RoR uses ruby which is similar to perl, which is confusing to interface to powerbasic imo, whereas a PhP based site is easier (close to PB syntax)

                        Joomla is probably the easiest to get going

                        also, Paul's Apple example is very good! if you go that way use the Apple way!
                        Last edited by Brad D Byrne; 9 Dec 2007, 09:54 AM.

                        Comment


                        • #13
                          Gösta,

                          Ok, I think I understand what you're looking to do. Here are the pertinent code snips I use for "AJAX" like functions on some of my web pages. Basically, when a web element triggers an event (button clicked, etc) the java script below executes a PB executable on the server that creates some output text and displays it in the existing HTML page, no need to reload the page, the parameters can be changed so the displayed items represent whatever data the customer is looking for, etc.

                          Paste this in the <Head> section of the web page:
                          Code:
                          <script TYPE="text/javascript">
                          	
                          function displayResult(){
                          var v=document.frames['result'].document.getElementById('returned').innerHTML;
                            document.getElementById('rDiv').innerHTML=v;
                          }
                          </script>
                          Then, where you want the output from the PB program to be displayed, add this line in your HTML page:
                          Code:
                          <div id="rDiv"></div>
                          Now you can call your PB app either from a standard form, or using SSI, or any other way that works to execute a server app for you. The PB code does its thing like any other CGI app, but put this in at the beginning of the output:
                          Code:
                          WriteCGI "<html><body>"
                          WriteCGI "<span id='returned'>"
                          Then output whatever text you want, be it a combo box, text, whatever. Then end the output with:
                          Code:
                          writeCGI "<script type='text/javascript'>"
                          writeCGI "  parent.displayResult();"
                          writeCGI "</script>"
                          writeCGI "</body></html>"
                          In the PB examples above, I'm referencing the writeCGI function found in PBCGI.INC that comes with PB/CC. You can also use the PBCGIBOTH.INC file (located in the source forum) if you're using PB/Win.

                          Basically, you can duplicate the above java script and PB program to create very interactive web pages that never need to be 'refreshed' in the traditional sense. This gives you get flexibility to use PB for all the grunt work while keeping you web pages very user friendly and easy to use.

                          Hope it helps.
                          Software makes Hardware Happen

                          Comment


                          • #14
                            Gösta,
                            There are lots of ways to do what you want, I do things like that every day with PBCC and javascript. It can be done with Ajax or even dynamically loaded stub files.

                            What kind of web server are you running?
                            Where do you want to create and maintain the list the fills your select boxes? In other words, will the list contents be maintained via a web form, or a local application? Same question for your CSS file.

                            If I knew those two answers, I could show you sample code.

                            In PBCC you simply write the external CSS file and save it on your web server. When the page loads it will use the CSS file that your program wrote.

                            Comment


                            • #15
                              Actually, this has the makings of an interesting discussion!

                              Paul's Apple example is cutting edge DOM/XML stuff, if you look at the file http://developer.apple.com/internet/...mple/songs.xml

                              one of the selections from the combo box, you will get an rss xml feed, (am I saying that properly?)

                              and then if you look at the source you will find the "details to be displayed" data in the <content:encoded><![CDATA[ tags,

                              IMO, this is a very inefficient way to do this! (am I wrong?)

                              now I understand that xml feeds are where the net(web2) wants to go, primarily for hand held device support (correct?)

                              but, it sure seems like a lot of unnecessary work???

                              maybe that is where JSON will prove over,

                              anyway, not to confuse things, just kindda wanted Paul's, Shawn's, anyone else's ideas on this,

                              Comment


                              • #16
                                Joe,

                                Joe, Thanks the tips. I'll play around with them tomorrow. But I am beginning to suspect what I want to do is above my current skill levels. What I am probably going to have to do is abandon the demo website idea, unless someone(s) who can do it will step up and volunteer to do the webpage (Should only be one page that really needs these advanced features. At least as I envision it.).

                                If the An Anerican Cares idea takes off (my experience plus feedback from people who are even more familiar with the federal political process are quite encouraging) then it will take several volunteers to maintain it. Though as I envision it, maintenance can probably be mostly done with PB adding/deleting entries offsite and uploading data files to the server. But I'm getting way ahead of myself here. First things first.

                                As for me, at this point, learning a new laguage (Ajax, JavaScript, DOM, ... whatever), for any of several very good reasons, just isn't practical or reasonable for me, or this project. (Please don't ask me to list them here, just accept what I say as reasonable on this subject.)

                                I see a (working demo of) AAC (maintained by volunteers) as an integral important part of selling AAC politically (see the "Christine" references in the AAC History http://www.anamericancares.com/History.html). Else there is a real danger of it getting enmeshed in partisan politically correct politics and bureaucratic "syrup". Even getting subverted.

                                I'm hoping others will see AAC as a good thing for America and help getting it started. There's an awful lot to be done. The demo website is only a part of what needs to be done, I think an important part, but pretty clearly it's beyond me.
                                It's a pretty day. I hope you enjoy it.

                                Gösta

                                JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                                LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                                Comment


                                • #17
                                  Gösta,

                                  I don't want to discourage you from your project in any way, actually I think it's a Great Idea!

                                  I have been studying web programming as well as social & economic development platforms for near 3 yrs now, and honestly it's hard to keep up with the new technologies, which change and develop daily, every day a new widget of some sort comes out, usually with it's own api and structures, as often what is the best thing in the world today will be obsolete in 6 months!!

                                  so writing something complex with cross-browser support is really a job, though getting easier since w3c standards were defined.

                                  anyway, here's a first take of your project,

                                  A) first you need the menuing/paging architecture/system in place, (pretty easy)

                                  B) then you will need a way to allow users to add new projects to receive the gifts

                                  C) then you will want to rate or qualify those beneficiaries, for some may be scams

                                  D) you will also want a virus free login system

                                  E) you will want to eventually provide dynamic tools for users w/o any coding experience to be able to make an on-line presentations

                                  F) then if you get popular and get traffic, you will need caching/balancing etc.

                                  G) etc, etc, it will grow pretty fast


                                  anyway, Joomla, Drupal & RoR were built to provide these things, they are open-source and have a zillion people adding new tools daily, which helps in some ways, but also creates more piles of stuff to have to sift thru,

                                  learning how to do it from scratch is a good learning experience, but it really is complicated, for bigger projects like you are under-taking,

                                  Joomla is the easiest imo, you can have a site up in a couple weeks,

                                  anyway, I have been building my own CMS, it has a pretty **** good wysiwyg editor which also supports floating css, namespaces, and antialiased cross-browser graphics, etc. imo the hardest part is done, I just now need to finalize my database structuring and integrate it all together, the purpose is for a social & economic development platform, as well as a publishing framework, I might have the beta up in 2-3 more months, if you havn't done anything by then and I do it going, I will be happy to host your project,

                                  otherwise,I suggest to try out Joomla, it has a lot of things right out of the box, is easy to use, (just hard to customize! hehe, but you may not want any customization) here's a site a friend of mine built using Joomla in less than a week I believe http://mixedmedia.us/peacetiles/

                                  Comment


                                  • #18
                                    Originally posted by Shawn Anderson View Post
                                    Gösta,
                                    There are lots of ways to do what you want, I do things like that every day with PBCC and javascript. It can be done with Ajax or even dynamically loaded stub files.
                                    Other than snipping JS routines (and minorly manipulating them) , my only experience is HTML. I don't know how to load a file into a web page from the server.


                                    What kind of web server are you running?
                                    AAC is on BraveNet (host?). I upload webpages via FTP. Don't really know what kind of server it is. Suspect Linux. My own websites (Swedes Dock, Ponder's Bible) are on a Linux server at Exit109.com.

                                    Where do you want to create and maintain the list the fills your select boxes? In other words, will the list contents be maintained via a web form, or a local application?
                                    Okay. Let's see if I can explain it more clearly. If you look at http://www.anamericancares.com/Choose_Destination.html there are 5 lists. (Please note I only put this page up to demo the principle of what I think is needed. The actual page does not have to look like it and in the final version there could be more/less/different lists.)

                                    Someone chooses a World Area. Based on which World Area, he then selects from the list of Countries in that World Area (which are based on the World Area chosen obviously), then selects a region of the Country selected, then selects the Organization Type, then selects from a list of Organizations that fit the criteria from the other list boxes.

                                    Based on the above selections, a description of the Organization shows in the bottom CSS section.

                                    How I envision it in PB terms is a large flat file (similiar to, or even in, XML format) sorted by World_Area, Country, ... that is accessed based on the choices. It doesn't even have to be one file. There could be a file for each Selection.

                                    Now after the person has the Organization he wants, he clicks an option that displays a(nother) page has even more data about the Organization (address, needs, etc.). When he is satisfied he clicks an "Email Info to Me" button.

                                    I hope that better conveys what I'm after.

                                    Same question for your CSS file.
                                    All I want here is to be able to maintain one "Links" file that would be displayed in the LeftHand CSS sheet(which would be the same for each web page). I see the website having several (maybe dozen?) of static pages and would like to maintain the same links list on each page. If you could post a snippet of how I can load a file from the server into a CSS sheet, it would be a BIG help.


                                    If I knew those two answers, I could show you sample code.

                                    In PBCC you simply write the external CSS file and save it on your web server. When the page loads it will use the CSS file that your program wrote.
                                    That's exactly what I want and don't know how to do. I mean I can write the file okay {laugh} (I think). I just don't know how to load it into a CSS sheet.
                                    It's a pretty day. I hope you enjoy it.

                                    Gösta

                                    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                                    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                                    Comment


                                    • #19
                                      oh also, to answer an earlier question about reusing external css and js files,
                                      just use link & src like the following in the head section,

                                      Code:
                                      <head>
                                      <link rel="stylesheet" type="text/css" href="http://intelifaqs.com/mycssfile.css" >
                                      <script language="javascript" type="text/javascript" src="http://intelifaqs.com/myjsfile.js" ></script>
                                      
                                      </head>

                                      Comment


                                      • #20
                                        ...Suspect Linux
                                        well that puts a damper on it from a PB perspective. For database interaction, you'll need to use something like PHP, which I'm no help with.

                                        I think I understand your principle now of how it should work.

                                        Let me ask you this: are the select lists going to change often, or will they be the same most of the time? I understand that the value of select A will change the options for select B, etc.

                                        If once all the possible base values are input, and they won't change often, I could do all of the select boxes with just javascript. Once all the choices are made and you need to call information from a database, you'll need to use something besides PB if you're on a Linux server.

                                        Comment

                                        Working...
                                        X