DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 02, 2010, 09:41:54 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: commentary improvements  (Read 5672 times)
0 Members and 1 Guest are viewing this topic.
Chaosmaker
Guest
« on: September 05, 2004, 05:17:06 PM »

Hi there,
second try for my first posting: Few months ago I read the TODO.txt and found the following:
- make it so that players can't miss comments in commentary areas when they are scrolling forward and someone else comments.
Afaik it's still the same in the new version (looked at pre.1 only), but... I only did it for unmodified  0.9.7+jt. Tongue
You'll find it here: http://dragonprime.net/users/Chaosmaker/pages.txt
Features:
- first page-link
- last page-link
- unread-link
- don't miss any comments while scrolling forward.

That's it, hf with it!

(P.S: Sorry for my bad english - I home, my PHP is better... Wink)
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #1 on: September 06, 2004, 12:08:56 AM »

I'll take a look at merging this into 0.9.8pre.6 unless you want to give it a go.

I might not get to it before release of that version however given how stressed my life is these next couple of weeks.
Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #2 on: September 06, 2004, 04:41:24 AM »

Np, use it for 0.9.8 if you want.
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #3 on: September 06, 2004, 08:22:55 PM »

Well, I was basically asking if you wanted to try making the changes ot 0.9.8 yourself Smiley (or get Anpera to do it *grin*) so that it might get in and tested more quickly than if you wait for me to do it.
Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #4 on: September 07, 2004, 02:37:30 AM »

Oooooops sorry... homo stupido... Cheesy
I just did it. Needs changes in lib/commentary.php and lib/sanitize.php.

http://dragonprime.net/users/Chaosmaker/pages_098.txt

Works with pre6.
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #5 on: September 07, 2004, 11:51:57 AM »

I ran a quick test of this on my dev server and found that it didn't seem to work correctly.

This might be due to my attempting to optimize some of it and doing so incorrectly but I don't believe that is the case.

Also, Eric requested (after I pointed this out to him) that the comment ids not be passed on the URL as he finds passing any sort of id of that sort along the URL to be the wrong solution (I could get into details, but it's not really relevant).  The solution would be to pass it via a session parameter which seemed like it should work and which is what I did rather than using the URL when I was testing (hence why I believe the error could have been mine).

I might play more with this in the future, but figured I'd mention my experiences with it here so that chaosmaker could also look at it.

The problem seemed to crop up if I went back more than two pages in the commentary, at that point it just got wonky. On the third page back it once again showed the 'last' page of comments.  Jumping back to the last page showed a blank commentary area rather than the most recent comments.

Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #6 on: September 07, 2004, 12:55:52 PM »

You're right, your fix won't work with it because $cid mustn't be set always.
The new one doesn't need any changes in sanitize any more and the first db query is only done when it's really needed.

http://dragonprime.net/users/Chaosmaker/pages_098.txt

Hope it works now. Session vars are $session['lastcom'] and $session['lastcommentid'].
« Last Edit: September 07, 2004, 12:56:38 PM by Chaosmaker » Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #7 on: September 07, 2004, 04:30:49 PM »

You're right, your fix won't work with it because $cid mustn't be set always.
The new one doesn't need any changes in sanitize any more and the first db query is only done when it's really needed.

http://dragonprime.net/users/Chaosmaker/pages_098.txt

Hope it works now. Session vars are $session['lastcom'] and $session['lastcommentid'].

I'll look at this tonight.. I'd realized the bit about not needing to be set always, so I'd been forcing it back to 0 in what I believed were the correct places.. I probably just didn't get it right since I didn't quite understand exactly how your code worked yet.. I'll look at this later though and if it works, I'll call it good.
Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #8 on: September 09, 2004, 03:35:20 PM »

Does it work now? Wink
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #9 on: September 09, 2004, 07:29:20 PM »

Nope.
I scrolled all the way back to the beginning of the village commentary (5 pages on my test server) and started scrolling forward again.  When I went back to comscroll=4, I got a blank list of commentary and the lastcommentid in the session was 'N'  (null).

This caused problems when I tried to go forward to the next comscroll (3) where it errors out with SQL errors.

Except for those edge cases, it *does* seem to work, but those edge cases are just broken Smiley
Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #10 on: September 10, 2004, 06:52:27 AM »

Arrrrrrrgh damn...  Undecided
It just happens if your last page is exactly full. Then you get a "back"-link without any comments on that page.
If I put $cid in quotes in the first query (or convert it to (int) if not set), no error occurs.
New version is now online. Wink
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #11 on: September 10, 2004, 08:07:07 AM »

I'll look at this later.
Logged

Ex co-developer of LotGD
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #12 on: September 10, 2004, 08:42:49 PM »

Well, that fixes the SQL error, however it still behaves incorrectly when I go back to the beginning and then start forward again.

You still need more testing.  I'll leave this running on logd-beta.dragoncat.net tonight so you can come see what it does.  Basically, go to Degolburg and then use previous to go back to the beginning.  This will get you back to comscroll=5.  Now start going forward again with next.  On the first page (comscroll=4) after hitting the beginning, you will get a blank page.  If you go forward or back again, you will see the correct pages.. it's only page 4 which is broken and only when coming at it from the most historical (page 5).

Logged

Ex co-developer of LotGD
Chaosmaker
Guest
« Reply #13 on: September 11, 2004, 03:06:46 AM »

Don't know what 'tonight' is for you Wink, but I just looked at it. It's funny, I don't have any problems.
Perhaps you want to look at http://gehdochzuhause.chaosonline.de/logd098pre/ (very slow dyndns connection; will run from now for 10-12 hours).
You should be able to view the source (after registering), hope it helps.
Logged
Kendaer
Global Moderator
Mod God
*****
Offline Offline

Posts: 1806


Once a dragon, always a dragon


View Profile WWW
« Reply #14 on: September 11, 2004, 12:45:49 PM »

Thanks.  There were in fact two small errors in either my transcription or in the code you posted which were corrected in your version online.  With those changes, it works correctly on my server and I'll be putting it into CVS for release with the next code drop.

Thanks.
Logged

Ex co-developer of LotGD
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
31 Guests, 1 User
ThricebornPhoenix
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search