| |||
Views: 88,544,674 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 05-06-24 06:04 AM |
|
Guest: Register | Login |
0 users currently in Computing | 4 guests |
Main - Computing - PHP: Link to a post | New thread | New reply |
Pac |
| ||
Flurry Level: 37 Posts: 135/262 EXP: 336224 Next: 2029 Since: 02-19-07 From: Japan Last post: 4484 days Last view: 2886 days |
Okay so I'm building a message board from scratch, and I'm just finishing off the final features, but I'm having a little problem with the Link link on posts; in that it takes about four or five seconds to actually find the post. Here's the code:
The code scans through all of the posts in a thread to find what page the post is on. Is there any more efficient way of doing this? Thanks. |
stag019 |
| ||
Snifit Level: 40 Posts: 148/299 EXP: 409915 Next: 31394 Since: 02-19-07 Last post: 4290 days Last view: 2176 days |
if($pid)Xkeeper's old code from Inc. 3, which he posted in the announcements. |
OoBurns |
| |||
Boo Level: 68 Posts: 782/1036 EXP: 2643629 Next: 85171 Since: 02-19-07 From: It is a mystery. Last post: 5732 days Last view: 5732 days |
|
Pac |
| ||
Flurry Level: 37 Posts: 138/262 EXP: 336224 Next: 2029 Since: 02-19-07 From: Japan Last post: 4484 days Last view: 2886 days |
I did after I made it, and then I kicked myself for not making it more... funny |
Xkeeper |
| ||
Level: 105 Posts: 2341/2846 EXP: 12037627 Next: 224633 Since: 02-19-07 Last post: 6070 days Last view: 2807 days |
elseif($pid=$_GET[pid]){
checknumeric($pid); $tid =$sql->resultq("SELECT thread FROM posts WHERE id=$pid"); $page=floor($sql->resultq("SELECT COUNT(*) FROM posts WHERE thread=$tid AND id<$pid")/$loguser[ppp])+1; } Hasn't changed much, really. ____________________ I dealt with it. |
Pac |
| ||
Flurry Level: 37 Posts: 139/262 EXP: 336224 Next: 2029 Since: 02-19-07 From: Japan Last post: 4484 days Last view: 2886 days |
Alright, thanks for the help |
Main - Computing - PHP: Link to a post | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 52, rows: 66/67, time: 0.017 seconds. |