boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Since Last Visit v2.2

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Sat May 03, 2003 6:43 am    Post subject: Since Last Visit v2.2 Reply with quote

I've posted version 2.2 of my Since Last Visit hack on my web site. The hack shows how many new posts and comments have been added since the visitor previous visit and indicates which are new.

This release fixes a bug where I wasn't properly ignoring posts/comments in category 0 and that occured in the future.

It's available here.

My other b2 hacks.
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
mcgub



Joined: 19 Apr 2003
Posts: 27

PostPosted: Sat May 03, 2003 3:41 pm    Post subject: Reply with quote

Would I be correct in assuming that we simply have to drop in the new b2last_visit.php and all will be well? Upgrade instructions would be nice. Smile
_________________
7 out of 10 voices in my head say I'm not crazy
Back to top
View user's profile Send private message
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Sat May 03, 2003 6:22 pm    Post subject: Reply with quote

the only changes where made in the 2 queries in the ak_since_last_visit() function, so however you have it set up - get the new queries in there.

--Alex
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Jeevan



Joined: 11 May 2002
Posts: 16

PostPosted: Wed Jun 04, 2003 9:05 pm    Post subject: Reply with quote

Quote:
Warning: Cannot modify header information - headers already sent by (output started at /home/mafia/cgi-bin/index.php:2) in /home/mafia/cgi-bin/b2last_visit.php on line 41

Warning: Cannot modify header information - headers already sent by (output started at /home/mafia/cgi-bin/index.php:2) in /home/mafia/cgi-bin/b2last_visit.php on line 42


That's the error I get >.<
It disappears when I don't include the cookies function, but then so does the "posts since your last visit".

I also noticed that if I leave it as it is the "posts since your last visit" displays, but it always shows 0 posts and 0 comments and the last visit is always equal to the current time and date. Help? Sad
_________________
Jeevan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Wed Jun 04, 2003 9:41 pm    Post subject: Reply with quote

from: http://alexking.org/index.php?content=software/b2/last_visit.php

Quote:
This code must be put in your page at the top; after you include "blog.header.php" (new in version 2.1 so that the $time_difference var is set) and before any HTML is sent to the browser or the cookie will not be set properly:


Has some HTML content already been sent before you call the ak_set_last_visit_cookie() function?
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
niten



Joined: 03 Jun 2003
Posts: 6

PostPosted: Thu Jun 05, 2003 2:16 am    Post subject: Reply with quote

Hey, this hack works great for me, but I was wondering, is there any way to make it consider recently edited posts as well as the newly posted?
Back to top
View user's profile Send private message
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Thu Jun 05, 2003 5:47 pm    Post subject: Reply with quote

No, there is only a "date_posted" column, no "date_modified" column in the posts table - no way to get the data. You can use the override time stamp feature to change the date/time of a post... but I know that isn't the same thing.
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Jeevan



Joined: 11 May 2002
Posts: 16

PostPosted: Thu Jun 05, 2003 6:27 pm    Post subject: Reply with quote

alex_t_king wrote:
from: http://alexking.org/index.php?content=software/b2/last_visit.php

Quote:
This code must be put in your page at the top; after you include "blog.header.php" (new in version 2.1 so that the $time_difference var is set) and before any HTML is sent to the browser or the cookie will not be set properly:


Has some HTML content already been sent before you call the ak_set_last_visit_cookie() function?


Yep, sorry about that a comment managed to make its way to the top of the page >.<
It's working fine now and I must compliment you on a great hack. I just can't get over those little "NEW" icons =D
_________________
Jeevan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Lelerz



Joined: 09 Apr 2002
Posts: 7
Location: NY

PostPosted: Wed Jun 11, 2003 8:00 am    Post subject: Reply with quote

Installed this hack.. quite nice, thanks! One thing though, I noticed that the "new" icon doesn't go away after a refresh, or even after I close the browser. Why is the cookie not being reset? My friends who installed the hack have this similar 'problem' .... one said it takes an hour or so.
Back to top
View user's profile Send private message Visit poster's website
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Wed Jun 11, 2003 8:08 am    Post subject: Reply with quote

'NEW' is displayed for an hour by design. It would not be a good idea to clear it immediately. For example, if there are 5 new posts and new comments on 6 posts and you follow a link to read one of the posts, then click back to the blog home and all of the 'NEW' indicators are gone, you'd be annoyed.
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Lelerz



Joined: 09 Apr 2002
Posts: 7
Location: NY

PostPosted: Wed Jun 11, 2003 8:48 am    Post subject: Reply with quote

k that makes sense... although, it's been nearly 2 hours for me, and the 'new' has yet to fade away--made a test post @ 1:48am, and now it is 3:44am....

Is it possible to shorten the length? If so, can you point out to me where exactly?
Back to top
View user's profile Send private message Visit poster's website
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Wed Jun 11, 2003 9:30 am    Post subject: Reply with quote

There are params to turn off 'sessions' and to set the # hours (it can take fractions) that define a 'session' in the function. If you continue hitting the site, it resets your session's 'start' time. Leave the site for an hour and come back and it will be reset. The default 'session' time is an hour.
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
zoid



Joined: 03 Jun 2003
Posts: 2
Location: San Francisco, CA

PostPosted: Thu Jul 03, 2003 2:34 am    Post subject: Reply with quote

this is the error I'm getting:

Code:
Fatal error: Call to undefined function: ak_set_last_visit_cookie() in /home/zlee/public_html/spiritual/index.php on line 1


ak_set_last_visit_cookie() is right after the include.
Back to top
View user's profile Send private message
alex_t_king



Joined: 09 Oct 2002
Posts: 194

PostPosted: Thu Jul 03, 2003 6:50 am    Post subject: Reply with quote

Not to squabble with you, but if you're calling the function after you've included the function and there are no syntax errors, etc. you won't be getting that error.

I don't know what else to tell you based on the information you've provided. Sorry.
_________________
Yahoo! Messenger ID: alex_t_king
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
zoid



Joined: 03 Jun 2003
Posts: 2
Location: San Francisco, CA

PostPosted: Thu Jul 03, 2003 6:33 pm    Post subject: Reply with quote

that's ok, I got it anyway now.
thanks for the hack.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group