View or mark unread posts

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

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sat Mar 01, 2008 8:29 pm

sovietpop wrote:Hello, I am getting an error message when I try and check pms
"
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.mykah/aaocarroll/misspeltCAT/includes/ucp/ucp_pm_viewfolder.php on line 216"

I've checked the viewfolder.php file and I can't see what I might have done wrong; could it be that I've a mistake in one of the other files? and if you think that might bet the case, where would I look for the error first.
Your first guess is right: you made an error in ucp_pm_viewfolder.php, and it's probably at line 216 or within a few lines before that line. If you want, you can post or pm me that file (making sure to use code tags so I can read it easily) and I'll take a look.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sat Mar 01, 2008 8:45 pm

manchumahara wrote:Find this line

Code: Select all

	'FOLDER_ID'			=> $folder_id,
Now replace with this line

Code: Select all

	'FOLDER_ID'			=> $row['folder_id'] ,
Why? I intentionally did not change that line, because:

- that' line doesn't do anything one way or another in either prosilver or subsilver2 (if you search for {messagerow.FOLDER_ID} you will find that it does not appear in either template)

- if someone designs a template that does use {messagerow.FOLDER_ID} it's uncertain whether it will be used for displaying what folder the user is in (e.g. unread messages) vs. what folder the pm is in (e.g. inbox) anyway so it's a toss of the coin as to whether you guessed right and

- it's one more change the mod would make and it has no effect anyway.

Is there a reason you think the line should be changed like that?
manchumahara wrote:In mod this line is as

Code: Select all

" . $row['folder_id'] . "
but I think the double qoute and concate sign is not needed here.
It's not neded because it's inside a double quote and will therefore be parsed, but there is nothing wrong with it and it is generally more in keeping with phpbb3 style to break out variables that are arrays with single quoted keys in them. But either way will work. :D

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sat Mar 01, 2008 10:21 pm

I installed this mod a short time back when it was still in development but still the same version. My members and love it. Excellent Mod.

One thing though, something I had never tested was the mark unreads in Private Messages, a member has just pointed out that it redirects them to the portal and doesn't work. I have double checked all my edits and can't seem to find where I have gone wrong. Can you point out the edit that would most likely be the problem.

Thanks in advance.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 2:48 am

ThePhantom2 wrote:One thing though, something I had never tested was the mark unreads in Private Messages, a member has just pointed out that it redirects them to the portal and doesn't work. I have double checked all my edits and can't seem to find where I have gone wrong. Can you point out the edit that would most likely be the problem.
I gather you are saying that unread pms properly appear in the unread pm folder but when someone looks at a pm and clicks the 'mark pm as unread' link the pm does not get marked as unread, correct?

What did you mean when you said it goes back to the portal? Do you mean it goes back to the index page of phpbb3? Or are you using this in a portal?

What address does the 'mark pm as unread' link point to (you can right click the link and click to copy the address and then paste the address onto a text document to see exactly where it points). If the link is working properly, it should point to an address in the following format:
http://[site_address]/ucp.php?i=pm&f=0&mu=xyz
(where xyz is the msg_id of the pm). Does it? (Knowing that will help narrow down the problem.)

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sun Mar 02, 2008 4:20 am

asinshesq wrote:
ThePhantom2 wrote:One thing though, something I had never tested was the mark unreads in Private Messages, a member has just pointed out that it redirects them to the portal and doesn't work. I have double checked all my edits and can't seem to find where I have gone wrong. Can you point out the edit that would most likely be the problem.
I gather you are saying that unread pms properly appear in the unread pm folder but when someone looks at a pm and clicks the 'mark pm as unread' link the pm does not get marked as unread, correct?

What did you mean when you said it goes back to the portal? Do you mean it goes back to the index page of phpbb3? Or are you using this in a portal?

What address does the 'mark pm as unread' link point to (you can right click the link and click to copy the address and then paste the address onto a text document to see exactly where it points). If the link is working properly, it should point to an address in the following format:
http://[site_address]/ucp.php?i=pm&f=0&mu=xyz
(where xyz is the msg_id of the pm). Does it? (Knowing that will help narrow down the problem.)
Thank you for your reply

You are correct, the PM does not get marked unread when you click on the 'mark pm unread link' and it redirects you to the Portal which is located at the phpbb root directory and not the required link that it should.

Cheers and thank you for your assistance.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 4:25 am

ThePhantom2 wrote:
asinshesq wrote:
ThePhantom2 wrote:One thing though, something I had never tested was the mark unreads in Private Messages, a member has just pointed out that it redirects them to the portal and doesn't work. I have double checked all my edits and can't seem to find where I have gone wrong. Can you point out the edit that would most likely be the problem.
I gather you are saying that unread pms properly appear in the unread pm folder but when someone looks at a pm and clicks the 'mark pm as unread' link the pm does not get marked as unread, correct?

What did you mean when you said it goes back to the portal? Do you mean it goes back to the index page of phpbb3? Or are you using this in a portal?

What address does the 'mark pm as unread' link point to (you can right click the link and click to copy the address and then paste the address onto a text document to see exactly where it points). If the link is working properly, it should point to an address in the following format:
http://[site_address]/ucp.php?i=pm&f=0&mu=xyz
(where xyz is the msg_id of the pm). Does it? (Knowing that will help narrow down the problem.)
Thank you for your reply

You are correct, the PM does not get marked unread when you click on the 'mark pm unread link' and it redirects you to the Portal which is located at the phpbb root directory and not the required link that it should.

Cheers and thank you for your assistance.
You forgot to answer the most important question:
asinshesq wrote:What address does the 'mark pm as unread' link point to (you can right click the link and click to copy the address and then paste the address onto a text document to see exactly where it points). If the link is working properly, it should point to an address in the following format:
http://[site_address]/ucp.php?i=pm&f=0&mu=xyz
(where xyz is the msg_id of the pm). Does it? (Knowing that will help narrow down the problem.)

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sun Mar 02, 2008 4:36 am

Sorry, I thought I did that cryptically by saying it redirects to the phpbb root directory. eg:(http://mywebsite/phpbb)
I can PM you a link to my board if that would help. Thanks again

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 4:43 am

ThePhantom2 wrote:Sorry, I thought I did that cryptically by saying it redirects to the phpbb root directory. eg:(http://mywebsite/phpbb)
I can PM you a link to my board if that would help. Thanks again
The fact that it redirects to the phpbb folder does NOT mean that the link points there. Please right click the link, click to copy the link address and then paste it into a text doc. Then let me know if it really points to http://mywebsite/phpbb (which I doubt, since that is not even a php page) or something else. ;)

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sun Mar 02, 2008 4:53 am

Yes that is where it points to as well. ;)

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 4:54 am

ThePhantom2 wrote:Yes that is where it points to as well. ;)
Are you saying that the end of the address is phpbb (not phpbb/index.php or whatever)?

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sun Mar 02, 2008 5:04 am

Yes, that is correct.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 5:07 am

asinshesq wrote:
ThePhantom2 wrote:Yes that is where it points to as well. ;)
Are you saying that the end of the address is phpbb (not phpbb/index.php or whatever)?
Make sure the following edits are correct (particularly the second FIND and ADD in ucp_pm.php and the reference to {U_MARK_UNREAD} in ucp_pm_viewmessage.html and, if you are using subsilver2, the reference to {U_MARK_UNREAD} in the subsilver version of ucp_pm_viewmessage.html):

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/ucp/ucp_pm.php

#
#-----[ FIND ]------------------------------------------
#
		if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox')))
		{
			$folder_specified = (int) $folder_specified;
		}
		else
		{
			$folder_specified = ($folder_specified == 'inbox') ? PRIVMSGS_INBOX : (($folder_specified == 'outbox') ? PRIVMSGS_OUTBOX : PRIVMSGS_SENTBOX);
		}

#
#-----[ REPLACE WITH ]------------------------------------------
#
		// start mod view or mark unread posts
		$msg_id = request_var('mu', 0);
		if ($msg_id)
		{
			mark_unread_pm($msg_id);
		}

		// the block below is in regular phpbb3 but I added refences to unreadbox
		if (!in_array($folder_specified, array('inbox', 'outbox', 'unreadbox', 'sentbox')))
		{
			$folder_specified = (int) $folder_specified;
		}
		else
		{
			$folder_specified = ($folder_specified == 'inbox') ? PRIVMSGS_INBOX : (($folder_specified == 'outbox') ? PRIVMSGS_OUTBOX : (($folder_specified == 'unreadbox') ? PRIVMSGS_UNREADBOX : PRIVMSGS_SENTBOX));
		}
		// end mod view or mark unread posts

#
#-----[ FIND ]------------------------------------------
#
					'U_INBOX'				=> $this->u_action . '&folder=inbox',

#
#-----[ AFTER, ADD ]------------------------------------------
#
					'U_MARK_UNREAD'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&f=' . $folder_id . '&mu=' . $msg_id),
					// start mod view or mark unread posts (and end mod too)...added the preceding line about marking unread pms

#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/ucp_pm_viewmessage.html

#
#-----[ FIND ]------------------------------------------
#
	<div class="back2top"><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>

#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_BACK_TO_TOP}</a>

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<a href="{U_MARK_UNREAD}" class="post" title="{L_MARK_PM_UNREAD}">{L_MARK_PM_UNREAD}</a>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	<!-- start mod view or mark unread posts (and end mod too) ... added mark_pm_unread references in the preceding line -->

ThePhantom2
Registered User
Posts: 72
Joined: Tue Feb 05, 2008 11:26 am
Location: NSW, Australia
Contact:

Re: View or mark unread posts

Post by ThePhantom2 » Sun Mar 02, 2008 6:01 am

Thank you very much, all fixed. I had made an incorrect edit to the includes/ucp/ucp_pm.php file. I had done the edit to the first 'U_INBOX' reference, my mistake for not double checking.

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
               'U_INBOX'            => $this->u_action . '&folder=inbox',

#
#-----[ AFTER, ADD ]------------------------------------------
#
               'U_MARK_UNREAD'         => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&f=' . $folder_id . '&mu=' . $msg_id),
               // start mod view or mark unread posts (and end mod too)...added the preceding line about marking unread pms
Thanks again for your time and assistance

CVinde
Registered User
Posts: 6
Joined: Tue Feb 26, 2008 9:52 pm

Re: View or mark unread posts

Post by CVinde » Sun Mar 02, 2008 10:53 am

Where can I find a demo?
Has anyone a website with this mod added, I can see? - without creating an account...

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: View or mark unread posts

Post by asinshesq » Sun Mar 02, 2008 11:26 am

CVinde wrote:Where can I find a demo?
Has anyone a website with this mod added, I can see? - without creating an account...
I have no demo (my boards are private) but there's not much to see anyway:

- adds a new 'View unread posts' link next to the 'View new posts' link that allows the user to see a list of unread posts (the list looks the same as the list of new posts the user sees when he clicks 'View new posts' except that it is populated with all unread posts)

- adds a new 'Mark post as unread' link at the bottom of each post that allows the user to mark the post as unread

- adds a new folder in the private message area for all pms that are unread (the area looks just like the inbox; unread pms appear in both the inbox and the unread pms box)

- adds a new 'Mark pm as unread' link at the bottom of each pm that allows the user to mark a pm as unread

Locked

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