Recent Topics

[2.x] Subscribe to comments by email

Started by on May 18, 2009 – Contents updated: May 18, 2009

May 18, 2009 19:22    

My b2evolution Version: 2.x

Hi ¥åßßå

I was wondering if you were still thinking of releasing your Subscribe to comments by email plugin that we talked about here:

http://personman.com/subscribe-to-comments-by-email-1

I have had a request for this from someone I installed b2evo for so would be really really really grateful if you were still going to release it. If there is still work to be done on it and you don't have time I would be more than happy to try and finish it for you if you let me know what still needs to be done.

Cheers
Lee

May 18, 2009 19:39

I actually have a zip of (a) working version ... just buggered if I can remember the url to the zip :-S

I'll find it for you ;)

Btw, I assume you got my email with your bopit membership? ... kept meaning to ask :p

¥

May 18, 2009 20:04

Excellent, forever in your debt :D

Yes, I did get your email and I hope to get round to adding everything to bopit asap. Client deadlines have been against me working on my own stuff recently but there is light at the end of the tunnel.

Once again, thanks for the plugin :D

Lee

May 18, 2009 20:40

I look forward to seeing this plugin integrated in b2evo 3.x ;)
Can I also get a zip please

May 19, 2009 10:43

Works like a charm. Great plugin

Cheers
Lee

May 19, 2009 15:47

To run the plugin in 3.x you should change the send_mail() to

PHP

// For b2evo-2.5 and up
send_mail$to$to_name$subject$temp_message$from$from_name$headers )

*edit*
Code correction

¥

May 19, 2009 17:10

I'm impressed it took you 29 minutes to find a fault in it :P

I should also pull my finger out and code the whole "subscribe to blog" bit as well ... and then there's daily/weekly/monthly summaries and .... I need longer days ;)

¥

May 19, 2009 17:14

It was interesting to sniff the unsubscribe code and compare it to my own :)

May 19, 2009 17:23

ffs, which of your plugins do I need to crack open to find yours? ... and whose did you prefer? :p

¥

May 19, 2009 17:36

It's for personal use only, pretty simple code.

PHP

function email_unsubscribe()
{
    global $DB;
    
    if( $uns_ID param'unsub_ID''string' ) )
    {
        $SQL 'DELETE FROM table_emails
                WHERE MD5(email) = "'.$DB->escapestrtolower(trim($uns_ID)) ).'"';
        
        if( $DB->query($SQL) )
        {
            $this->msg'Email successfully deleted.<br /><br />We apologise for any inconvenience caused.''success' );
        }
        else
        {
            $this->msg'Email not found''error' );
        }
    }
}

May 19, 2009 17:44

That's a pretty similar concept, I'm just a tad more paranoid ;)

¥

May 26, 2009 22:53

yabba your plugin is broken, fix it or I will destroy the human race.

May 27, 2009 17:07

Walter wrote:

yabba your plugin is broken, fix it or I will destroy the human race.

/me saves the human race by correcting sam2kb's post ;)

¥

Jun 06, 2009 16:04

Hi people, Ima havin' problems trying to install this in a 3.2x. Commenter gets this warning when clicking submit.

First intall was a version I grabbed a few weeks back.
Second install was the one Yabba linked to up there ^ .
Third intall was with Sam2kb 3.x edits also up there ^ .
Im assuming Sams edits fix the dodgy notification email the first install was sending out?

Would love to get this working. Ideas?

Code

Warning: settype() [function.settype]: Invalid type in /home/pkendon/public_html/inc/_core/_param.funcs.php on line 256
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 192
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 193
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 194
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 195
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 174
 
Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/inc/_core/_param.funcs.php:256) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 182

Jun 06, 2009 16:16

That'd be the totally unsupported beta version of b2evo right? :roll:

Just for kicks, try changing "checkbox" for "boolean" in the plugins file ( approx 242 )

PHP

/**
     * Check if the user has subscribed
     * If they have then check if we have an email address ( for visitors )
     *
     * @param mixed $params
     */
    function BeforeCommentFormInsert( & $params )
    {
        if( ( $this->subscribe param'am_subs_comment''checkbox' ) ) && empty( $params'Comment' ]->author_ID ) && empty( $params'Comment' ]->author_email ) )

Sam2kb's hack has been corrected to not kick out the funky email ;)

¥

Jun 06, 2009 16:42

Yes, sorry, the totally unsupported version.
Ie.

Code

if( ( $this->subscribe = param( 'am_subs_comment', 'boolean' ) ) && empty

?

Jun 06, 2009 16:52

No luck. I got "bad request" message.

Jun 06, 2009 17:05

Bugger, guess we need to rely on evocore and enable debugging in /conf/_advanced.php ... it should spit out the $type that's tripping the core

¥

Jun 07, 2009 08:01

Ok, see if it works as expected now ;)

¥

Jun 07, 2009 08:26

Will do :)

Im re-downloading from here?:

With a tad of luck this is the right zip ( am_subs.zip )

This includes Sam2kb's fix?

Jun 07, 2009 09:10

Urm, no, I fixed it on your server ;)

¥

Jun 07, 2009 09:25

Oh shit, I just went in to upload new and saw one there (yes, surprised).
I did a test comment and yes, got an error (though somewhat longer than the first one - which I didnt record) so went in and uninstalled then deleted from ftp ....ready to start over.

:oops:

Jun 07, 2009 09:54

You uploaded, I install ?

If yes....

Notice: Undefined variable: to in /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php on line 381

Notice: Undefined variable: to_name in /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php on line 381

Notice: Undefined variable: from in /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php on line 381

Notice: Undefined variable: from_name in /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php on line 381

Notice: Undefined variable: headers in /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php on line 381

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/htsrv/comment_post.php on line 334

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/htsrv/comment_post.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/htsrv/comment_post.php on line 336

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 192

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 193

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 194

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 195

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/pkendon/public_html/plugins/am_subscriptions_plugin/_am_subscriptions.plugin.php:381) in /home/pkendon/public_html/inc/_core/_template.funcs.php on line 182

Jun 07, 2009 10:00

Try again ( no need to uninstall re-install )

¥

Jun 07, 2009 10:13

Bingo!

* boogey icon *

Thank you :)

Jul 04, 2009 22:05

I guess I am relieved to know that my blog gave the same basic error.

We are running 3.2 & gave this plug in it a try but, no luck.

I have been trying to do a mind meld with ¥åßßå so, I can figure this out. So far no code is coming to me but, I have had some really weird dreams. :lol:

Jul 05, 2009 01:25

Hi SLoch,

Whatever YaBBa did to mine is working but he had access to my server so made adjustments there. I don't know but, do you think I can zip it up for you?

Jul 05, 2009 01:38

there's some little hack for this plugin on 3.x, have you seen?

Jul 05, 2009 02:23

Ive just installed YaBBas edited Am-Subs on another 3.x Im working on and all good (so far).

Ive zipped it up for you (if this isnt a good idea then by all means dont use it ;) ).
Hopefully YaBBA doesnt mind? Readme and license is original.

http://www.gigabobhosting.com/Am_Subs3x.zip

Give it a go?

Jan 26, 2010 17:53

I am fairly new to b2evolution and there are certainly some things that I still dont understand. I downloaded the subscriptions plugin and installed it, but I get an error message very similar to GigaBob's. Would someone be able to help me. Thanks in advance.

May 21, 2010 13:06

Hello,

Is it possible obtain the code for the version that works correctly in 3.x?

GigaBob, the link you have posted is dead.

I downloaded the latest version which was linked on page 1, then applied the changes suggested by Sam2kb, but continued to receive the same errors as mentioned by others.

YaBBa's magic changes were not reflected here, so I am stuck.

Help will be greatly appreciated.

May 22, 2010 22:24

You'd need to hope that someone in this thread has the working code because I've stopped supporting the evocore from 2.x.7 onwards.

¥

Jun 16, 2010 18:24

I spent some time tinkering with it and after reviewing various threads on this forum, I succeeded.

Here is the result:
http://pastebin.ca/1884419 (I set the expiration to 'never', which probably means "you never know...") (-;

Or you can download a single ZIP from this address:
railean.net/files/temp/am_subscriptions_plugin-101.zip (not guaranteed to be valid for an eternity)

Changes that were made:
- the parameters for str_replace were written as $var$, while the message contained %var%
- inside BeforeCommentFormInsert, change 'checkbox' to 'string'
- the email sending function called near "// now lets delight them with our shiny personalised message" was not called properly
- added "// grab the rendered comment content", to capture the body of the comment itself

As far as I remember, these were the changes; except one more change (from 'boolean' to 'checkbox' somewhere in the code, but I don't remember where).

In case the files are not available anymore, you can use this pseudo-changelog to re-do the process.

I tested this on my setup of b2evo 3.3.3. If someone else is willing to give it a try, it would be great if you could provide feedback soon, such that I could tinker with it while it is still fresh in my mind.

Jun 16, 2010 19:07

Future bug alert :

PHP

$sql 'select ping_id from '.$this->get_sql_table('pings').' where '.( $type 'comment' 'comment' 'post' ).'_id = '.intval$which );

Should be $type == ;)

Good to see your code improvements, it's what OSS is all about ;)

¥

Jun 16, 2010 19:19

Thanks for pointing that out; it was like that before I got to it (-:

Does a trick that works in C work here too? I refer to "Yoda conditions", when you place the constant at the left of a comparison operation, such that if you accidentally type = instead of ==, the compiler says that you're trying to modify a constant.

PHP

if 'comment' == $type

Note: the change was applied, the ZIP on the site is up to date.
The new pastebin excerpt: http://pastebin.ca/1884504[/php]

Jun 16, 2010 20:05

gr8dude wrote:

Thanks for pointing that out; it was like that before I got to it (-:p

Pretty sure the person who created the bug was both cute and blonde .... and I have long hair :roll:

gr8dude wrote:

Does a trick that works in C work here too? I refer to "Yoda conditions", when you place the constant at the left of a comparison operation, such that if you accidentally type = instead of ==, the compiler says that you're trying to modify a constant.

I've never played with C+{,2} ( if I was gonna head along that path I'd go back to asm, nothing like *real* control ;) ), betting it doesn't work though, php is hardly a "strict" language

¥


Form is loading...

Content Mangement System – This forum is powered by b2evolution CMS, a complete engine for your website.