[mod] View HTML Email in Browser

3rd party code for phpList

Postby Guest » 4:19am, Thu 15 Jan, 2009

xannonite wrote:
iammcse wrote:I kept having trouble with the field "uniqid" not inserting into the table, everything else seems fine.

messageid uniqid data modified
77 <html> 20:25:38

I have the latest one installed[/img]


The last link posted actually points to v1.2. Make sure you have version 1.2.1. The location is the same, but the filename is phplist_vib_mod_1.2.1.zip.

Otherwise, if you could dump your messageview table structure and post it or send it to me, I can see if everything is setup correctly.

Did you create the table using the .sql file, or did you use the 'initialise database' function on the admin page?

p.s. If you posted an error message, it didn't display properly. Try disabling HTML in the post or using the [ code ] BBCode tag.


Thanks for your quick response.

Yes, I downloaded phplist_vib_mod_1.2.1.zip right after I am having the trouble with the table then replace the vm.php, dropped the old table, follow the instruction again and created an new table using the .sql file given.

No errors were found. It just takes longer to load and send email now, the script did ok with the fields messageid, data, modified but "uniqid" is blank all the way.

My platform setup:
Windows XP
Wampserver(current verion)
phpMyAdmin(used for updating the .sql)
Phplist(current version)
MOD CKfinder for FCKeditor

BTW, I couldn't add attachment to this post. Is that because I am newbie here?
Guest
 

Postby xannonite » 11:14pm, Fri 16 Jan, 2009

iammcse wrote:Thanks for your quick response.

Yes, I downloaded phplist_vib_mod_1.2.1.zip right after I am having the trouble with the table then replace the vm.php, dropped the old table, follow the instruction again and created an new table using the .sql file given.

No errors were found. It just takes longer to load and send email now, the script did ok with the fields messageid, data, modified but "uniqid" is blank all the way.

My platform setup:
Windows XP
Wampserver(current verion)
phpMyAdmin(used for updating the .sql)
Phplist(current version)
MOD CKfinder for FCKeditor

BTW, I couldn't add attachment to this post. Is that because I am newbie here?


If you aren't getting any SQL errors, it sounds to me like the $userid variable is blank at the time of sending. If you open your phplist_user_user table, do all of your users have values in the uniqid column? Is the uniqid column still blank if you send a test message to a single address?

I think attachments might not work for anyone. However, you can't post links either until you hit 10 posts.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Postby Guest » 10:07am, Mon 19 Jan, 2009

xannonite wrote:
iammcse wrote:Thanks for your quick response.

Yes, I downloaded phplist_vib_mod_1.2.1.zip right after I am having the trouble with the table then replace the vm.php, dropped the old table, follow the instruction again and created an new table using the .sql file given.

No errors were found. It just takes longer to load and send email now, the script did ok with the fields messageid, data, modified but "uniqid" is blank all the way.

My platform setup:
Windows XP
Wampserver(current verion)
phpMyAdmin(used for updating the .sql)
Phplist(current version)
MOD CKfinder for FCKeditor

BTW, I couldn't add attachment to this post. Is that because I am newbie here?


If you aren't getting any SQL errors, it sounds to me like the $userid variable is blank at the time of sending. If you open your phplist_user_user table, do all of your users have values in the uniqid column? Is the uniqid column still blank if you send a test message to a single address?

I think attachments might not work for anyone. However, you can't post links either until you hit 10 posts.


Yes, you are correct. I've overlooked the error on the screen. It said: "Database error 1062 while doing query Duplicate entry '176-' for key 1". And I guess this is normal because both messageid and uniqid formed the primary key. Is there any other information that can help you to find where the problem lies on?
Guest
 

Postby xannonite » 5:13pm, Mon 19 Jan, 2009

iammcse wrote:Yes, you are correct. I've overlooked the error on the screen. It said: "Database error 1062 while doing query Duplicate entry '176-' for key 1". And I guess this is normal because both messageid and uniqid formed the primary key. Is there any other information that can help you to find where the problem lies on?


Yeah, if your uniqid variable is always blank, then the query will fail after the first submission. Just to confirm, though, do you have values in the uniqid column in the php_user_user table? If not, then the problem would be outside the scope of this mod.

If you do have uniqid values in the php_user_user table, try sending a test message with the [USERID] tag in the contents. If it shows up, then that means something is clearing the uniqid variable before I reference it. If it does not show up, then there is likely some other bug unrelated to this mod. You can further test that, of course, by replacing sendemaillib.php with the original copy and testing the [USERID] tag again.

What version of phplist are you running? I tested this mod on version 2.10.8.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Postby Guest » 3:58am, Tue 20 Jan, 2009

xannonite wrote:
iammcse wrote:Yes, you are correct. I've overlooked the error on the screen. It said: "Database error 1062 while doing query Duplicate entry '176-' for key 1". And I guess this is normal because both messageid and uniqid formed the primary key. Is there any other information that can help you to find where the problem lies on?


Yeah, if your uniqid variable is always blank, then the query will fail after the first submission. Just to confirm, though, do you have values in the uniqid column in the php_user_user table? If not, then the problem would be outside the scope of this mod.

If you do have uniqid values in the php_user_user table, try sending a test message with the [USERID] tag in the contents. If it shows up, then that means something is clearing the uniqid variable before I reference it. If it does not show up, then there is likely some other bug unrelated to this mod. You can further test that, of course, by replacing sendemaillib.php with the original copy and testing the [USERID] tag again.

What version of phplist are you running? I tested this mod on version 2.10.8.


Yes I do have uniqid column in the php_user_user table. Then I inserted [USERID] to my content and I got the ID. I will replace the original file to see what happen next. Thanks!!!
Guest
 

Postby mckeephoto » 5:19pm, Thu 29 Jan, 2009

Probably an easy fix but I keep getting a forbidden access error when I click on the link in the email:

You don't have permission to access/lists/vm.php on this server.

what should I do to fix that? Thanks!
mckeephoto
PL Nut
 
Posts: 27
Joined: 5:16pm, Thu 29 Jan, 2009

permission denied - fixed!

Postby mckeephoto » 5:29pm, Thu 29 Jan, 2009

Okay, I figured it out. I opened .htaccess in textwrangler and added vm.php to the code:

(index.php|dl.php|ut.php|lt.php|download.php|vm.php)
mckeephoto
PL Nut
 
Posts: 27
Joined: 5:16pm, Thu 29 Jan, 2009

Postby bwhite757 » 1:30am, Tue 24 Feb, 2009

Awesome add-on, great job. Works great on my site, and was definitely something I was looking for!!!
bwhite757
phpLister
 
Posts: 8
Joined: 12:37am, Sat 21 Feb, 2009

Postby Kastnerd » 1:53pm, Fri 27 Mar, 2009

I have MySQL client version: 4.1.22 and because of this the SQL files wont load for me.
Kastnerd
phpLister
 
Posts: 6
Joined: 1:03am, Sat 07 Mar, 2009

Postby Kastnerd » 1:55pm, Fri 27 Mar, 2009

MY phpMyAdmin - 2.11.9.4 and your was 3.0
Kastnerd
phpLister
 
Posts: 6
Joined: 1:03am, Sat 07 Mar, 2009

Re: [mod] View HTML Email in Browser

Postby tracybach » 10:02pm, Sat 18 Apr, 2009

I'm having some trouble getting this to work.

When I click "Send Test Mesage" after editing content, instead of getting the message sent response I am getting the error message
"Database error 1146 while doing query Table 'kaioh3_phplist.phplist_messageview' doesn't exist"

It sends the e-mail despite this error message but the link to view in browser gives me a 404 error message on my site instead of showing me the e-mail in the browser.

I did a dbcheck and it says the database structure messageview doesn't exist but, my code in structure.php looks like this:
Code: Select all
    "translation_data" => array(
      "id" => array("integer not null","Translation ID"),
      "item" => array("varchar(100)","Item to translate"),
      "primary key" => array("(id,item)","")
    )
*/
   "messageview" => array(
      "messageid" => array("integer not null", "Message ID"),
      "uniqid" => array("varchar(255)","Unique ID for User"),
      "data" => array("text","Data"),
      "modified" => array("timestamp","Modified"),
      "primary key" => array("(messageid,uniqid)",""),

    ),
);

?>


EDIT:
I managed to get rid of the error message by going to "Set Up" under "System Functions" on the main page and then clicking on "go there" beside "Initialise Database" and it installed the missing table. However, the link is still not working on the test message.

Any Ideas?
tracybach
phpList newbie
 
Posts: 3
Joined: 7:13pm, Sun 05 Apr, 2009

Re: [mod] View HTML Email in Browser

Postby xannonite » 6:50pm, Mon 27 Apr, 2009

Sorry for the delay. For some reason I was no longer subscribed to this topic.

@Kastnerd:

Yes, I dumped the SQL from MySQL 5.0 using phpMyAdmin 3.0. For those of you who cannot get the .sql file to work, you can use the database initialization function in the phplist admin control panel, assuming you've made the necessary modifications as per the mod's installation instructions.

@tracybach:

Make sure you've copied vm.php to the 'lists' folder (or wherever your phplist root is.) Also make sure you've set the proper permissions on the file. If you are using Apache, you may also need to add vm.php to your .htaccess file as mckeephoto mentioned.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby houseofcakes » 5:12pm, Wed 17 Jun, 2009

Hi,
This mod works great up to the point of the link. I have two questions.

1. When I click on the "click here" link, it sends me to this page whereas I get the 404 page not found error:
http://www.nylaserskincare.com/lists/vm ... 05fb78a046
My vm.php file permission is set to 755--should it be different?

2. Also, if I keep trying to send test messages, phplist tells me that:
Database error 1062 while doing query Duplicate entry '22-f18d387de5ff1a9040ccc805fb78a046' for key 1

So, I'm kind of stuck in a loop until I can figure out the 404 issue. Do I have perms wrong? I also added vm.php to the phplist .htaccess file.

Thanks!
Karen

EDIT Ok, I figured it out. For some reason, my .htaccess did not record the addition of vm.php. Uh, that only took me 2 hours of proofreading! THANKS--this is a GREAT mod and they should just make it part of phplist. OMG. I need more coffee.
Last edited by houseofcakes on 6:47pm, Wed 17 Jun, 2009, edited 1 time in total.
houseofcakes
PL Nut
 
Posts: 17
Joined: 4:35pm, Wed 17 Jun, 2009

Re: [mod] View HTML Email in Browser

Postby xannonite » 5:59pm, Wed 17 Jun, 2009

houseofcakes wrote:1. When I click on the "click here" link, it sends me to this page whereas I get the 404 page not found error:
http://www.nylaserskincare.com/lists/vm ... 05fb78a046
My vm.php file permission is set to 755--should it be different?


Yes, 755 should work. Unfortunately there is no way for me to troubleshoot the cause of your 404 without access to your server configs and logs. I recommend creating a test file and placing it in the same folder as vm.php, then see if you can access it. You could also try deleting the .htaccess file. If you are using rewrite rules, that could also be causing a problem. Ultimately you will need to check your web server's log to see what the exact error is.

2. Also, if I keep trying to send test messages, phplist tells me that:
Database error 1062 while doing query Duplicate entry '22-f18d387de5ff1a9040ccc805fb78a046' for key 1


The primary key in the messageview table consists of the messageid and the uniqid, so you can't have two rows with the same messageid/uniqid combination. The messageid should be auto-incrementing every time you create a new message (you'll see it in increment in the address bar.) If it's not (which is a separate problem,) you can manually edit the table structure to temporarily remove the primary key, or you can simply delete the row created each time.
xannonite
PL Nut
 
Posts: 36
Joined: 4:50pm, Tue 24 Feb, 2009

Re: [mod] View HTML Email in Browser

Postby houseofcakes » 6:52pm, Wed 17 Jun, 2009

The primary key in the messageview table consists of the messageid and the uniqid, so you can't have two rows with the same messageid/uniqid combination. The messageid should be auto-incrementing every time you create a new message (you'll see it in increment in the address bar.) If it's not (which is a separate problem,) you can manually edit the table structure to temporarily remove the primary key, or you can simply delete the row created each time.


THANK you for your response as troubleshooting the .htaccess is where I finally ended up :) It works now :) yay. This is a really awesome mod and sooo helpful and I'm so glad I found it as searching this forum is kind of a beast.

Anyway, Yes, the issue is that if I edit an entry, it doesn't know to create a new messageid (but I think might be a phpList issue?) as the table has only the original messages in it. This could be an issue if you are testing emails before sending as once you send the test email, it creates the id. Does it rewrite the "data" field? I'll have to check.

Thanks again!

Karen
houseofcakes
PL Nut
 
Posts: 17
Joined: 4:35pm, Wed 17 Jun, 2009

PreviousNext

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 2 guests