Jump to content

A few questions...


ConnorSBB

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.