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 

Revised Improved Private Entry Hack
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Mon Sep 01, 2003 9:05 pm    Post subject: Revised Improved Private Entry Hack Reply with quote

Since devilkid81 took down his private entry hack, because he didn't like me modifying it, I thought I would post my revised version of it.

I have modified it so that a cookie is used to retain the password; therefore, the users don't have to type in the password over and over again. I have also made it possible for you to control the output of comments link and others.

Also, since the cookie check is written in a function, you can use it in other areas of your blog without too much duplication of code.

You can get the hack here. Smile
_________________
Michael P.



Last edited by Cyberian75 on Wed Oct 13, 2004 11:30 pm; edited 2 times in total
Back to top
View user's profile Send private message AIM Address
billy



Joined: 05 Jul 2003
Posts: 40

PostPosted: Mon Sep 01, 2003 9:18 pm    Post subject: Reply with quote

thanks a lot! i was gonna download the other one, but then i saw he took it down. thanks again Smile
Back to top
View user's profile Send private message
Reese



Joined: 07 Sep 2002
Posts: 60

PostPosted: Tue Sep 02, 2003 1:37 am    Post subject: Reply with quote

Isn't Mike just so cool! :insert throbbing heart smiley:

No really though, it is awesome that finally a password protection hack including comment protection and cookie usage has come to be.
_________________
---
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Tue Sep 02, 2003 2:05 am    Post subject: Reply with quote

Thanks for the compliments, guys, but the credit for the idea of this hack should go to devilkid81. Smile
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
moose



Joined: 04 May 2003
Posts: 196
Location: Winnipeg Canada

PostPosted: Tue Sep 02, 2003 3:28 am    Post subject: Reply with quote

i got a parse error in b2edit, because of:

Code:
$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, private) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."','".$private)";


i changed it to...

Code:

$query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, private) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."','".$private."')";


so it works fine now Smile just pointing that out.

it's missing the ."' on the end of $private Smile
Back to top
View user's profile Send private message Visit poster's website
moose



Joined: 04 May 2003
Posts: 196
Location: Winnipeg Canada

PostPosted: Tue Sep 02, 2003 3:39 am    Post subject: Reply with quote

another thing, you shouldnt put
'private' => $row->private

for get_postdata2 under
Code:
'Karma' => $row->post_karma // this isn't used yet


because you will get a parse error, because there is no comma after that line. if you get this error, add a comma after $row->post_karma so it looks like

Code:

$row->post_karma, // this isin't used yet


then paste 'private' => $row->private under it
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Tue Sep 02, 2003 3:53 am    Post subject: Reply with quote

Thank you for the corrections. Smile

I updated the file.
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
Reese



Joined: 07 Sep 2002
Posts: 60

PostPosted: Tue Sep 02, 2003 3:22 pm    Post subject: Reply with quote

Well I think that you deserve some credit, because the best thing about this is the inclusion of all these features.

I'm going to upgrade (or try to ) in a few minutes. It's terrible, I'm going through the hacks section looking for all the useful ones that I don't have yet, which means I'll be doing alot of screwing up my b2 installing them all. I already installed the smilie hack - where you have them on b2edit.php. Very neat. Smile

edited for emphasis on "all" - cause I'm a perfectionist
_________________
---
Back to top
View user's profile Send private message Visit poster's website AIM Address
Reese



Joined: 07 Sep 2002
Posts: 60

PostPosted: Tue Sep 02, 2003 5:03 pm    Post subject: Reply with quote

Alright, I told you I was going to have problems. Smile

All went well, except when I went to post a test private entry.
Here's the error I'd gotten:

Quote:
Oops, MySQL error!

Your query:


MySQL said:
Column count doesn't match value count at row 1


...? If you're going to ask if I'd went into phpmyadmin and run "ALTER TABLE b2posts ADD private INT(1) DEFAULT 0 NOT NULL;", I did.
Also, as far as I can tell everything else is alright.

Perhaps it's just another case of my b2 hating me?
_________________
---
Back to top
View user's profile Send private message Visit poster's website AIM Address
moose



Joined: 04 May 2003
Posts: 196
Location: Winnipeg Canada

PostPosted: Tue Sep 02, 2003 5:16 pm    Post subject: Reply with quote

Can you post your query for posting (the thing that looks like $query = "INSERT INTO $tableposts...." here?
Back to top
View user's profile Send private message Visit poster's website
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Tue Sep 02, 2003 5:27 pm    Post subject: Reply with quote

moose, you're really good and smart for your age. Smile
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
Reese



Joined: 07 Sep 2002
Posts: 60

PostPosted: Tue Sep 02, 2003 5:55 pm    Post subject: Reply with quote

resolved
_________________
---


Last edited by Reese on Tue Sep 02, 2003 10:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Tue Sep 02, 2003 6:01 pm    Post subject: Reply with quote

In the comments page, there should be a form for commenting. I meant that form, not the one you are instructed to place.

Also, it seems that you are calling "the_content" function twice, hence your double entry. If you can't figure it out, show us your codes of your content template.
_________________
Michael P.

Back to top
View user's profile Send private message AIM Address
kenshin



Joined: 03 Sep 2003
Posts: 4

PostPosted: Wed Sep 03, 2003 7:55 am    Post subject: Post not showing Reply with quote

Hi. I installed it and rechecked but still it is not working for me. It doesn't shows the post eventhough I entered the correct password. It does not even shows the error I am supposed to see if ever I do enter the wrong password/no password.

Last edited by kenshin on Thu Sep 04, 2003 2:39 am; edited 1 time in total
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 1227
Location: Oregon

PostPosted: Wed Sep 03, 2003 8:05 am    Post subject: Reply with quote

In the function, have you changed the domain name to yours?

And the following should be placed before any output is sent to the browser:

Code:

$blog=1;
include("blog.header.php");

//private cookie check
$private = setprivate($password);

_________________
Michael P.



Last edited by Cyberian75 on Wed Sep 03, 2003 8:11 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
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