SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member WaveLine Media's Avatar
    Join Date
    Jul 2003
    Location
    Olympia, WA
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation session associate...

    I have a link submission script I am working on. I have setup an editor section so that editors can login and add links to certain catergories of the site. What Im stuck on is how I can associate a certain editor with a certain category. ( I dont want any editor editing any link, only within their assigned category)
    I have it setup for the categories is that each caterory page is still on index.php but its index.php?cat=1
    cat=1 is the 1st category I created which is for example (ps tutorial sites)
    index.php?cat=1 will display all the links to tutorial sites that we have submitted.
    The editor edits the link live which mean they actually go to index.php?cat=1 (or whatever number)
    The script is all session based..so if they are logged in and a session has started session=(editor) they will see the options to edit a link.
    Anyways i want to associate an editor with a certain category (which is a number)
    I hope this makes sense...
    Thanks
    WaveLine Media - http://www.wavelinemedia.com
    Professional small business website design and developing

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WaveLine Media
    I have a link submission script I am working on. I have setup an editor section so that editors can login and add links to certain catergories of the site. What Im stuck on is how I can associate a certain editor with a certain category. ( I dont want any editor editing any link, only within their assigned category)
    I have it setup for the categories is that each caterory page is still on index.php but its index.php?cat=1
    cat=1 is the 1st category I created which is for example (ps tutorial sites)
    index.php?cat=1 will display all the links to tutorial sites that we have submitted.
    The editor edits the link live which mean they actually go to index.php?cat=1 (or whatever number)
    The script is all session based..so if they are logged in and a session has started session=(editor) they will see the options to edit a link.
    Anyways i want to associate an editor with a certain category (which is a number)
    I hope this makes sense...
    Thanks
    You have the categories in the database right? Then you could create a table which has the session id or name or however you store it, and then the categorie id, then you would simply query the database to see what categories the editor can edit.
    - website

  3. #3
    SitePoint Member WaveLine Media's Avatar
    Join Date
    Jul 2003
    Location
    Olympia, WA
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by website
    You have the categories in the database right? Then you could create a table which has the session id or name or however you store it, and then the categorie id, then you would simply query the database to see what categories the editor can edit.
    hmm Im still a newbie at php... Im trying to come up with the "correct code" on how to actually associate the section id to the editor id... I added another column in my database for the editors table which is (catid) That is the same column name as the category table for the category id... now how to i link the two in a sessions format?

    Thanks
    WaveLine Media - http://www.wavelinemedia.com
    Professional small business website design and developing

  4. #4
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, you do some queries and get the stuff out of the database and then you have some variable called perhaps $editor which is an array (of the columns/value from the database) of the current editor, am I correct?
    If so, you could propably do something like
    PHP Code:
    if ($editor['catid'] == $_GET['catid']) { 
      
    //user can moderate this category
      
    $moderate true;
    } else {
       
    $moderate false;

    Then if $moderate is true he can control it, else he can't...

    If it is still unclear can you please paste some code with the next reply? (the categories part of the script)
    - website


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
  •