PHP - Moved: I Love This Forum -- Love You All!
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=345678.0 Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=317497.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=305801.0 This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=347880.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=306605.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=323425.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=354184.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=355013.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=347431.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=358545.0 Hello everybody, am a bit new here. My question is, if I am on the right place here? I feel like been in the wrong place. Am looking for some forum where I can ask or find about "General questions" I have about PHP sometimes. Am not sure, if I am on the right "Forum" or if this is the "right category" Thank u! I need to figure out how to give this input a name so when i submit it i can get the data from it.
<!doctype html> <html> <head> <meta charset="utf-8"> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css" type="text/css" rel="stylesheet"/> <style> input{font-size:1.3em;} #log{position: absolute; top: 10px; right: 10px;} span{color:blue; text-decoration: underline; cursor: pointer;} </style> </head> <body> <div id="inputs"></div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script> <script src="jquery.googleSuggest.js" type="text/javascript"></script> <script> $.each("web".split(" "), function(i, v){ var div = $("<div>").appendTo("#inputs") , input = $("<input>").appendTo(div) , span = $("<label>").text(v).appendTo(div); input.googleSuggest({ service: v }); }); </script> </body> </html> Hello all,
I am working on my own PHP project where I can build myself my own forum just like how this site functions.
I would like to have user accounts and when you log in have a list of bulletin topics that you can choose from and then post your own question or topic and then other users can go to your post and write answers to it. I know there are many forums out there that you can make and set up to use but I would like to have my own so I can customize it any way I want.
Could I get some ideas on where I should start with this. I have been working on a website with a login functionality and I almost have that set up, then my next steps will be making it so users will be able to post topics.
I been doing google research trying to get some tutorials on this but I haven’t found one that is much help. I will be using phpmyadmin database and I plan on writing my sql as mysqli.
Thank you.
Okay I am making a forum and it is almost finished. The only thing is, I am stuck on how to get the most updated topics to appear at the top of the list. Like on every forum there is a new forum post that you havent visited yet. They are at the top of the list. How would I do that??? Just a general question, but could someone help me and tell me how to allow the user to enter a <br> without actually typing it. Like when they're typing in the forums, I want it to automatically go on a new line when they hit the ENTER key. Or could someone lead me to a guide? I tried searching everywhere and just can't seem to find it. Hello! My problem is that in my forum I want to display the picutre of their user and if they do not have a picture I want to show the standard one. I got all of this working on another part of the page but for some reason I can only get it to display the standard picture and not their custom picture... The code looks like this: Code: [Select] <?php // Now query any responses out of the database and place in a dynamic list $sqll = mysql_query("SELECT id FROM myMembers"); while($row = mysql_fetch_array($sqll)){ $id = $row["id"]; $check_pic = "..//members/$id/image01.jpg"; $default_pic = "..//members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces picture to be 120px wide and no more } else { $user_pic = "<img src=\"$default_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces default picture to be 120px wide and no more } } $all_responses = ""; $sql = mysql_query("SELECT * FROM forum_posts WHERE otid='$thread_id' AND type='b'"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { $all_responses = '<div id="none_yet_div">No respond has been posted yet.</div>'; } else { while($row = mysql_fetch_array($sql)){ $reply_author = $row["post_author"]; $reply_author_id = $row["post_author_id"]; $date_n_time = $row["date_time"]; $convertedTime = ($myAgoObject -> convert_datetime($date_n_time)); $whenReply = ($myAgoObject -> makeAgo($convertedTime)); $reply_body = $row["post_body"]; $all_responses .= '<div class="response_top_div"> ' . $thread_title . ' | ' . $whenReply . ' <a href="../profile.php?id=' . $reply_author_id . '">' . $reply_author . '</a> said:</div> <div class="response_div" style="padding-left:20px; vertical-align:text-top;">' . $user_pic . ' <div style="padding-left:117px;"> ' . $reply_body . '</div></div>'; } } ?> Please help me if you can! Thank you! Hi can anyone help this is my forum reply code: <?php include "connect.php"; // Get value of id that sent from hidden field $id=$_POST['id']; // Find highest answer number. $sql="SELECT MAX(a_id) AS Maxa_id FROM reply WHERE question_id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); // add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1 if ($rows) { $Max_id = $rows['Maxa_id']+1; } else { $Max_id = 1; } // get values that sent from form $a_name=$_POST['a_username']; $a_answer=$_POST['a_reply']; // Insert answer $sql2="INSERT INTO reply(question_id, a_id, a_username, a_reply, a_date, a_time)VALUES('$id', '$Max_id', '$a_username', '$a_reply', CURDATE(), CURTIME())"; $result2=mysql_query($sql2); if($result2){ echo "Successful<BR>"; echo "<a href='viewtopic.php?id=".$id."'>View your answer</a>"; // If added new answer, add value +1 in reply column $sql3="UPDATE topic SET reply='$Max_id' WHERE id='$id'"; $result3=mysql_query($sql3); } else { echo "ERROR"; } mysql_close(); ?> and this is the error message anyone know why it gives this Thanks Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fightwa1/public_html/addreply.php on line 10 please help Hello! I can't manage to get my forum to work. When I want a new topic to be made I got some code I will show in a second. But I just keep getting my own error message that just shows me something is wrong ... please help me figure it out. here is my code which is supposed to return all forums from the database and then display them in their respective categories. however it only shows one of the forums and not all of them. Anyone know why? function display_forum_list($crumbs) { global $link, $template, $settings, $lang, $config, $user; $template->replace( array( '{CRUMBS}' => display_crumbs($crumbs) ), 'index_page'); $query = $link->query("SELECT * FROM ".TBL_PREFIX."forums ORDER BY f_lid ASC"); $result = $query->fetchAll(); foreach($result as $key => $val) { if($result[$key]['f_pid'] == 0) { $cat_name = $result[$key]['f_name']; } else { $forum_name = $result[$key]['f_name']; } $forum_desc = $result[$key]['f_description']; } $template->replace( array( '{CATEGORY}' => $cat_name, '{F_ICON}' => '', '{F_NAME}' => $forum_name, '{F_DESC}' => $forum_desc, '{SITE_ROOT}' => $config['asf_root'] ), 'forum_list'); } we have a hacker on my forum using -1424 values as inputs how do i block and make sure the input is not anything negative? Hi Guys, I should know how to do this but for some reason my code isn't working or I just am missing something... I am setting up a simple forum and posts are stored in one table with the following fields: auto_id -------- primary, auto_increment start -------- stores a 0 or 1, to show that the post is the first in the thread. (1 for the starting post, 0 for other posts in the thread) blog_id ---------- the threads id number, posts that are repllies to the starting post have the same blog_id number. bid ---------- forum title title ----------- post title post_by --------- user's profile name mem_id ---------user's member id date_time --------- the date and time querydate --------- unix timestamp visible ------------ to disable visibility of a specific post My Problem is that I can list posts in certain forum but when someone creates another post in an older thread, I want that thread to show up at the top of the list of threads, but my code isn't doing it.... Example: A) Who bought the new iPhone 4S? Started by: John - Date: February 1, 2011 What did you think of the Green Lantern Movie? Started by: Mary - Date: January 1, 2011 **then if someone adds a post to "Going to see Transformers tonight." that thread should show up above the "Who bought new iPhone 4S?" thread, just basically like any forum page... B) What did you think of the Green Lantern Movie? (New Post Added on: March 1, 2011 by Scott) Started by: Mary - Date: January 1, 2011 Who bought the new iPhone 4S? Started by: John - Date: February 1, 2011 Here is my while loop code so far: Code: [Select] $sqlf="SELECT * FROM blogs WHERE bid='$brd' AND visible='yes' GROUP BY blog_id ORDER BY querydate DESC, auto_id DESC "; $rsf=mysql_query($sqlf); ..... Some HTML and CSS while($rowf=mysql_fetch_array($rsf)) { ..... Some more HTML/CSS and displaying the variables for the rows of threads. } Thanks for any help... |