473,378 Members | 1,309 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,378 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 2649
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?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.