ConnorSBB Posted May 6, 2010 Share Posted May 6, 2010 Well, I am working on http://animelife.sitefrost.com/konaboards I have a few questions regarding how to set up some new stuff. It is a forum software... How would I go about setting up Post Count using MySQL and then displaying it under the users username in the threadview? Another thing similar to this. How would you I set up Signatures and Avatar fields using MySQL and displaying those for each member in the thread view? Any help is much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/ Share on other sites More sharing options...
MatthewJ Posted May 6, 2010 Share Posted May 6, 2010 Both of those questions would require knowledge of how the back end of the forum is structured. It would be surprising though if these were not already features of the software... Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054118 Share on other sites More sharing options...
ConnorSBB Posted May 6, 2010 Author Share Posted May 6, 2010 I am developing the software I am wondering how I would insert them using myslq and php. Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054128 Share on other sites More sharing options...
gwolgamott Posted May 6, 2010 Share Posted May 6, 2010 Create a specific user table. With fields for example as such: UserName, RealName, PassWord, Avatar, Signature, Email, PostCount... etc... Also to add the display, just add a field to store the UserName (assuming we are using that as your unique key for users) in the posts table called something like UserName since we are using it as a key. Then you just do as you always do, with exception add update to the user table when you add posts when you are updating the forum post table to increment their PostCount by one when post is made... Then when you display the posts, then the UserName field in the post table will then create a link to the User Table to display the data you want (Thus keeping it always updated in that method) I hope that helps some... not sure what you were looking for but there something. Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054156 Share on other sites More sharing options...
ConnorSBB Posted May 7, 2010 Author Share Posted May 7, 2010 Not really... xD Another problem I have discovered is the copyright is supposed to be in the footer. But I used Include'footer.php' and it placed it above the main content. Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054615 Share on other sites More sharing options...
Wolphie Posted May 7, 2010 Share Posted May 7, 2010 Well assuming you have a posts table in your database, you should be storing the ID of the user that makes a post.. E.g. post_id, user_id, post_title, post_body etc... Then you just do a SELECT COUNT(*) FROM posts_table WHERE user_id = [user_id] Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054640 Share on other sites More sharing options...
gwolgamott Posted May 7, 2010 Share Posted May 7, 2010 Not really... xD Another problem I have discovered is the copyright is supposed to be in the footer. But I used Include'footer.php' and it placed it above the main content. Haha, ok. Well please explain then, as I said not too sure what exactly you wanted. That was just a scenario of many you could use... point was as Wolphie pointed out, have the user ID be stored with the posts.... then call the user table for the info you want. Where are you exactly stuck at? Codewise? Where to start? Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054650 Share on other sites More sharing options...
ConnorSBB Posted May 8, 2010 Author Share Posted May 8, 2010 Would either of you be interested in helping me with this project? Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1054903 Share on other sites More sharing options...
gwolgamott Posted May 11, 2010 Share Posted May 11, 2010 What tables do you have and how are they setup? One table for posts? Another for users info? Need some minor details to set u in right direction. Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1056512 Share on other sites More sharing options...
gwolgamott Posted May 11, 2010 Share Posted May 11, 2010 Some thoughts though, to try to be a bit clearer on previous statement that is... PROCESS FOR ADDING A POST: TABLE STRUCTURE AS SUCH (For Example) [user] [Date_Time] [Post] 1.) Open database table for storing your post. 2.) Add the User ID to the User field, add Date & Time to Date_Time field, & add the Post data to the Post field. 3.)Open table for storing the User info TABLE STRUCTURE AS SUCH FOR USER INFO [iD] [Name] [Avatar] [Posts] [signature] [Other] 4.) Add one to the number stored in the Posts field. 5.) close database SUDO-CODE For Displaying posts 1.) Open Posts Table 2.) Get all info in an array or something. 3.) Check Poster's ID from the User field 4.) Open the user info table 5.) Store the User info that is equal to the ID you got from the post in an array or something. 6.)Display Post using the Post data and the ID info for the avatar, signature, name... etc... Quote Link to comment https://forums.phpfreaks.com/topic/200893-a-few-questions/#findComment-1056519 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.