Nicht angemeldet. · Kennwort vergessen · Registrierung deaktiviert
Forum: Übersicht Suggestions and Wishes / Anregungen und Wünsche RSS
Improving debug mode - done
Notify when there are no emails assigned to a category.
jeffsherk #1
Mitglied seit 11/2007 · 37 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Betreff: Improving debug mode
Here's a couple suggestions to improve the readability of debug mode.

If you notice the text below, the second Sending Post (#95) says that emails were found, but this is little misleading, since there are no emails assigned to the category of that post. IT would be nice to see an extra line that reads something like 'No emails assigned to category.'.

Also, putting a blank line between the Sending of Posts would make it a little easier to read.

The text below has the changes included, and I have included the suggested code changes at the bottom of the post.

Sending post: 94
The cat-Ids are: 4, 3, 0
Emails were found.
Date1: November 28, 2007
Date2: November 28, 2007
Date3: November 28, 2007
Date4: November 28, 2007
Email variables:
Emailtype TEXT
@@title iii
@@permalink http://www.mydomain.com/blog/2007/11/28/iii/
@@author jsherk
@@time 10:31 am
@@date November 28, 2007
Sending mail to: webmaster@mydomain.com

Sending post: 95
The cat-Ids are: 3, 0
Emails were found.
No emails assigned to category.

Sending post: 96
The cat-Ids are: 1, 0
Emails were found.
Date1: November 28, 2007
Date2: November 28, 2007
Date3: November 28, 2007
Date4: November 28, 2007
Email variables:
Emailtype TEXT
@@title yyy
@@permalink http://www.mydomain.com/blog/2007/11/28/yyy/
@@author jsherk
@@time 10:31 am
@@date November 28, 2007
Sending mail to: webmaster@mydomain.com

Number of Subscribers: 1


ADD BLANK LINE:
This is the easiest way to do it. In sendmail.php, find the line that reads
echo 'Sending post: ' . $post->id . '<br />';

and insert this new line right above it
echo '<br />';

so that it looks like this
echo '<br />';
echo 'Sending post: ' . $post->id . '<br />';

ADD 'No emails assigned to category'
Again, in sendmail.php, we just need to add an ELSE statement. Look for
wp_mail($email->email_addr, $maildata['subject'], $msgFinal, $maildata['header']);
$maxsend--;
}
}

Add these lines AFTER the second curly bracket(})
else {
if(get_option('post_notification_debug') == 'yes') {
echo 'No emails assigned to category.<br />';
}
}

So it looks like this
wp_mail($email->email_addr, $maildata['subject'], $msgFinal, $maildata['header']);
$maxsend--;
}
}
else {
if(get_option('post_notification_debug') == 'yes') {
echo 'No emails assigned to category.<br />';
}
}


Hope these are helpful!
Morty (Administrator) #2
Benutzertitel: Author
Mitglied seit 06/2007 · 928 Beiträge
Gruppenmitgliedschaften: Administratoren, Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Hi jeff,
thanks for the feedback. The debug mode was only for me to find other people's problems and normally knew where to look and didn't care for eye candy. :-)

I did things a bit different then you suggested, but I think that is ok. :-) I attached a preview.
Der Autor hat eine Datei an diesen Beitrag angehängt:
sendmail.php | Speichern   10,9 kBytes, 357 mal heruntergeladen
jeffsherk #3
Mitglied seit 11/2007 · 37 Beiträge
Gruppenmitgliedschaften: Mitglieder
Profil anzeigen · Link auf diesen Beitrag
Yes, I like that better than my suggestions!!

Thanks
Schließen Kleiner – Größer + Auf diesen Beitrag antworten:
Prüfcode: VeriCode Gib bitte das Wort aus dem Bild ins folgende Textfeld ein. (Nur die Buchstaben eingeben, Kleinschreibung ist in Ordnung.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Weitere Zeichen:
Gehe zu Forum