PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Classifieds How do I...? (http://www.photopost.com/forum/classifieds-how-do-i/)
-   -   Where do I find... (http://www.photopost.com/forum/classifieds-how-do-i/144320-where-do-i-find.html)

aotc October 23rd, 2010 01:12 PM

Where do I find...
 
Variables... or the html code that prints out the variables...

There's a typo in the code that needs to be fixed. This typo recurs everywhere certain variables are used - mainly variables with links ($buyemail, $toemail, $product, $touserid, $adid). This is just one example.

As you can see from my site's source code for the member's message page:

Code:

Content visible to verified customers only.
A <br /> was cut in half....this results in a /> showing up at the end of several lines. It also causes links on the emails to never end.

I need to know from where this html is generated so it can be fixed. Or where these variables are defined so they can be fixed. Or something.

Thanks!

Chuck S October 23rd, 2010 04:30 PM

Not really sure what your trying to say here

where are you having an issue doing what exactly?

aotc October 23rd, 2010 05:39 PM

Certain variables, when they render in html, are rendering with a typo - there's a <BR /> tag that's been broken apart.

Here is an excerpt from how messages are showing up when users check their messages:

smarmyclothes has posted a reply about the following listing:

"I eat you."

I eat you. - AttackoftheCraft Handmade Shop
/>

If you no longer wish to be notified of replies about the above listing, you can disable notification here:

Message - AttackoftheCraft Handmade Shop
/>


The bolded items are the back half of the broken break tag in the code. In my post above, I showed how the source code of the page looks. You can see that right here in bold

com<br">someone

is the first part of that break tag and right here in bold

someone@hotmail.com<br></a> [b]/>[/b

is the second part of the break tag.

That is why I keep getting /> in my messages, and why my emails all come with open ending anchor tags, turning all the text into one giant link.

I need to find out what is creating this html so I can fix this oddity.

I hope that makes sense.

Chuck S October 23rd, 2010 06:44 PM

The code for sending email/msg is in pp-inc.php in the send_ppemail function like this for messaging

Code:

Content visible to verified customers only.
There is no broken tags that I can see here. You can try changing that line above in pp-inc.php to say this and see if that helps you.

Code:

Content visible to verified customers only.

aotc October 23rd, 2010 07:47 PM

I tried looking through pp-inc.php. because I saw that comments.php and payment-verification.php (both places where the messsed up letters were being created) called on it to function, but I had no idea where to look. I'll take a look there, thanks!

Chuck S October 24th, 2010 08:25 AM

That line is right in the send_ppemail function.

aotc October 25th, 2010 02:05 PM

Changing that line didn't work.

I have been literally chasing this error all day. Let me see if I can make it any more clear where this happening, and hopefully you can point me to the code.

Step One: Somebody leaves a comment on one of my ads.

Step Two: This causes comments.php to generate a message to me telling me someone has left the comment.

Comments.php uses this template to send me the message. Note that there are no broken break tags in this template, so the template is not the problem. The area bolded is where the problem will eventually be...
^User['username'] has posted a comment to the following listing:

"^gettitle"

^Globals['maindir']/showproduct.php?product=^product (this will get a broken break tag piece, />, after it)

If you no longer wish to be notified when comments are posted to the above listing, you can disable notification here:

^Globals['maindir']/comments.php?notify=off&notifyid=^getid&product=^product (this will get a broken break tag piece, />, after it)

Thanks!

The ^Globals['webname'] Team
^Globals['domain']
Comments.php generates the message using the template above in this piece of code:

Code:

Content visible to verified customers only.
It is this line of code, $letter = str_replace("^product","$product",$letter); where the string ^product is replaced by the variable $product that the break tag is being created - whatever is in the variable $product is messed up.

$product is a link to the product that was commented on, and its in this link that there's a piece of a break tag that should not be there. This is what $product looks like when it renders on my member page html:

Code:

Content visible to verified customers only.
Notice the product=18<br" about halfway through the link. That <br is half the broken break tag, and should not be there!

At the end of the product link is the other half of the broken break tag, the /> that keeps showing up in my messages:

product=18<br></a>/><br />

So something about the contents of that $product variable is messed up. And its not just the $product variable, there are several others with the same problem, and they are all variables that contain links. For example, $toemail, $buyemail, $adid, and $buyuserid in payment_verification.php have the same problem.

I'm thinking there's a function that creates these link variables somewhere, like a function in pp-inc.php - like function convert_returns or maybe function construct_newppurl since this is only happening to variables that store links.

Anyhoo, after comments creates the comment and sends me a message about it, I go on to Step Three: I go to check my messages in my member profile area. This causes member.php to be called, and this line of code generates the HTML for the content of my message:

Code:

Content visible to verified customers only.
Step Four: The following HTML is created and rendered on my screen

Code:

Content visible to verified customers only.
Step 5: And I get a message with junk pieces of broken break tags (specifically the /> part) after all active links in my message.
From: aNGrYLiTTLeDeAdGiRL [ October 25 09:10AM ] [ Reply ]

New Comment Posted to comment tester at Attackofthecraft.com

aNGrYLiTTLeDeAdGiRL has posted a comment to the following listing:

"comment tester"

comment tester - AttackoftheCraft Handmade Shop
/> <~~ THERE'S THE BROKEN TAG PIECE

If you no longer wish to be notified when comments are posted to the above listing, you can disable notification here:

Message - AttackoftheCraft Handmade Shop
/> <~~ THERE'S THE BROKEN TAG PIECE


Thanks!
So where is this broken <br /> tag? Whew... I need a nap now.

Chuck S October 25th, 2010 02:22 PM

There is no broken tag. Thats the problem I have looked up and down. Now the email is fine right thats what saying if you select to be emailed?

So really your issue is not with the phrase.

The only place I see break tags is in the line I note about messages but they are not a problem I think.

Here is the phrase thats in the database

Code:

Content visible to verified customers only.
That is the entire phrase. There are no break tags anywhere.

Lets try this

You meantion this line

Code:

Content visible to verified customers only.
what happens if you change it to this

Code:

Content visible to verified customers only.

aotc October 25th, 2010 03:01 PM

I changed that line, and there was no difference.

I also uploaded clean versions of pp_inc.php, member.php and comments.php and the stuff is still showing up.

Chuck S October 25th, 2010 03:11 PM

well you can see there is no break tag here in the code try making the line this?

Code:

Content visible to verified customers only.

aotc October 25th, 2010 03:25 PM

Ok, that got rid of the junk, but it also removes the anchor tags and turns the links into regular text instead.

Code:

Content visible to verified customers only.

Chuck S October 25th, 2010 04:36 PM

Lets look at this from another angle.

Replace your default files with no edits then make this edit in pp-inc.php and tell me what you get

Code:

Content visible to verified customers only.
change to this

Code:

Content visible to verified customers only.

aotc October 25th, 2010 06:12 PM

Nope, that code change didn't change anything.

Chuck S October 25th, 2010 06:18 PM

well what gets me wondering here is why you have an issue its almost like the convert returns function is trying to convert something thats already html which it should not be.

Try making sure your admin options email setting is set to regular email not HTML see if that helps. Seems like your trying to setup html but your not using email just messaging. Maybe a wrong selection of options for what your doing.

aotc October 25th, 2010 07:03 PM

Turning off html email had one interesting effect. Every line of the email I received had a <br /> after it. I think this the break tag thats breaking the works...?
aNGrYLiTTLeDeAdGiRL has uploaded one or more listings to a category you subscribe to.<br />
<br />
Image name: <br />
Title: Yep really gonna pull the trigger<br />
Description: <br />
<br />
Link to listing: http://www.attackofthecraft.com/shop/showproduct.php?product=22<br />
<br />
To turn off subscriptions for this category, click on the following link:<br />
<br />
http://www.attackofthecraft.com/shop/misc.php?action=subscribe&sub=3<br />
<br />
The Attackofthecraft.com Team<br />
Attack of the Craft: A Discussion Forum for Indie Craft, DiY, and All Things Handmade - Powered by vBulletin
For now, my workaround is going to be the non-linked url method. It looks good, and they can cut and paste into their browser if need be. We've both put waaaaay too much time and thought into this :D

Chuck S October 25th, 2010 07:56 PM

I see your link is no longer broken doing that.

aotc October 25th, 2010 08:07 PM

True... and it would be perfect except for the break tag at the end of every line :D

Chuck S October 26th, 2010 09:42 AM

well I will see if there is anything I can do about that. Your generated page is an html page I just wonder why your break tags are not printing as break tags.


All times are GMT -5. The time now is 09:45 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97