[05/02/07] Profile guestbook

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
17
59%
Very Good
8
28%
Good
3
10%
Fair
1
3%
Poor
0
No votes
 
Total votes: 29

kigoobe
Registered User
Posts: 169
Joined: Sat Apr 16, 2005 7:53 am
Location: Paris
Contact:

Re: [05/02/07] Profile guestbook

Post by kigoobe »

Paul wrote:Sorry, iam pretty busy and didnt saw your message.

1, cant remember. I dont think its possible with permissions directly, but you will need to modify the includes file
2. See a few pages back.
3. Thats how it works yes.
Thanks Paul for your reply :)

1. Is it possible to give some hints on which includes file please?
2. Are you speaking about your post where you wrote There is probarly a wrong switch statement (Not on newline or something) in your tpl files. If that's the case, I don't have any switch statement in my overall_header :roll:
3. Actually I created two accounts, one as admin and the other as a normal user, and by logging in as a normal user, I couldn't delete my own post, neither posts that were done to my guestbook :roll: Did I do anyting wrong?
kigoobe
Registered User
Posts: 169
Joined: Sat Apr 16, 2005 7:53 am
Location: Paris
Contact:

Re: [05/02/07] Profile guestbook

Post by kigoobe »

If you would like to work on this project a bit more, an idea would be to let an option so that users can modify their post by staying in the gb_view.tpl page itself. Now, if I add the edit button, they are going to the advanced page. If you could allow the page to be modified in the gb_view.tpl page itself, like the page reloads with the post id, and depending on if post id is present, the same text box gets populated with the relevant text, which can be submitted to edit.

This can be an added feature. However, the main issue as it is now, are the two problems that I am having.

1. Redirection. and
2. User can't delete his own post in other's guestbook.

For #2, I got the problem. The condition for delete_post_image is given -

Code: Select all

$userdata['user_id'] == $postrow['poster_id']
where as it needs to be

Code: Select all

$userdata['user_id'] == $postrow[$i]['poster_id']
Doing this, we get the delete image for a user when in other's guestbook, however, we still have a permission problem. Because, in function mode($mode), it's

Code: Select all

case "delete":
					if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid)
whereas it should be something like

Code: Select all

case "delete":
					if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid || $userdata['user_id'] == $poster_id)
At this moment, I am blocked since I'm not able to get the $poster_id inside the function mode($mode).

Any help will be appreciated.

Once this is solved, we will still have the redirection problem.
kigoobe
Registered User
Posts: 169
Joined: Sat Apr 16, 2005 7:53 am
Location: Paris
Contact:

Re: [05/02/07] Profile guestbook

Post by kigoobe »

Finally I solved the delete issue by adding an extra sql. Please post in case you feel that there's an easier way ...

For those who are interested, find - case "delete":

After, find -

Code: Select all

if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid)
Replace the above line with -

Code: Select all

					$scrapql = "SELECT poster_id FROM " . PROFILE_GUESTBOOK_TABLE . " WHERE gb_id = " . intval($HTTP_POST_VARS['gb_id']);
					$scrapresult = $db->sql_query($scrapql);
					if(!$scrapresult)
					{
						message_die(GENERAL_ERROR,"Could not get poster's id!","",__LINE__,__FILE__,$scrapql);
					}
					$scraprow = $db->sql_fetchrowset($scrapresult);
					$scrap_poster = $scraprow[0]['poster_id'];
					
					if($userdata['user_level'] == ADMIN || $userdata['user_id'] == $this->uid || $userdata['user_id'] == $scrap_poster)
And that solves the permission issue for an user to delete his own post from anther user's guestbook.
Cheers.

Note
I'm still finding a way to get a solution to the redirection problem. Thanks if someone can show me some light here.

Lines like this doesn't work -

Code: Select all

				$redirect = "profile.php?mode=viewprofile&" . POST_USERS_URL . "=" . $this->uid;
				redirect(append_sid($redirect, true));
Gives error message like -
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/forum/cache/tpl_subSilver.overall_header.php:6) in /home/user/public_html/forum/includes/functions.php on line 1004
Does this mean that the problem of redirection is coming because of any mismatch between the eXtreme Styles mod cache and this mod ??? :?
kigoobe
Registered User
Posts: 169
Joined: Sat Apr 16, 2005 7:53 am
Location: Paris
Contact:

Re: [05/02/07] Profile guestbook

Post by kigoobe »

Paul wrote:Within this version there is a new feature, for placing the guestbook on a new page. Documantation about that will be posted later.
By waiting for someone gets a solution to the redirection problem, I was wondering if someone has got a way to put the guestbook in an independent page?

Thanks for your input guys.

Edit:
I've done that, by creating a new page. However, the redirection problem is still there :roll:
kigoobe
Registered User
Posts: 169
Joined: Sat Apr 16, 2005 7:53 am
Location: Paris
Contact:

Re: [05/02/07] Profile guestbook

Post by kigoobe »

OK, after much search, I think the problem of redirection is clear now.

The problem is apparently coming because of the class file, where all the codes are bundled together, including the redirection. So, when we call the redirection, the page header is already called by that time. Hence, the error message.

Am I correct? Or, I'm still missing something :roll:
NulJunkie
Registered User
Posts: 29
Joined: Sun Jul 20, 2008 9:28 am

Re: [05/02/07] Profile guestbook

Post by NulJunkie »

This worked without a hitch for me.

Though, I was wondering if I could limit the number of guestbook entries per page?
Post Reply

Return to “[2.0.x] MOD Database Releases”