 | |  |
 |

terrill
User
Aug 21, 2002, 8:21 PM
Post #1 of 15
(7808 views)
Shortcut
|
|
"Email All Authors" script
|
Can't Post
|
|
UPDATE: WebGuys and I have made TWO updates to the script! PLEASE USE the last one posted! Skip the first updated file WebGuys posted (Todd, could you delete it, please?). The newest version uses Artman User ID's and Passwords before someone can send messages to EVERYONE in your Author list. ----------------------------------------------------------------------------------------- Got something you'd like to send to all of your authors? You know, like what's new in the latest release of Artman you just installed? Got a phone call from Martha Stewart, and you've got a "Hot Stock" tip? The attached script: - Reads your account.dat.cgi data.
- Displays a form with ALL the Authors names checked and ready to send them an email.
- A button for clearing all the checkboxes so you can do it manually for a select group of Authors.
- A button to cancel and go to your home page.
- And, a magic button to send the message, if you'd like!
NOTE: This was written for Unix/Linux servers!!! It MIGHT work on your Windoze server, but you'll have to discuss the following requirements with your Server Admin: Requirements (Unix/Linux or Windoze): - The Perl module Mail::Mailer .
- Sendmail (you could use another mail package. Ask your Admin and a Perl Programmer) .
- Edit your Authors, and add one line containing their email address (see below).
Hey! It Won't Hurt to edit ONE Author (Yourself, maybe?), load the script, and SEE if it works on your server! If it runs, cool. If not: call your Admin... they need work, too. Most Unix/Linux servers should have sendmail (a LOT of other email programs use it under the hood). The question would be, does it have the Perl Module Mail::Mailer? Chances are good that, if you've got an "on-the-ball" hosting service, it's there! Modifications to Artman: In each Authors information, add the line (preferably at the top) in the "Notes" box: mailto:joe@somewhere.com Please note that the word "mailto:" is cAsE SenSItive in my script, and must be lowercase. The email address part, it doesn't matter... feel free to turn the CAPS LOCK KEY ON IF YOU'D LIKE after the colon. Hit enter so it's on a line by itself. That's it for the Artman mods. Next, upload the attached script to your cgi-bin below where your "artman/data" directory is located. Edit the script. There are five lines of code YOU have to edit, for paths, return email address and titles. Save the script, chmod 755, get your handy-dandy browser out, and go send a message! If an Author DOES NOT have an email address in their "Notes" they DON'T appear in the list. It ain't a pretty-looking form, and the script has a work-a-round in it (does more work than it should have to) because my hosting service crippled sendmail. My host only allows one receiver per message to help prevent spamming. So, it takes longer than it should... but hey, it gets the job done! And, it'll work on your host if they've cripple sendmail, too. That's a benefit, actually! I already have other ideas for improvements, like, a multiple selection listbox with Author levels, so you can select by level. Haven't decided if it's that important to me, yet. Might take me a week or two. If you send me $1,000,000 USD in Bearer Bonds, I might consider additional improvements. Oh, a "Subject:" field will only cost ya $100,000... or, you can modify the code your self. You'll learn more if you do it, me thinks. Enjoy! I'm going back and tinker... I see from recent posts, I have more work/fun ahead. -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 22, 2002, 12:52 PM)
|
|
|  |
 |

WebGuys
User
Aug 21, 2002, 9:47 PM
Post #2 of 15
(7801 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Great script, seems to work good :) Thanks Terrill, Good job :) I have updated the ArtMail file from the previous post to clean up the html formatting, I have added support from the User Interface files in the AM images directory so it will look like the rest of AM Added 2 variables: # URL to your sites User Interface Directory NO Trailing "/" $UIDirectory = 'http://www.YOUR-DOMAIN.com/artman/images'; # Powered By statement $powered = 'Little Green Men'; It all works on my system so..... I called this file artmail2.cgi so you could impliment and run both Thanks again Terill WebGuys
(This post was edited by WebGuys on Aug 23, 2002, 6:42 AM)
|
|
|  |
 |

terrill
User
Aug 22, 2002, 4:37 AM
Post #3 of 15
(7787 views)
Shortcut
|
|
Re: [WebGuys] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
MOST execllent! "Robot" meta statements, Cascading Style Sheets and everything! You [ ] were up late last night, weren't you? I noticed, while reading your additions, that I neglected to add the "CUT HERE" marks in the original. So, I'll add them when someone sends me (us, now.. I'll share!) that Million U$D to add the "Subject:" field. On an HTML side note, I also noticed that you (like myself) DON'T "format" the HTML so that the </td>'s are on a line by themselves. While I haven't checked browsers recently, older browsers ADD a space in the cell at the end if the </td> is on a line by itself. I've seen numerous people complaining when they have nice images in side-by-side cells, and the darn things just won't close up... they always have a gap between 'em (horizontally, or vertically). That's the cause! When you explain it to them and they try: <tr> <td>image1</td> <td>image2</td> <tr> And their images now come together as they'd planned, it amazes them! Nice job, Todd! Ain't collaboration fun? -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
|
|
|  |
 |

WebGuys
User
Aug 22, 2002, 5:38 AM
Post #4 of 15
(7780 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Ahhh thank you, thank you, a kind word goes far ( alot farther than cash these days) I do appreciate it :) I wanted to make it so the mailto: was automatic but alas the eyes were falling out of sockets as it was. So i didnt mess with it. If you get that million, dont mention my name, i dont want to deal with the taxes on it, and the little green men might figure out they are supposed to get paid for thier work on this planet. My host, LeadingMedia.com keeps all the perl up to date, so the The Perl module Mail::Mailer worked fine btw..... Oh Ya, I added the subject field as a variable, so now it can at least be changed easily. # Subject of the email, what do YOU want it to say? $subject = 'Site News'; So this is the revised script, use it not my last one anyway thanks for the script :) Todd * Feel sorry for me, janet reno is running for govenor in my state *
(This post was edited by WebGuys on Aug 23, 2002, 6:43 AM)
|
|
|  |
 |

terrill
User
Aug 22, 2002, 12:49 PM
Post #5 of 15
(7757 views)
Shortcut
|
|
Re: [WebGuys] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Todd (and everyone else): Updated the program. I've added: - Subject field
- User ID field
- Password field
The form now has a place for all the above. When you click the SEND button, the script validates the ID and Password you you entered against your User ID and Password in Artman. If they match, it sends the message. If they don't match, it insults your intelligence and suggest you use your Back button to try again. This will reduce the possibility that someone who happens upon THIS site (Interactive), reads the forum, finds the appropriate post (ah, hmmm: THESE threads), they won't come visiting anyones site looking for artmail.cgi!!! They'll need a valid Author account to send. I'm removing my previous attachements to make life easier for all. Download the attached script named artmail.cgi, follow the instructions inside! If you've already downloaded the previous posts from Todd and I, you should rename your old artmail.cgi to something like artmail0.bak. You can cut and paste things FROM your backup INTO the new script. IF you do, future updates will be painless (now that I know someone else is going to be modifying them ). I'm even thinking of writing an insall script... well, actually, two: one in Perl, one in Vim-script for those Vim users amongst us!-) >>> TO DO <<< * Offer a link to go "Home" or send another message on the results screen after sending a message. * Add a textbox where you can hand-type additional email addresses to be included in the send, separated by semi-colons (why do they call 'em "Semi colons? Don't they use more ink than a colon?). * Convert this to a form where viewers can click a link and reply to an article online, where the article headline is automatically included. Form pops-up in a "new" window, and includes the viewer's IP address (cuts down junk mail) which the viewer can not remove it. * Alter it slightly to make an IRC Chat application so the viewer can talk with others online that have read the article. * I'm getting another drink. I think I'm going too far!?! Enjoy! -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 22, 2002, 1:09 PM)
|
|
Attachments:
|
artmail.cgi
(16.2 KB)
|
|
|  |
 |

WebGuys
User
Aug 22, 2002, 3:52 PM
Post #6 of 15
(7747 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
NIce work, beat me to the punch :( one little problem, try leaving the user and password blank and see what happens... See, see, i told you... oh well, will look at it more when i get a chance also... BTW I LOVE THE IRC IDEA let me know what i can do to help, also, I agree with you about the semicolon, who do we talk to about this? we need to nip this in the bud now.... :) Have a great Day all Its only 24 hours till BRISTOL weekend, best racing of the season! WebGuys
|
|
|  |
 |

synergy
User
Aug 22, 2002, 4:05 PM
Post #7 of 15
(7745 views)
Shortcut
|
|
Re: [WebGuys] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
terril, now that you've done nearly all the work, i guess we will see workflowmanagement in 2.0(am-team:HINT!) kind regards.
|
|
|  |
 |

MalaK_3araby
User
Aug 22, 2002, 9:04 PM
Post #8 of 15
(7734 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
terrill & WebGuys Good Job indeed. Thanks for this addon. -------------- Sure you can spell it, but do you get it?
|
|
|  |
 |

noza
User
Aug 22, 2002, 10:00 PM
Post #9 of 15
(7732 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Hi... where is the script for download ?? Pat
|
|
|  |
 |

terrill
User
Aug 22, 2002, 11:32 PM
Post #10 of 15
(7730 views)
Shortcut
|
|
Re: [noza] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Noza, You have to look closely: attachments are located just below the message. It shows the file name and size. EVERYONE: attached to this post are three files: - artmail3.cgi - for people who HAVE NOT installed it yet. Requires you change variables.
- artmailu3.txt - cut-and-paste for people ALREADY using the scripts. No variables to change!
- vimusers.txt - for people with Vim AND using the previous version. (MAY work with the old vi editor).
This update fixes the "if you don't enter a user ID and Password, send the message anyway" problem someone didn't consider. (Wonder who THAT was!-O). Again, if you HAVE NOT installed a previous version, all you need is artmail3.cgi. Download it, rename it to artmail.cgi, chmod 755 on it, and edit the program making the changes indicated inside it. How do you know if you have vim? At your unix/linux prompt, type the command "vi" (without the quotes). It'll open without editing a file. If it's vim, you'll see an introductory screen stating it's vim and what version. press the keys ":q" (without the quotes) and you'll exit. IF YOU DO NOT HAVE VIM or you want to make the changes by hand, and YOU INSTALLED A PREVIOUS VERSION: In your old version, delete EVERYTHING BELOW the "CUT HERE" line. Copy artmailu3.txt, and paste at the bottom of your old script. That's it! IF YOU HAVE VIM and if you HAVE already installed artmail.cgi from a previous post: * Download artmailu3.txt and vimusers.txt. You DON'T need artmail3.cgi!!! * Edit your old artmail.cgi with vim and press the keys ":w%.bak" (without the quotes) and hit enter. That just made your backup. Then, type ":e vimusers.txt" and hit enter. * READ the instructions inside. If you follow those instructions, *I* will edit artmail.cgi (your older version), delete everything from the CUT HERE line, read in the changes, save the NEW version over your old version, and delete artmailu3.txt and vimusers.txt. Automatic. I like automatic! I Love Vi!!! Enjoy! -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 22, 2002, 11:39 PM)
|
|
Attachments:
|
artmail3.cgi
(17.4 KB)
|
|
|
artmailu3.txt
(14.1 KB)
|
|
|
vimusers.txt
(1.13 KB)
|
|
|  |
 |

WebGuys
User
Aug 23, 2002, 6:34 AM
Post #11 of 15
(7717 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Hey all, I made a few more changes to Terrill's script, Change made: 1. Moved Location of variables for "Powered By" and "acount.dat.cgi" to the top section for easier changes due to possible non-standard installations, (moving the variables above the ###---------------CUT HERE FOR FUTURE UPDATES---------------### will aid in future upgrades.... 2. Added Site Title variable ( changed format ) 3. Modified the Look and feel by removing table borders 4. added a cutom variable for the bad User or Pass message * These are all slight changes but do require the the entire script be replaced Sorry kids Todd
(This post was edited by WebGuys on Aug 23, 2002, 6:38 AM)
|
|
Attachments:
|
artmail4.cgi
(17.9 KB)
|
|
|  |
 |

terrill
User
Aug 23, 2002, 7:13 AM
Post #12 of 15
(7706 views)
Shortcut
|
Re: [WebGuys] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Small note (and coming from me, that's close to a "miracle," isn't it?): If you leave Todd's name change for the script as artmail4.cgi... - Your users who have bookmarked the location in their browsers will now get a 404 Page Not Found until they update their bookmarks.
- On future updates from me, you won't be able to use my handy-dandy vim Update Automation commands.
Changing the scripts name isn't a big deal if only one or two people are using it. But, if you offer the scripts use to a couple million authors, your choice is: you do a little work to update the script and a couple million authors do a lot (like sending you email asking "where'd it go?"), OR, you do a little extra work and the millions just keep doing what they've always done. Back to work... I have a World to paint! -- Terrill --
"Evaporating expectations of quality: 1980's paradigm: If it's worth implementing once, it's worth implementing twice. 1990's paradigm: Ship the prototype! 2000's paradigm: Ship the idea!" ---Larry Rosler: http://www.perl.com/pub/a/2000/06/rosler.html
(This post was edited by terrill on Aug 23, 2002, 7:18 AM)
|
|
|  |
 |

WebGuys
User
Aug 23, 2002, 8:20 AM
Post #13 of 15
(7701 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Hi Kids, already sent a message to Terrill, so this is aimed at you ( qwik duck down ) the reason I named the file artmail4.cgi is strictly to test the script without messing up your current installation, if artmail 4 works for you, just rename it artmail.cgi and change the link in the script to relect the change,, # This scripts location #my $THISFORM = 'http://somewhere.com/cgi-bin/artmail.cgi'; my $THISFORM = 'http://somewhere.com/cgi-bin/artmail4.cgi'; this will allow it to be updated. Sorry for the confusion, thats what i get for listening to the voices in my head.... Yours humbly and broke, Todd
|
|
|  |
 |

terrill
User
Aug 23, 2002, 9:30 AM
Post #14 of 15
(7695 views)
Shortcut
|
|
Re: [WebGuys] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Oh, no! TWO people who hear those voices. Glad to know I'm not alone! Curious, have your voices mentioned anything about the World coming to an end? We should share notes... And, on the topic of notes, I've decided to incorporate the "Send Feedback to an Article Author" concept into the script. Never thought it'd go this far, but hey... I need a life, right? Unless there are other bugs found (one, to date), don't hold your breath for an update to this script from me. Todd and I are sharing ideas in the background. Feel free to send us suggestions. Just remember, we're horribly understaffed, and the workload is getting heavier by the millisecond! Todd and I are requesting overtime pay, but so far, our Boss has eluded us.
|
|
|  |
 |

WebGuys
User
Aug 23, 2002, 1:37 PM
Post #15 of 15
(7689 views)
Shortcut
|
|
Re: [terrill] "Email All Authors" script
[In reply to]
|
Can't Post
|
|
Well folks, If that last post didnt scare the bejesus out you then i dont know what will. I know that something good should come of this little project, if not "IT WAS ALL TERRILL'S IDEA" and I plead the 5th... Hope to have something soon for you guys to try out and want more changes to, i know i live for changes.... and if anyone sees the boss, ask about that overtime pay. Todd
|
|
|  |
|