Not logged in. · Lost password · Registration disabled
Page:  1  2  next 

All posts by peterve (20)

topic: @@post_notification_body stopped working  in the forum: Bugs / Fehler
peterve #1
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
Subject: @@post_notification_body stopped working
Hi,

I have noticed that, for some reason, the @@post_notification_body tag in my page to allow visitors to subscribe does not work anymore.

I already tried disabling some of the plugins which I installed over the last weeks, but nothing seems to help.

When I look at the source code, I see this :
<p>@@post<em>notification</em>body</p>

Is there a way to fix this, or change the tags (not to use underscores for example) ?

thanks

http://www.corelan.be:8800/index.php/post_notification_header/
topic: Auto Subscribe when new user registing  in the forum: Files & Mods / Datein & Mods
peterve #2
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1764
I like this feature a lot, however it would be nice to see a checkbox in the registration page to allow the user to subscribe when he or she registers
Do you think that would be possible ?
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #3
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1297
I can second this - new version fixed the problem

thanks - as far as I'm concerned, this issue is resolved
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #4
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1287
that is correct
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #5
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1285
seems to work fine now :-)
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #6
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1281
sorry - still does not work

in the code, you are setting the $ip variable, and performing checks on the value of $ip, but in the Insert statement, you are using the ip2long function again, instead of the $ip variable :-)

$ip = sprintf('%u', ip2long($_SERVER['REMOTE_ADDR']));
if($ip < 0 || $ip===false) $ip = 0; //This has changed with php 5
$wpdb->query("INSERT INTO $t_emails (email_addr,date_subscribed, act_code, subscribe_ip) ". "VALUES ('" . $wpdb->escape($addr) . "','" . post_notification_date2mysql() ."', '$code', " . ip2long($_SERVER['REMOTE_ADDR']) . ")");
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #7
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1271
tried it, did not work
I think you need to add a check on whether the ip is empty or not (not just less than zero or false)
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #8
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1267
as a quick and dirty fix, I have modified the functions.php file :

I have indicated the lines that were added or modified :

function post_notification_get_mailurl($addr, $code = ''){
    GLOBAL $wpdb;
//added by Peter Van Eeckhoutte
    $remip=ip2long($S_SERVER['REMOTE_ADDR']);

    if ($remip == '')
    {
        $remip=0;
    }
    if ($remip < 0)
    {
        $remip=$remip * -1;
    }
//end add
    if(strlen($code) != 32){
        $t_emails = $wpdb->prefix . 'post_notification_emails';
        $query = $wpdb->get_results("SELECT id, act_code FROM $t_emails WHERE email_addr = '" . $wpdb->escape($addr) . "'");
        $query = $query[0];
        $debug .=  "\n--DB-Debug--\n";
        $debug .= "ip: $remip\n";
        //Get Activation Code
        if (($query->id == '') || (strlen($query->act_code) != 32)) { //Reuse the code
            mt_srand((double) microtime() * 1000000);
            $code = md5(mt_rand(100000, 99999999) . time());
            $debug .= "code: $code\n";
            if($query->id == ''){
                //$ip = ip2long($_SERVER['REMOTE_ADDR']);
                $ip=$remip;
                $debug .="ip: $ip\n";
                if($ip===false) $ip = -1; //This has changed with php 5
                $debug .= "query: INSERT INTO $t_emails (email_addr,date_subscribed, act_code, subscribe_ip) ". "VALUES ('" . $wpdb->escape($addr) . "','" . post_notification_date2mysql() ."', '$code', " .     $remip . ")\n";
//modified insert statement, replace ip2Long function with $remip - modified by Peter Van Eeckhoutte

                $tmp=$wpdb->query(
                    "INSERT INTO $t_emails (email_addr,date_subscribed, act_code, subscribe_ip) ". "VALUES ('" . $wpdb->escape($addr) . "','" . post_notification_date2mysql() ."', '$code', " . $remip . ")");
//modified insert statement, replace ip2Long function with $remip - modified by Peter Van Eeckhoutte

                    var_dump($tmp);
            } else {
                $debug .= "--Update--\n";
                $wpdb->query(
                    "UPDATE $t_emails SET act_code = '$code' WHERE email_addr = '" . $wpdb->escape($addr) . "'");
            }
        } else {
            $debug .= "--Indb--\n";
            $code = $query->act_code;
        }
        $debug .= "--DB-Debug-End--\n";
    }
    //Adjust the URL
    $debug .= "run";
    $confurl = post_notification_get_link();
    if(strpos($confurl, '/?') || strpos($confurl, 'index.php?')) $confurl .= '&';
    else                        $confurl .= '?';
    $confurl .= "code=$code&addr=$addr&";
//disabled the following line - modified by Peter Van Eeckhoutte
    //$confurl .= "debug=$debug";
    return $confurl;
}
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #9
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1266
when I run the insert code myself, I receive the following warning :
1264 - Out of range value adjusted for column 'subscribe_ip' at row 1

The value for the IP appears to be a negative number...  if I change it to a positive number and then follow the subscription link in the email, it works

I guess you know how to solve this, right :-)


One more question: can users change their subscriptions later on ?
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #10
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1265
tried it - got the email with debug code, but the database is still empty
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #11
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1264
done
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #12
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1262
file is in place
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #13
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1256
the link should now work again
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #14
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1253
Quote by peterve:
may be a silly quesiton : where can I get today's release ?

thanks

update : if version 1.2.22 is the latest version, then I can confirm that the problem still exists

see for yourself at http://www.corelan.be:8800/index.php/post_notification_header
topic: subscription email goes back to subscription page  in the forum: Bugs / Fehler
peterve #15
Member since Sep 2008 · 20 posts
Group memberships: Mitglieder
Show profile · Link to this post
In reply to post ID 1249
may be a silly quesiton : where can I get today's release ?

thanks
Close Smaller – Larger + Reply to this post:
Special characters:
Page:  1  2  next 
Special queries
Go to forum