1. Welcome to Baptist Board, a friendly forum to discuss the Baptist Faith in a friendly surrounding.

    Your voice is missing! You will need to register to get access to all the features that our community has to offer.

    We hope to see you as a part of our community soon and God Bless!

Database Script?

Discussion in 'Computers & Technology Forum' started by Don, Dec 27, 2003.

  1. Don

    Don Well-Known Member
    Site Supporter

    Joined:
    Oct 7, 2000
    Messages:
    11,048
    Likes Received:
    321
    Faith:
    Baptist
    Here's what I want to do:

    I want a list of links to stories and sermons. Preferably, the list is generated from a database table consisting of titles and stories/sermons (i.e., flat file system).

    Click on a link, and the story pops up.

    So far, I've tried ad management scripts, news scripts, FAQ scripts, and a few others, but haven't found anything that works like what I'm looking for.

    Any ideas?
     
  2. Brett

    Brett New Member

    Joined:
    Jun 25, 2003
    Messages:
    586
    Likes Received:
    0
    What language do you need it in? I'm quite "fluent" in Perl, and I wouldn't mind an opportunity to brush up on my Perl skills.

    How is the file organized? Is it something like this?

    (Title)|(Article)
    eg:
    "The Blessing in 'No'"|I asked God to take away my pride. God said "No". It is not for me to take away, but for you to give it up.

    Where the pipe is the delimiter? Give me some details on how it should be done and I think I could whip something up. [​IMG]
     
  3. Don

    Don Well-Known Member
    Site Supporter

    Joined:
    Oct 7, 2000
    Messages:
    11,048
    Likes Received:
    321
    Faith:
    Baptist
    Exactly.

    For an example of the stories, see www.ifbweb.com/ifb/s&s.shtml

    Those two categories are all that's required. Author can go with the story itself.
     
  4. Brett

    Brett New Member

    Joined:
    Jun 25, 2003
    Messages:
    586
    Likes Received:
    0
    http://btrost.cjb.net

    The "sermons.pl" file there is something I whipped up; hopefully it's close to what you want. It isn't pretty or anything. I'll leave that up to you.

    Anyway, the sermons.pl file is the actual script, and the sermons file (no extension) is the data file, which you can make, that includes the sermon title and the sermon delimited by pipes, with each sermon on its own line.

    This script should allow you to add sermons to the file without having to update your webpage everytime with the new link.

    The code for the script is as follows. You'll probably have to change the Perl path, and also the file name:

     
  5. Brett

    Brett New Member

    Joined:
    Jun 25, 2003
    Messages:
    586
    Likes Received:
    0
  6. Don

    Don Well-Known Member
    Site Supporter

    Joined:
    Oct 7, 2000
    Messages:
    11,048
    Likes Received:
    321
    Faith:
    Baptist
    Hey, Brett, thanks for the script. In the meantime, I found something that I'm modifying as I go through the programming (it's in PHP), that's along the lines of what I was looking for.

    It's called BMachine, and can be found at www.boastology.com

    Only problem is, it's sorting by post date instead of title, so I can't get it in alphabetical order yet. I haven't figured out which particular script is sorting and storing the files by posting date so that I can tweak it to sort by title.

    I'd also like to get it to print two or three columns, but I haven't figured out how to tweak the code yet for that. I could probably get it to do horizontal columns, but I'd prefer that it fill a table from top to bottom before filling in the next column. As I sit here thinking about it, perhaps creating and populating a table with only one column with multiple rows, then placing it side by side with other similar tables....

    This is what I'm seeing: www.ifbweb.com/ifb/bmachine
     
Loading...