473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to make moderation system in MySql? (For showing or not showing articles)

ilya Kraft
134 100+
Hello,

I am working on one interesting project. And I came over the following problem. I have form where users write articles and they than go into mysql database. I then want to display all articles on my website. The problem is that there are many spammers out there, so I need effective moderation system. So How can I make something effective and easy to use?
For example: I have bunch of articles in database and I look over them and choose ones that I want to display on my Homepage. So how to do that? How to have Moderation System?

Thank you and please Ask questions if you don't understand what I mean, because I really need to get this working as it is one of most important functions for my website.
May 9 '11 #1

✓ answered by nathj

Ok, the simple solution is for the table to contains a flag such as publish which is a tinyint and defaults to 0

When you receive an article you can check it and if it is good set the falg to 1. If you do not want to publish it leave it as 0.

Then in the code that displays the articles add where publish=1 to the clause.

You could also have a dispaly page which shows all articles to the moderators of your site and provides a checkbox to set this flag. But that is the a discussion on users and persmissions etc.

Hope this is enough to get you started.

If you get stuck with any specific post back and be sure to provide code snippets
Cheers
nathj

9 2652
nathj
938 Expert 512MB
Ok, the simple solution is for the table to contains a flag such as publish which is a tinyint and defaults to 0

When you receive an article you can check it and if it is good set the falg to 1. If you do not want to publish it leave it as 0.

Then in the code that displays the articles add where publish=1 to the clause.

You could also have a dispaly page which shows all articles to the moderators of your site and provides a checkbox to set this flag. But that is the a discussion on users and persmissions etc.

Hope this is enough to get you started.

If you get stuck with any specific post back and be sure to provide code snippets
Cheers
nathj
May 12 '11 #2
ilya Kraft
134 100+
Hi,

thank you for reply, this looks promising ))) Ok as far as I understood I will create additional field in my articles table with following options:

name: publish
type: enumu "1", "0"
Deafult: 0

right?
than I will have php condition like if publish=1 than display article else if show nothing, correct?

thnx ))) only asking this to make sure that I understood you right ))
May 12 '11 #3
nathj
938 Expert 512MB
Pretty close but I would make the field in the table a tinyInt not an enum. You only have 2 states and so a tinyInt works really well and makes for simpler code than an enum.

Cheers
Nathan
May 12 '11 #4
ilya Kraft
134 100+
Hi,

ohh why did I put enemu in ;D I was about to write tynyint. Ok i tried it out but something is not right. For values in the field do I put "0","1" ?
May 12 '11 #5
nathj
938 Expert 512MB
Hi,

TinyInt is a sort of integer so the values you need are 0 (not published) and 1 (publishe) no quotes needed as this is a numeric value.

Cheers
nathj
May 13 '11 #6
ilya Kraft
134 100+
Hi tried it out, I think I did not enter it right in MySQL, I set it up to smallint then for lenght/values I put 1,0 and then I put default to 0 am I right? what is the right way to enter information in field?
May 20 '11 #7
nathj
938 Expert 512MB
Hi,

sorry for the delay in replying - I've been on holiday.

If you set the field as tinyint you can manually set the values in the table as o for not published and 1 for published.

If you want to set it through the web front end then I suggest a checkbox is the control to use. If the checkbox is checked then set the value to 1 if it is unchecked set the value to 0.

I wuold suggest getting the manual version working so you are familiar with the datatype first.

What have you got so far? Is there a code snippet you are stuck with that you would like me to look at?

Cheers
nathj
May 23 '11 #8
ilya Kraft
134 100+
Hi,

thnx for great help ))) No I don't have full code yet, but I have things going good now ))) The bit I was stuck with was that I putted '0','1' for values, but I needed 0,1 I'll try to finish this moderation system this weekend ))) so If I have problems I'll ask you if you are not busy or something )))

Thank You )))
May 23 '11 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
0
by: Joseph Norris | last post by:
Group, I have been working with Mysql for about 5 years - mainly in LAMP shops. The tables have been between 20-100 thousand records size. Now I have a project where the tables are in the...
8
by: Nick | last post by:
I have the following code: var obj = {a:0, b:1, ...} function f() {...} obj.f = f // This will make a instance method? How to make a Class method for the class of obj? Or what's the...
7
by: Syed Zeeshan Haider | last post by:
Hello Experts, A friend of mine is trying to install VB.NET on WinXP 2002 SP1 but the installation wizard is asking for WindowsNT based system. What are the system requirements for VB.NET? Can't...
1
by: Juan Carlos Diez | last post by:
Hello, I'm evaluating that version and I can't find system requirements for it. Could anybody please help me with these questions? 1.1. Hardware: 1.1.1. C.P.U. (how many processors, what speed)...
3
by: felix.dorner | last post by:
Hi. I have problems validating the following document doc.xml using onsgmls. I call onsgmls like this: >onsgmls -s /usr/share/sgml/xml.dcl doc.xml the output is: onsgmls:1_3_b.xml:2:19:W:...
11
by: Wally | last post by:
OT - what can I build in PHP and MySQL for fun?
6
vinci
by: vinci | last post by:
greetings experts! i'm a computer science student. i have this subject called Software Engineering and i have this project that should be finished for me to graduate but i cannot finish it...
2
by: hebollozos | last post by:
Can anyone help me by giving me instructions how to migrate my MySQL Data for Windows to MySQL for Linux. I tried to find Sqlporter software by Realsoft Studio, but I failed. Hope somebody out can...
4
by: eneyardi | last post by:
How to make archive system?
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.