PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 2nd, 2002, 09:57 AM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Trying to build a forum LOT of questions

I`m only a novice PHP user i have done quite a few simple scripts uploads a very simple chat forum but now i want bigger fish i want to do a real forum with all the bells and wistles. I have quite a bit of it up and working the thing i am stuck on now is my post count here comes the question:

I have my post count working, sort of. It doesnt update every post just per post. I have a counter on the post count so it selects it from my user table updates it and then puts it back and it also puts the new number in the table where my responces go sence this is the only way i could think to do it now.

How would i go about printing out the post count for the user and have it update next/under his name every time he posts instead of per post?

Reply With Quote
  #2  
Old October 2nd, 2002, 10:26 AM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 12 m 16 sec
Reputation Power: 8
RE: Trying to build a forum LOT of questions

There are lots of different approaches to this..here are two of them

1. Have a table that only holds post counts (called postcounts?), then whenever an operation occurs that would update a post count, you update it there. So, if a user posts a message, you increment their post count. If a message gets deleted, you decrement their post count. Then, when displaying messages, just pull the post count from this table.

2. When displaying messages, grab the users point count by counting the actual number of messages in the messages table by them (SELECT count(*) FROM messages WHERE poster='postersname'). This method isn't quite as efficient as the first method and when you get LOTS of messages you could notice a slower response.


Reply With Quote
  #3  
Old October 2nd, 2002, 02:48 PM
everytime everytime is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: *.*
Posts: 133 everytime User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Trying to build a forum LOT of questions

I guess you have a table that holds the posted data and in that table say a userid that linkls a record in the post data to a record in the user data. That way you know who made a post and keep the user and post information in separate tables. If this is the case then query the database with something like:

Code:
"SELECT Count([tbluser].[userid]) AS [number_of_posts]
FROM [tblposts];


This assumes tbluser holds your user information and tblposts holds your posts data.

HTH

Reply With Quote
  #4  
Old October 2nd, 2002, 04:48 PM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Trying to build a forum LOT of questions

NvM i just woke up when i read that and the words all burrled together heh i will have more questions soon i`m sure so i`ll just post them in this topic. Thank you everyone i`ll see how this stuff works soon

Reply With Quote
  #5  
Old October 2nd, 2002, 05:39 PM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Trying to build a forum LOT of questions

ok i had made it this far already my next step is displaying the information though. I am using a do, while to display the user name avatar and message to the public. How do i get the post count to show up for every user that responds? i could get it to do it if only one user responds to a topic... This is where I am stuck. I probably should have done a better job of explaining earlier

Reply With Quote
  #6  
Old October 2nd, 2002, 06:44 PM
Colonel-Panic Colonel-Panic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 Colonel-Panic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Trying to build a forum LOT of questions

Never mind i got it woo whoo

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Trying to build a forum LOT of questions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.


© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek