SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast vworld's Avatar
    Join Date
    Nov 2000
    Location
    West of Colorado Springs
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We have a tool we use to create a daily news feed for our site. Now I would like to be able to allow our users to submit their news items via the web page but don't want to recreate the wheel so to speak and would like to integrate what we already have for this purpose.

    However, the challenge becomes how do I add approval settings to the incoming records from users......I know it can be done but I haven't been able to find anything on how to do this...any help or advice on where to find an answer would be greatly appreciated.

    I'm still on my search for an answer....but thought I would throw it out here to see if anyone else has already solved the challenge.

    Thanks in advance,

    V

  2. #2
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is your current TABLE setup? Colums.... etc...

    Give me an I idea and I'll see what I can do.
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding a new column to your table with this SQL command:

    Code:
    ALTER TABLE table_name ADD COLUMN approve ENUM("No", "Yes");
    Now, if I'm remembering correctly, this should give all entries a default value of "No." You might need to add "NOT NULL" near the end there though - I'm having trouble remembering if it's needed or not.

    From that point on it's just a matter of creating a simple script that only you have access to to display each record with "No" in the "approve" column, and creating a simple radio button next to each. The ENUM column type makes sure that any entry into the field other than "Yes" or "No" will be ignored.

    Then, when you want to display all APPROVED news stories, instead of using something like this...

    Code:
    SELECT * FROM news;
    ...you would use this...

    Code:
    SELECT * FROM news WHERE approve='Yes';
    Good luck!

  4. #4
    SitePoint Enthusiast vworld's Avatar
    Join Date
    Nov 2000
    Location
    West of Colorado Springs
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    exbabylon, here is the current table structure:

    TABLE dailynews (
    id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
    category int(10) unsigned,
    url varchar(150),
    headline varchar(250),
    newsdate date,
    source varchar(255),
    content text,
    description text,
    PRIMARY KEY (id)
    );


    TWTCommish,

    Thanks for your suggestion....I'm gonna try adding the column to a "dummy" table and see if I can get it to work. .... I'll let you know if it works and post it in case someone else runs into the same challenge =-)

    Regards,

    V

  5. #5
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    go with what commish said... it'll do what you want it to.
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •