Webmastersite.net
Register Log In

Parse error in link approval email

Comments on Parse error in link approval email

pierre
Beginner

Usergroup: Customer
Joined: Jul 26, 2003

Total Topics: 2
Total Comments: 6
pierre
Posted Jul 22, 2008 - 2:10 PM:

Hi all,
Just found out that I have a problem - the error was reported by the submitter of a new link - the new link approved email that they received was garbage

When a new link is approved the email log shows the correct email has been sent e.g.

"Your link, Something Precious, has been approved and added to the directory. You can see in the list at ....."

The email received is this:-
Subject: Your link submission

<br />
<b>Parse error</b>: syntax error, unexpected $end in
<b>/websites/LinuxPackage04/uk/po/tt/ukpotters.co.uk/public_html/wsn/include
s/commonfuncs.php(785) : eval()'d code</b> on line <b>8</b><br />

I have just updated to 4.1.55 from 4.1.52 but I can't be sure that it was working before.
It was definitely O.K. before I updated to 4.1.52 (from 4.1.44)

Its possible that something has got screwed up.
I'm struggling to find the place to start looking - where does this email get sent from?

The link has been added and things seem to be working OK so it is only the sending of the email that is going wrong.
Any suggestions.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 22, 2008 - 8:43 PM:

Did you customize that email? If so, what text did you put in it? Admin -> Emails -> Edit Outgoing Emails -> search for text "has been approved and added". I have
Your link, {LINKTITLE}, has been approved and added to the directory. You can see in the list at {CATURL} . Thanks.

{REASON}

<IF {SWITCH_RATINGS}>If you wish to let your visitors rate your site, you can get the code for the voting form here: {DIRURL}/index.php?action=getvotingcode&id={LINKID}</IF>
pierre
Beginner

Usergroup: Customer
Joined: Jul 26, 2003

Total Topics: 2
Total Comments: 6
pierre
Posted Jul 23, 2008 - 2:05 AM:

I have (email_notifyuserbody: )
Your link, {LINKTITLE}, has been approved and added to the directory. You can see in the list at {DIRURL}/index.php?action=displaycat&catid={LINKCATID} . Thanks. 

<IF {SWITCH_HITS)>If you wish to have the visitors you send to this site counted and credited to you, use this URL on your page in linking to this site: {DIRURL}/in.php?id={LINKID}</IF>

<IF 1>If you wish to let your visitors rate your site, you can get the code for the voting form here: {DIRURL}/index.php?action=getvotingcode&id={LINKID}</IF>

{REASON}


(The second IF is also SWITCH_HITS for some reason this editor keeps changing it to 1)

Thanks for you help


I had not modified the language files in any way.
The language file in the language directory had the wrong version.
The language file in the setup directory had the correct version.
I'll just replace the wrong file and hopefully should be OK
I'm not sure why the wrong file wasn't replaced during the update.
pierre
Beginner

Usergroup: Customer
Joined: Jul 26, 2003

Total Topics: 2
Total Comments: 6
pierre
Posted Jul 23, 2008 - 4:03 AM:

Still not working!

I have now got the language files sorted out and as I still had the problem did a reupload of all files except templates ans CSS.

I still get the same parse error in the email - The email log shows the correct email but the received email is as in first post.

If I reject the link instead of accepting the email received is the correct one.

I'll keep thinking and trying!!
pierre
Beginner

Usergroup: Customer
Joined: Jul 26, 2003

Total Topics: 2
Total Comments: 6
pierre
Posted Jul 23, 2008 - 4:56 AM:

Current State of play

If I use the (email_notifyuserbody: ) as supplied :-
Your link, {LINKTITLE}, has been approved and added to the directory. You can see in the list at {CATURL} . Thanks. 

{REASON}

<IF SWITCH_RATINGS>If you wish to let your visitors rate your site, you can get the code for the voting form here: {DIRURL}/index.php?action=getvotingcode&amp;amp;amp;amp;amp;amp;amp;amp;id={LINKID}</IF>

I have removed the curly brackets from SWITCH_USER so that it will post here - they are there in my language file.

then I get the error.

If I delete the second part - leaving just this:-
Your link, {LINKTITLE}, has been approved and added to the directory. You can see in the list at {CATURL} . Thanks. 

{REASON}



then it works.

I am stopping testing now as I have just realised that the few users who have asked to be notified of new links are getting bombarded by emails about my Test Link additions!

For some reason this editor changes "<IF SWITCH_RATINGS>1to "<IF 1>"
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 23, 2008 - 9:16 PM:

Testing now.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 23, 2008 - 11:21 PM:

Reproduced. Should be fixed by the end of the night.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 24, 2008 - 3:25 AM:

Fixed for the upcoming release (should be released in a few hours).
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
1 of 2 people found this comment helpful
Posted Jul 25, 2008 - 6:32 PM:

Now that you fixed the problem with the submissions I was able to test sending an email with a conditional, but I'm still having problems.

Here's the conditional I'm using -

<IF {LINKEXPIRE} is greater than 1>This item will be deleted on {LINKEXPIREDATE[%m/%d/%Y]}.</IF>

If the link has an expiration date the email works perfectly. The problem is that if there is no expiration date I get the following parse error email -

<br />
<b>Parse error</b>: syntax error, unexpected '>' in <b>/home/content/portal/includes/commonfuncs.php(810) : eval()'d code</b> on line <b>5</b><br />
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#10 - Quote - Permalink
Posted Jul 29, 2008 - 4:16 PM:

I haven't been able to reproduce this in 4.1.57. I've registered you a testing account for http://sandbox.wsnforum.com/emailtest if you want to see if you can reproduce it.
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
#11 - Quote - Permalink
Posted Jul 30, 2008 - 8:23 AM:

Thank you Paul. I've just edited the assign email with the <IF> statement above and have added a link without an expiration and assigned it to you. Let me know what you receive. Thanks.
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
#12 - Quote - Permalink
Posted Jul 30, 2008 - 9:37 AM:

Paul,

I actually also tried this again on my site as well and am still getting an email with the parse error. I then went to view the email logs I received the following at the very top of the page:


If you are not the administrator of this site, please report this page to the administrator. If you are the administrator, please pay careful attention: You have a parse error in your template ../templates/admin/viewemail.tpl (or perhaps in your header or footer) which you need to repair before this page can be displayed correctly. The error is picked up on by php at line 171 of the output.Line #166: <td>Your Client Portal has been updated to include the following item:
Line #167:
Line #168: Link w/o expiration date 4
Line #169:
Line #170: <?php if ( > 1) { ?>This item will be deleted on .<?php } ?>
Line #171:

[Load this template in your template editor]

Note that the line of the output is not necessarily the same line number in your template... just look for a similar looking area. The source of your error is probably not on line 171 itself, but most likely a line or two before it. Check your code carefully for syntax mistakes. If you cannot recognize one, copy and paste this output into a thread on the support forum.
Now outputing the page without any conditional or php sections evaluated:


So I logged back into the sandbox and when I view the logs there I get the same error so I'm guessing you must have gotten the parse error email as well.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#13 - Quote - Permalink
Posted Jul 30, 2008 - 11:21 AM:

I see, you were editing a different email than I was -- I'd been editing the link approval email, because of the title of this thread. It's not an email problem per se, it's a problem with the value of $thislink->expire at that point in the script. Fixed.
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
#14 - Quote - Permalink
Posted Jul 31, 2008 - 11:25 PM:

Just updated to 4.1.58 tonight and ran another test. Unfortunately, I'm getting the same results. Links with an expiration date send a correct email, but links w/o an expiration date still send out emails with parse errors.

Also now when I try to view the email log I only get - Illegal template name: ../templates/admin/viewemail.tpl

I was going to try it on the sandbox you setup but it was still at 4.1.57.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#15 - Quote - Permalink
Posted Aug 01, 2008 - 12:38 AM:

links w/o an expiration date still send out emails with parse errors.

Updated the sandbox and tested, still looks fine to me.

Also now when I try to view the email log I only get - Illegal template name: ../templates/admin/viewemail.tpl

Somehow that never happens on localhost, but I see it on the sandbox.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.