Jump to content

approval comments


OLM3CA

Recommended Posts

hi i would like to ask a question.
I have a link submit form. Firstly I want to see the submitted links and than if its ok,I want to approve it and let it display in homepage.I mean the posted links can not be displayed,if I dont approve it.How can I do this ? i have some thought some ways but confused.Store them in a table like temp table and then transfer them to my real table ?

and I have another question.I want to show the catagories (no problem with this) and then show the links that is related with that catagorie.Is this correct ??? How can I jump from catagories to Links table.

[color=red]create table Catagories[/color]
[color=green]cat_id  (key)
catagory_name[/color]

[color=red]create table Links[/color]
link_id (key)
[color=red]cat_id[/color]
link_title
link_url
link_desc

I am sorry for my english.
Link to comment
Share on other sites

This should be a fairly simple fix for ya = )

Add a new field to the links table that has `status` with a default of 0.  When someone submits a new link it will automatically take on the status of 0.  When you authorize the link, it can update the field to 1.  When you query your links, just show only the links that are equal to 1.

As for the categories -> links question, do something like this.

[code]
<?php
$sqlCategories = mysql_query("SELECT cat_id, category_name FROM categories ORDER BY category_name ASC") or die (mysql_error());
while ($Category = mysql_fetch_array($sqlCategories)) {
  $sqlLinks = mysql_query("SELECT link_id, cat_id, link_title, link_url, link_desc FROM links WHERE cat_id = $Category[cat_id] AND status = 1 ORDER BY link_title ASC") or die (mysql_error());
  // You can output your categories here
  while ($Links = mysql_fetch_array ($sqlLinks)) {
    // output your links here
  }
}
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.