Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version - Postlist Last Post By for 6.2

Description - Shows the "Last Post By" information on the postlist page. To save queries, I chose to store the username... so the name won't be accurate if a user has changed their display name. Since this is only stored for the last post, I figured it was worth the savings in queries.

Pre-requisites - none

Author - JustDave from www.chattersonline.com original author
   Updated for 6.2 by JoshPet of www.joshuapettit.com

Credits - Allen Ayres for testing of original version

Files Altered -
   postlist.php (threads directory)
   postlist.tmpl (threads directory)
   addpost.php (threads directory)
   doapproveposts.php (admin directory)
   viewunapproved.php (admin directory)
   deletepost.php (threads directory)

Database Altered - Yes. 3 fields (B_Last_Number, B_Last_Name, and B_Last_Approved) added to w3t_Posts table.

New Files - none

Any other info - JustDave gets a bulk of the credit here, I just adapted for 6.2.

Last Update: January 19, 2003
Attachments
64714-lastpostby.6.2.zip (0 Bytes, 129 downloads)

Last edited by JustDave; 01/19/2003 4:51 PM.
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thank you


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You are welcome. Sometimes I need a nudge to get stuff onto my plate.

JustDave my know a better way to do this. I stored the username for last post to save queries. So it won't change when the name changes, but it changes as soon as there's another post in that thread anyway, so for my board, I didn't see it as a big issue.

The link still works... and as we have discovered here, once the name change thing gets tested out, it's doesn't happen that frequently.

But otherwise it required another query per thread being viewed. Probably could have been done like the [Re: Username] thing with an array, but that one escapes me at my current coding level.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
it escapes me at my next 2 coding levels


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
LOL - I'm gaining on it. But I didn't sleep last night (bad new habit of skipping sleep on Saturday night ) so I can't even comprehend it right now.

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Yeah I was stopped at that point on this. I need to set that same array setup on this to get the usernames from their numbers. I'll update your instructions when I do this. Thanks for bringing it up to speed for 6.2

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Is deletepost.php working for you? It must be late but I can't see what I may have done wrong... lol It's something simple so it's alluding me right now. I think I'm looking way to deep. LoL

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It was working for me... I'll send you my deletepost and you can compare.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks but I think it's do to my own coding mess at the moment... LoL I'll get my stuff cleaned up.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Test

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok at the cost of one query in postlist.php and saving 1 query in the other scripts I have this working with user numbers. yay

I'll append the instructions sometime today.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hey,
I just noticed both on my board and here (since installing this) that my new post rows aren't ligthing up.

Can't think of why this would mess that up.... can you?



Or is this just a mac thing?

It doesn't mess with classes in the postlist.tmpl file.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
hmmmm.... I hadn't noticed. I'll look things over and see what may be the cause.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok I finished cleaning things up a bit. There's a new create/alter table script as well so that old installs can update and use the user numbers.

Will zip and post shortly.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You got the post lines working again.

Yeah. Well I tried and came close.... as usual. Always need JustDave around to finalize things.

Thanks Dave.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Your welcome

I just updated the zip. There's a new createlastpostfields-6.2.php script everyone will need to run. For those that are upgrading this will clean out the B_Last_Name field and change it's type to INT(9).

You'll need to be logged in as an admin and the forums need to be closed to access the script.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks for this Josh & Dave - will be installing today



Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Dave -
I thought I could fix this on my own...but the way you've thrown all the user numbers into an array... it confuses me.

Anyway... need to add a clause if the user number is 1, then it needs to fetch the anon name from he post table. Otherwise the last posts (if anon) show up as ***DONOTDELETE***

Ugh.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
JustDave, i installed this one also and it works very well.
But i have a question regarding the field B_Last_Approved.
What's the different to B_Approved?
I think it stores exactly the same values or did i get something wrong?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The B_Last_Approved is 'yes' by default just as is B_Approved. If a user replies to a thread and their reply needs approval then it will not be displayed in the "Last Post By" information untill it is approved.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'll work on this one too today. There should be no additional queries needed.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have updated the zip to include a code change for postlist.php which will display "Anonymous" for posts stored under user number 1. To properly display anonymous names when allowed there will be an additional field required to store this information in. I'll work on updating this to allow for it sometime soon.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
[]The B_Last_Approved is 'yes' by default just as is B_Approved. [/]
So can't you use the B_Approved field to check if the posting is approved and only update "Last Post By" if it is?
Just guessing, if this field is really necessary.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
If the post isn't approved then B_Last_Approved will be set to 'no' and will not be used to update the last post info. (or it didn't used to, did that change?)

Once the post is approved it will be appended to the last post info. (or it should be)

I'll have to go over everything sometime soon to add in the ability to track anonymous post names if used/allowed. If somehow this field has not gotten used for the way I had intended I'll get it fixed.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Moved to finished mods forum.

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
A modification of this will be part of 6.3. Added 1 extra query to the postlist.php script so usernames will be right if a user changes their username.


UBB.threads Developer
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah!!

Joined: Nov 2001
Posts: 8
Lurker
Lurker
Offline
Joined: Nov 2001
Posts: 8
Hi
Anyone knows why this hack is not a standard to ubbthread?

mfg Chris

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
[]ckvsoft said:
Hi
Anyone knows why this hack is not a standard to ubbthread?

mfg Chris [/]

If you look a few posts up from this one the programmer who wrote UBB Threads (Scream) said it will be in the next release...

Joined: Nov 2001
Posts: 8
Lurker
Lurker
Offline
Joined: Nov 2001
Posts: 8
Thanx

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I am wondering if this is conflicting with another mod, I have tried this over and over and can't get it to work and it looks like everyone else is fine so I am not sure what's going on. After my first failure I dropped the tables and started over from scratch (and re-ran the table install script provided in the download) and enabled error logging, here is what I got after my last attempt
Code
Unable to do_query: INSERT INTO w3t_Boards (Bo_Title,Bo_Description,Bo_Keyword,Bo_Total,Bo_Last,Bo_HTML, <br />Bo_Created,Bo_Expire,Bo_Markup, <br />Bo_Cat,Bo_Moderated,Bo_CatName,Bo_Read_Perm,Bo_Write_Perm,Bo_ThreadAge,Bo_Reply_Perm, <br />Bo_SpecialHeader,Bo_StyleSheet,Bo_Posterid,Bo_LastNumber)


This (or most of it) appeared on every page so I just put back the backed up files, any ideas?

edit: added line breaks

Last edited by JoshPet; 06/19/2003 8:16 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
What was the rest of the error? Was there more? It seems to stop before it says what part it doesn't like.

Did you add the database fields to your database?

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
The rest of it was related to specific forums that I had, here is the whole thing (sorry) and I did add the database fields per createlastpostfields-6.2.php. After the first didn't take I dropped the tables and added it again, then re-modded all the pages from scratch

Code
Unable to do_query: INSERT INTO w3t_Boards (Bo_Title,Bo_Description,Bo_Keyword,Bo_Total,Bo_Last, <br />Bo_HTML,Bo_Created,Bo_Expire,Bo_Markup,Bo_Cat,Bo_Moderated,Bo_CatName,Bo_Read_Perm, <br />Bo_Write_Perm,Bo_ThreadAge,Bo_Reply_Perm,Bo_SpecialHeader,Bo_StyleSheet,Bo_Posterid,Bo_LastNumber) <br />VALUES ('Bootleg Trading', 'Want to swap boots? Come on in. Please no uploading in <br />this forum.', 'bootlegs','0','0','Off','1055220294','0','On','1','no','Music Files', <br />'-1-2-3-4-5-','-1-2-3-5-','0','-1-2-3-5-','0','usedefault','','') - <br />Duplicate entry 'bootlegs' for key 2 


edit added line breaks because none of us have a 10 foot wide monitor

Last edited by JoshPet; 06/19/2003 8:17 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK -

[]
Duplicate entry 'bootlegs' for key 2
[/]
That part at the very end is what I was looking for - that's the actual error as to why it couldn't complete the query. The begining is just the query.

This error looks like you are trying to create a second forum with the keyword of 'bootlegs' but you already have this forum.

Each forum must have a unique keyword.

Were you trying to add a new forum to your board?

That wouldn't have anything to do with this mod - this mod has to do with adding posts and tracking who posted to it last. It does not alter the w3t_Boards table - it only alters the w3t_Posts table.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Okay dude, you gotta be thinking I just got off the short bus here lol. Let's try this error and see if we can get to the problem at hand shall we?

Code
Unable to do_query: ALTER TABLE w3t_Posts ADD B_Last_Number INT(11) <br />UNSIGNED NOT NULL, ADD B_Last_Name INT(9) UNSIGNED NOT NULL, ADD <br />B_Last_Approved varchar(3) DEFAULT 'yes' NOT NULL - <br />Duplicate column name 'B_Last_Number' 


As to the other issue with the keyword you are correct, I just went back a page and changed it and all was good.

Edit: again. Please don't wide post 4 feet of code inside code tags - it makes the whole thread stretch out and then it makes it difficult to read what's here.

Last edited by JoshPet; 06/19/2003 8:56 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK -
Well perhaps - you keep wide posting even after I keep editing to correct them.

OK - what version are you running?
Did you have this mod installed before?

[]
Duplicate column name 'B_Last_Number' [/]

The database column is already there.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
version 6.2.3 (I know it said 6.2 but thought it would work with 6.2.3)
Okay I just made sure all the columns were dropped which they were, I uploaded the modified files again and ran createlastpostfields-6.2.php and it created fine with no errors. Now on the site I am getting no errors yet it's as if the mod isn't there, the last post is the same as it was.

xxx is a zip file if you would like to see the modified files. If I have to I will just live without the mod, I know it's now available in 6.3 but I do not want to re-mod my board with everything again. It makes no sense to me why they would remove such a feature to begin with. Thanks Josh.

Last edited by JoshPet; 06/19/2003 10:03 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, it'll work under 6.2.3 - if you had it installed before, you didn't need to add the database fields - as they were already there.

If you dropped the tables - then you dropped all the data with it. So if you aren't getting any errors - you are probably on the right track. But there will be no info until replies are posted from this point on.

The scripts looked good. I removed the link to them after I looked - Infopop can shut us down for posting copyrighted scripts on our board.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks, It does appear to be working but only half way. All I get is "By" without a user name, you can stop in and take a look if you want here is a thread that just got a post http://www.vhfans.com/boards/postlist.php?Cat=&Board=stage

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
It turns out that I am having trouble uploading at home. Josh, you said my files looked right and you were correct sir, they were right. Today when I uploaded those exact same files from work the they were all larger than the one's I had uploaded last night. Not sure why that would happen really. Thanks again for all the help here Josh.

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)