PHP - Multi-moderation Tool
How would I go about making a small feature for my moderators that allows them to select multiple threads while viewing a forum then take action? All I need is an idea of how I would do this. Wouldn't I use the explode() function?
Example: http://i490.photobucket.com/albums/rr267/brannenclass/ex.png Similar TutorialsHello, my friends and I are planning to make a photo gallery, where people can upload their images and everyone can view them. These images will be saved in database. The problem is, we have to moderate these images when uploaded, to prevent adult content or copyrighted images from being displayed. We were thinking to make people send us these images by email, I mean through an email attachment, then we will review them, and if these images are OK, we will insert them manually into the database. We want as far as possible to not consume unnecessary spaces in the database, else the hosting will cancel our account even it offers unlimited space and bandwidth. We could make these images store in a folder, but the persons will have to give their names, that's why we think it would be better to make them fill some fields, attach the image and send us by email. 1/ Do you think this method is good? If you have another method, please give me... 2/ And also how do you insert images manually to database? I'm using PHPMyAdmin. I mean, to upload an image which is on my computer itself. I know there are some MySQL IDEs which do this, but do not know on PHPMyAdmin Thank you Hi I'm currently investigating how much it will cost me approximately for someone to code me a basic chat script.
The script should be very basic (old school) PHP without any javascript or fancy options. must use Mysql as database.
Must use automatic login if the user match to certain HTTP header otherwise they must specify a username to register
Should not use css stylesheets must be inline styles
No cookies
Moderating
time ban(kick) for 1h, 12h, 24h, 7days, 1 month and 1 year and Permanent
Option to unkick/ban
Option to edit messages and delete messages.
The moderator should be able to type under hes real username and by using a prefix like a ? infront of hes message it must be able to post a message under the name Moderator in a different color.
Each time a person has been banned a message should appear saying something like user1 has been kicked for 7 days.
Display the amount of times being kicked within the last 30 days...
Admin Panel
time ban(kick) for 1h, 12h, 24h, 7days, 1 month and 1 year and Permanent
Option to unkick/ban
Option to edit messages and delete messages.
The Admin should be able to type under hes real username and by using a prefix like a ! infront of hes message it must be able to post a message under the name Admin in a different color.
Each time a person has been banned a message should appear saying something like user1 has been kicked for 7 days.
Display the amount of times being kicked within the last 30 days...
Option to rename Users usernames
Word filter with an option to specify the replacement word
Auto mute for specific time frame if a user used a word on the word filter
Option to make users moderators and remove them and option to specify text colors of the moderator and Admin and normal user using span and div styles
Option to remove messages older then a specified time.
Should be able to select how many messages must be displayed per page
Chat window
Should show the time posted in brackets in grey, name: and message
Should make use of pagination
should have a text link to page to show users currently active and chatting
Refresh option and highlight the font of the usernames in another color for new messages appearing after each refresh.
If a user is a moderator/admin he should get [x] option next to each message he can select to be able to do all the moderation / admin options of regarding the specific message/user.
The Admin should have another admin page regarding the setup of the chat like user/ moderation/admin text colors etc... witch he can access via a link to the specific page.
Note:
This is just for interest sake no real job offering yet.
I want this script to be able to be implemented via a .mobi portal on a IM application for mobiles named Mxit. It has many limitations...
So I am trying to make my life easier at work. I have this idea that I can automate the sales quote via a simple website. I have the entire product list in MySQL and I can query for the individual catagories etc etc and get them to display. The display shows the SKU, Description, Price, and a third field to select quantity. The issue is that once they select a quantity of a paticular line item I need that line item (sku, description, and price fields) to be carried over to the final quote page where the math is done. Not sure how to key the paticular line item fields off the quantity field. Any ideas greatly appreciated... Code: [Select] <?php $query = "SELECT * FROM tbl_prods WHERE cat = 'fruit'"; $target = mysql_query($query); confirm_query($target); while($row = mysql_fetch_assoc($target)) { ?> <form action="quoter.php" method="POST"> <tr> <td><input name="sku" type="text" value="<?php echo $row[sku]; ?>" size="20" /></td> <td><textarea name="desc" cols="150" rows="2"><?php echo $row[desc]; ?></textarea></td> <td><input name="price" type="text" value="<?php echo $row[price]; ?>" size="20" /></td> <td><input name="quantity" type="text" value="0" size="3" maxlength="2" /></td> </tr> <?php } ?> </table> <input type="hidden" name="cust" value="<?php echo $cust; ?>"></p> <input type="hidden" name="reg" value="<?php echo $region; ?>"></p> <input type="submit" name="submit" value="Submit"></p> </form> Ideally just one word authentication and pretty simple, but effective. Preferebly one that does not use Sessions because then the user is unable to press the back button to go back to the original page after submitting the form... I know I could just put a text link there but not all users would click that link... So I built a tool for my cms a while back and have decided to share it. The only 2 things that I know of that are similar in nature is phpmyadmin or sql buddy. Now my tool is not nearly as in depth as either of those but what it lets you do is run any query string right from the webpage. But the cool thing that it has over phpmyadmin and sql buddy is that it has buttons for many of the common commands and a ajax select to get the available column names for the selected table. So now you don't have to try and remember what table had what column and "how did I spell that column again".
I use this to test sql strings for syntax and to quickly see if it returns the results I expect without having to edit the code and then save, upload or hit refresh or whatever. Since all the the stuff is done via ajax, it's all quickly displayed and you can change the query immediately and hit the Run Query button again.
I just thought that this could be helpful and useful for others. You can download it here http://amecms.com/ar...ckly-and-Easily
Hi folks! Upon registering, my register script runs an md5 hash on the password. My problem is when the user wants to change passwords. currently I have a very simple profile, and when they edit it, it doesn't rehash the password- it simply replaces the entire hashed old password with the plain, new password. Any way I could get the script to rehash the password? editprofile.php <?php include('config.php'); include('header.php'); if($_SESSION['id']=="") { header("Location: YouMustLogInNotice.html"); } if(isset($_POST['btnedit'])){ $callname = $_POST['callname']; $email = $_POST['email']; $password = $_POST['password']; $sql = mysql_query( "UPDATE users SET callname='".$callname."', email='".$email."', password='".$password."' WHERE id='".$_SESSION['id']."'" ); if($sql){ echo "<script>alert('profile updated');window.location='myprofile.php?id=$userfinal'</script>"; }else{ echo "<script>alert('updating profile failed!');</script>"; } } $sql = mysql_query( "SELECT * FROM users WHERE id='".$_SESSION['id']."'" ); $row = mysql_fetch_array($sql); $user = $userfinal; echo "<td align=center> <div id=box> <table width='100%'> <tr> <td><h2>Edit profile</h2> <form method='post'> <table><tr><th>ID#:</th><td>".$user."</td></tr> <tr><th>Name:</th><td><input type='text' name='callname' value='".$row['callname']."'/></td></tr> <tr><th>Email:</th><td><input type='text' name='email' value='".$row['email']."'/></td></tr> <tr><th>Password:</th><td><input type='password' name='password' value='".$row['password']."'/></td></tr> <tr><th>Registered:</th><td>".$row['registered']."</td></tr> <tr><th>Last Login:</th><td>".$row['lastlogin']."</td></tr> </table><br /> <input type='submit' name='btnedit' value='update' class=button /> </form></div></td> </tr> </table> </td></tr> </table>"; ?> <?php include('footer.php'); ?> Hey guys, I'm working on a tool to add to a site that will search by title, author, keyword (3 radio buttons), category(drop-down list),as in a library. I'm working with dreamweaver CS5 with php. I was trying to create recordset with viarables (that display ex. $_POST['category']) and use an if function (if (radioButton1 == checked) { return something } and connect this all to dynamic table. Getting so many errors, I'm asking you for advice how I can do this ? Could you please explain it to me as simple as possible, as I just started using dreamweaver with php. Thanks ! Sorry if this is a silly question lol. I want to know if there is an online tool I can use to check and see what PHP code will ouput server side. For example: <?php $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); ?> Hi, i have problem with editing register form over Inspect element or when u press F12 in mozilla or chrome. When u select country u can edit form on F12 and change country value so form save it like that in database. Problem is because its in foreach loop and i cant get a check if country in post variable is valid, and compare it with that in database. In my $_POST variable country is stored like ' Croatia, hr ' and in database its like 'id, name, alpha_2, alpha_3'.
So can i find value i need for example Albania and al wihout any loop ?
// if user is logged in redirect him to index page if ($general->is_logged() === true) { header('Location: index.php'); exit(); } // get list of countries $country = $teams->get_country(); require_once 'core/classes/recaptchalib.php'; $publickey = "***********************"; $privatekey = "***********************"; // process form if (isset($_POST['register'])) { if (isset($_POST['username']) && isset($_POST['nickname']) && isset($_POST['password']) && isset($_POST['repeat_password']) && isset($_POST['email']) && isset($_POST['repeat_email']) && isset($_POST['gender']) && isset($_POST['country']) && isset($_POST['recaptcha_challenge_field']) && isset($_POST['recaptcha_challenge_field'])) { $username = trim($general->safe_input($_POST['username'])); $nickname = trim($general->safe_input($_POST['nickname'])); $password = trim($general->safe_input($_POST['password'])); $rpassword = trim($general->safe_input($_POST['repeat_password'])); $email = trim($general->safe_input($_POST['email'])); $remail = trim($general->safe_input($_POST['repeat_email'])); $gender = trim($general->safe_input($_POST['gender'])); $cntry = $general->safe_input($_POST['country']); $date_registered = time(); $password_hash = $general->safepass($password); // captcha $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); // if username is empty if (empty($username)) { $error[] = 'Username is empty.'; // if username already exists } elseif ($users->user_exists($username) === true) { $error[] = 'Username in use, please choose another.'; // username must be between 3 and 20 characters long } elseif (strlen($username) < 3 || strlen($username) > 20) { $error[] = 'Username must be between 3 and 20 charaters long.'; } // if nickname is empty if (empty($nickname)) { $error[] = 'Nickname is empty.'; // if nickname in use } elseif ($users->nick_exists($nickname) === true) { $error[] = 'Nickname in use, please choose another.'; // nickname must be between 3 and 20 characters long } elseif (strlen($nickname) < 3 || strlen($nickname) > 20) { $error[] = 'Nickname must be between 3 and 20 characters long.'; } // if passowrd field is empty if (empty($password)) { $error[] = 'Password filed is empty.'; } // if password repeat field is empty if (empty($rpassword)) { $error[] = 'Repeat password filed is empty'; } // if password and repeat password is not empty if (!empty($password) && !empty($rpassword)) { // passwords match ? if not throw error message if ($password != $rpassword) { $error[] = 'Passwords don\'t match.'; // password must be between 6 and 30 characters long } elseif (strlen($password) < 6 || strlen($password) > 30) { $error[] = 'Password must be between 6 and 30 characters long.'; } } // is email empty if (empty($email)) { $error[] = 'Email filed is empty.'; } // is repeat email is empty if (empty($remail)) { $error[] = 'Repeat email filed is empty.'; } // if email and repeat email is not empty if (!empty($email) && !empty($remail)) { // if emails are not same if ($email != $remail) { $error[] = 'Emails don\'t match.'; // if email and repeat email is same } elseif ($email == $remail) { // is email valid if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $error[] = 'Invalid email format.'; // is email in use } elseif ($users->email_exists($email) === true) { $error[] = 'Email in use, please choose another.'; // email must be between 10 and 30 characters long } elseif (strlen($email) < 10 || strlen($email) > 30) { $error[] = 'Email must be between 10 and 30 characters long.'; } } } // if gender is empty if (empty($gender)) { $error[] = 'Please select gender.'; } // if gender is not empty if (!empty($gender)) { // if gender is Male or Female if ($gender == 'Male') { $gender = 'Male'; } elseif ($gender == 'Female') { $gender = 'Female'; } else { $error[] = 'Invalid gender.'; } } // if country is empty if (empty($cntry)) { $error[] = 'Please select country.'; } // check if country is valid if (!empty($cntry)) { // $newCountry['0'] is name key // $newCountry['1'] is alpha_2 key $newCountry = explode(',', $cntry); if (in_array($newCountry['0'], $country['name'])) { $error[] = 'VALID.'; } else { $error[] = 'Invalid country.'; } } // check if capthha is valid if (!$resp->is_valid) { $error[] = 'Invalid captcha code.'; } // if no errors register user if (empty($error) === true) { //$add_user = $users->register_user($username, $password_hash, $email, $gender, $date_registered, $cntry, $nickname); unset($_POST); // clean $_post variable echo 'REGISTER USER !'; } /* if ($DBH->lastInsertId()) { header('Location: index.php?page=register_success'); exit(); } else { $error = '<p class="error-msg">There was a problem, please try again.</p>'; }*/ } } ?> <script type="text/javascript"> var RecaptchaOptions = { theme : 'clean' }; </script> <h3>Register</h3> <?php if (!empty($error)) { echo '<div style="padding:10px;margin:0 10px;border:1px solid #f3f3f3;background:#E35454;color:#fff;"><ul style="margin:0 0 0 20px;">'; foreach ($error as $error) { echo '<li>'.$error. '</li>'; } echo '</ul></div>'; } ?> <form action="" method="POST" class="register-form"> <input type="text" name="username" size="40" maxlength="20" placeholder="Username" value="<?php if (isset($_POST['username'])) { echo htmlentities($_POST['username'], ENT_QUOTES, "UTF-8"); } ?>" required> <input type="text" name="nickname" size="40" maxlength="20" placeholder="Nickname" value="<?php if (isset($_POST['nickname'])) { echo htmlentities($_POST['nickname'], ENT_QUOTES, "UTF-8"); } ?>" required><br /><br /> <input type="password" name="password" size="40" maxlength="30" placeholder="Password" required> <input type="password" name="repeat_password" size="40" maxlength="30" placeholder="Repeat password" required><br /><br /> <input type="text" name="email" size="40" maxlength="30" placeholder="Email" value="<?php if (isset($_POST['email'])) { echo htmlentities($_POST['email'], ENT_QUOTES, "UTF-8"); } ?>" required> <input type="text" name="repeat_email" size="40" maxlength="30" placeholder="Repeat email" value="<?php if (isset($_POST['repeat_email'])) { echo htmlentities($_POST['repeat_email'], ENT_QUOTES, "UTF-8"); } ?>" required><br /><br /> <select name="gender" required> <option value="">Select gender</option> <option value="Male">Male</option> <option value="Female">Female</option> </select> <select name="country" style="width: 215px;" required> <option value="">Select country</option> <?php foreach ($country as $key) { echo '<option value="'.$key['name'].','.$key['alpha_2'].'">'.$key['name'].'</option>'; } ?> </select> <br><br> <center><?php echo recaptcha_get_html($publickey); ?></center> <br> <center><input type="submit" name="register" value="Register" class="small-button"></center> </form> Hi,
Can anyone recommend some Business Intelligence tools that can be integrated into a PHP (wordpress/joomla) based website? I've had a good look around the net but they all seem to be written in Java/J2EE and appear to be software based - not sure if im after the possible or impossible here...
Thanks
This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=345560.0 I'm working with a downloaded open-source CMS on localhost, and trying to learn. Is there a tool that will list the files (php and otherwise) that are accessed (in order) as the CMS does various normal operations? I want to see the order and the repetition of files that are opened, even if it is something minor. Thanks. Hello I am busy trying to setup a free to use budgeting and cashflow tool. I was recently going through my finances and whilst I found lots of spreadsheets on the subject, I didn't find a website that would allow me to store my data anonymously and access it when and where I felt fit. Bare in mind that I am a bit of a novice so go easy on me... So firstly, I've setup a page to collect 'account' information...that is, income items and expense items. I ask them to enter the amount, the frequency and when the next due date is. The DB looks like this: Code: [Select] CREATE TABLE IF NOT EXISTS `income_accounts` ( `inc_acc_ID` int(11) NOT NULL AUTO_INCREMENT, `user_ID` int(11) NOT NULL, `freq_ID` int(11) NOT NULL, `amount` decimal(7,2) NOT NULL, `next_due` date NOT NULL, `income_typeID` int(11) NOT NULL, PRIMARY KEY (`inc_acc_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=105 ; and the same for expense 'accounts': Code: [Select] CREATE TABLE IF NOT EXISTS `expense_accounts` ( `exp_acc_ID` int(11) NOT NULL AUTO_INCREMENT, `user_ID` int(11) NOT NULL, `freq_ID` int(11) NOT NULL, `amount` decimal(7,2) NOT NULL, `next_due` date NOT NULL, `ex_typeID` int(11) NOT NULL, PRIMARY KEY (`exp_acc_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; So once I have these entered by the user I should be able to then generate a cashflow forecast. For example, I give 5 options for the user: '4 weeks' , '8 weeks', '3 months', '6 months' '12 months'. Selecting one of these will then generate a table listing all of the items that apply for each period with a total at the bottom. Lets take '4 weeks' for an example. First I need to determine if the 'next_due' value is within the time period selected (4 weeks). If it is, what frequency is it? If it is every week then each column of the 4 column table created (i.e. 4 weeks/4 columns) will have it in it. If it is monthly frequency it will be only in the column for which it is due (i.e. column 1 would be todays date to todays date +6, column 2 = todays date + 7 to todays date +13 etc...) This will go through both the income table and the expense table and once all the items have been checked and added to the page table a further row would be added to total all the items in each column, and give a sum (i.e. sum of incomes less sum of expenses). For the '6 month' and '12 month' option, I want to display 1 month per column, rather than 1 week...just to not squeeze things up to much... I do not have a great deal of experience with arrays but my instinct tells me that they are the answer....otherwise I guess I could create a temporary DB table? I'm happy to share the code I've written so far if it helps...otherwise any advice on the best way to achieve this would be great. I am having problems being able to find the data that needs to be posted in various translation websites. I think this is because the translation tools they have are using some kind of flash script to translate? So the new page isn't being loaded using the post data string?? I am not completely sure, anyways... I am using live http headers on firefox to try and get the content for the post data string. The sites I have tried to get the post data from are these: http://www.freetranslation.com/ http://www.free-translator.com/ I can get cURL to visit the page and do everything, I just cant find the post data string. or maybe I am way off here.. Thanks for any help Hi Chaps, I'm trying to put together a Nested Set Model (Hierarchical Data), but I have having problems when it comes to deleting/updating the 'nested' table. I'm using this as a guide: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html But when trying to run a query, such as: SELECT @myLeft := lft, @myRight := rgt, @myWidth := rgt - lft + 1 FROM nested_category WHERE name = 'GAME CONSOLES'; DELETE FROM nested_category WHERE lft BETWEEN @myLeft AND @myRight; UPDATE nested_category SET rgt = rgt - @myWidth WHERE rgt > @myRight; UPDATE nested_category SET lft = lft - @myWidth WHERE lft > @myRight; I get a MySQL syntax error. This code works fine in something such as Windows Command Prompt, but not in PHP. Is there a special way to run multiple queries in 1 PHP script? Many thanks hi , i want to make 5 forms with 1 submit button , how i do that? thanks , Mor. How i can delete record from table `order` and move it to `order2`
the table `order2` structure is exactly like table `order`.here is the code that i made.
<? include("connection.php"); $id_product=$_GET["pid"]; $sql_delete="DELETE FROM `order` WHERE id_product='$id_product'"; $result=mysql_query($sql_delete) or die("Error in sql due to ".mysql_error()); if ($result) header("Location: order_list.php"); ?> hello all, i have been sitting here googleing and googling but i can't seem to find what im looking for. i am tring to create a personal site that lets me note services i do for my cars. I have multiple tables (cars, color, mfg, ...) in the main table cars i insted of putting the color black i put and int(11) of 1 which is suppose to "if statement" to the table colors and produce the correct color. same for mfg. although nothing i have tried has helped i always just have the else of the if echoed out. i have heard of union and join left right i am so unsure of what is need any insite would be useful. thanks in advance. Hi guys I got an issue that when a link on the site is loading, the other links does not load until the previous is complete but it will work if i try on 2 different browsers. How can i browse multiple links silmultanously? Thanks Hello friends, I've tried to search over the Internet but didn't found any tutorial how to do the following :- let say we have form with input username and input email just 2 field HTML Code Code: [Select] <form> <table> <tr> <td>Username :</td> <td><input id="username" size="20" type="text" name="username"></td> </tr> <tr> <td>Email :</td> <td><input id="email" size="20" type="text" name="email"></td> </tr> </table> </form> As you can see no submit button cause we will only check out if username and/or email is not stored already, by using ajax My problem : i can only check out for username (1 field) but i can not check for 2 fields or more and i want to know how to apply it for 2 fields (username and email) Here is my idea for only one field (username) I'll add in the HTML code this Code: [Select] <td><div id="status"></div></td> and will add this java code Code: [Select] <SCRIPT type="text/javascript"> pic1 = new Image(16, 16); pic1.src = "loader.gif"; $(document).ready(function(){ $("#username").change(function() { var usr = $("#username").val(); if(usr.length >= 4) { $("#status").html('<img src="loader.gif" align="absmiddle"> Checking availability...'); $.ajax({ type: "POST", url: "check.php", data: "username="+ usr, success: function(msg){ $("#status").ajaxComplete(function(event, request, settings){ if(msg == 'OK') { $("#username").removeClass('object_error'); $("#username").addClass("object_ok"); $(this).html(' <img src="tick.gif" align="absmiddle">'); } else { $("#username").removeClass('object_ok'); $("#username").addClass("object_error"); $(this).html(msg); } }); } }); } else { $("#status").html('<font color="red">The username should have at least <strong>4</strong> characters.</font>'); $("#username").removeClass('object_ok'); $("#username").addClass("object_error"); } }); }); </SCRIPT> Explain : it will get the input of username and will send it to check.php Now check.php code (should have all usernames that will compare with it) Code: [Select] <?php if(isSet($_POST['username'])) { $usernames = array('john','michael','terry', 'steve', 'donald'); $username = $_POST['username']; if(in_array($username, $usernames)) { echo '<font color="red">The username<STRONG>'.$username.'</STRONG> is already in use.</font>'; } else { echo 'OK'; } } ?> Now it is very clear , if will automatic check the username now my problem is how to apply it for also email |