Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - live627
16
Bug reports / Re: Periodic notifications don't seem to work
« on August 3rd, 2013, 07:39 AM »
Ok, so I've been playing around some more. The biggest issue is that the email body is duplicated since it is HTML. II have yet to understand why.

The above error is because it is calling on the Notification object and wants the getEmail() method from a Notifier.

Code: [Select]
Index: I:/repos/wedge/trunk/Themes/default/Notifications.template.php
===================================================================
--- I:/repos/wedge/trunk/Themes/default/Notifications.template.php (revision 2194)
+++ I:/repos/wedge/trunk/Themes/default/Notifications.template.php (working copy)
@@ -116,9 +116,10 @@
  $str .= "\n" . $title . "\n" . str_repeat('=', strlen($title)) . "\n";
 
  foreach ($notifs as $n)
- $str .= $n->getEmail();
-
- $str .= "\n\n";
+ {
+ list (, $n) = $n->getNotifier()->getEmail($n, array());
+ $str .= $n . "\n\n";
+ }
  }
 
  return $str;

Let's save some memory! $valid_notifiers is only checked for existence, so why not use a bool instead of an object?

Code: [Select]
Index: I:/repos/wedge/trunk/Sources/Notifications.php
===================================================================
--- I:/repos/wedge/trunk/Sources/Notifications.php (revision 2194)
+++ I:/repos/wedge/trunk/Sources/Notifications.php (working copy)
@@ -609,7 +608,7 @@
  {
  $status = isset($data['email_notifiers'][$notifier->getName()]) ? $data['email_notifiers'][$notifier->getName()] : 0;
  if ($status < 2 && (empty($data['disabled_notifiers']) || !in_array($notifier, $data['disabled_notifiers'])))
- $valid_notifiers[$notifier->getName()] = $notifier;
+ $valid_notifiers[$notifier->getName()] = true;
  }
 
  if (empty($valid_notifiers))


Objects shouldn't be this hard to understand. I think it's the duplication that's the problem. Perhaps Notification can go, and its leftovers merged with weNotif. Also, shouldn't Notifier be abstract?
17
Bug reports / Re: Periodic notifications don't seem to work
« on August 3rd, 2013, 12:16 AM »
Is that someone else me? :P

I'm also finding it hard to understand. I've been doing my head in trying to make it work. The emails send, but the data isn't quite right. :^^;:
18
Bug reports / Re: Periodic notifications don't seem to work
« on August 2nd, 2013, 07:06 AM »
Fatal error: Call to undefined method Notification::getEmail() in I:\www\wedge\trunk\Themes\default\Notifications.template.php on line 119


That's when trying to run the schd task.
19
Bug reports / Re: No error box on preview
« on August 2nd, 2013, 02:32 AM »
Bumps!
20
Er, bump...? Not using Zip_Archive, but something else.
21
Bug reports / Re: Periodic notifications don't seem to work
« on June 16th, 2013, 04:09 AM »
I actually meant here. I should be more clear. :P

@Nao> Please ensure the task has the right parameters in the DB. Also, the task itself must return true in order to not get disabled. :^^;:

Code: [Select]
Index: Sources/Notifications.php
===================================================================
--- Sources/Notifications.php (revision 2166)
+++ Sources/Notifications.php (working copy)
@@ -670,7 +765,7 @@
  continue;
 
  // Assemble the notifications into one huge text.
- $body = template_notification_email($m['notifications']);
+ $body = template_notification_email($m['notifications'], $m['id']);
  $subject = sprintf($txt['notification_email_periodical_subject'], $m['name'], $m['unread']);
 
  sendmail($m['email'], $subject, $body, null, null, true);
Index: Themes/default/Notifications.template.php
===================================================================
--- Themes/default/Notifications.template.php (revision 2166)
+++ Themes/default/Notifications.template.php (working copy)
@@ -64,46 +64,14 @@
 }
 
-function template_notification_email($notifications)
+function template_notification_email($notifications, $member_id)
 {
  global $txt;
 
@@ -111,7 +79,7 @@
 
  foreach ($notifications as $notifier => $notifs)
  {
- list ($title) = weNotif::getNotifiers($notifier)->getProfile();
+ list ($title) = weNotif::getNotifiers($notifier)->getProfile($member_id);
 
  $str .= '
  <h3>' . $title . '</h3>

@Dragooon> Why is this template so complicated? Ideally, the variables should be put into $context in the source file. I think templates/views should never do any logic work, only presentation.
22
Bug reports / Periodic notifications don't seem to work
« on June 16th, 2013, 02:40 AM »
I've yet to find out why.
23
Bug reports / handleMultiple is only partially implemented
« on June 16th, 2013, 02:37 AM »
handleMultiple is only partially implemented. Its only occurrence is now working.

Now, it gets passed several parameters which led to the assumption that it modifies emails. But it does nothing.

I suggest the following:

  • Do away with all parameters
  • Make it so it only determines whether of not to issue multiple notifications.
  • Don't affect emails.
24
Bug reports / Re: Post moderation always shows 10 posts
« on June 9th, 2013, 05:53 AM »
Quote
reported posts are shown in blocks of 10.
You mean the block in the moderation center main page that somehow vanished?
25
Bug reports / Post moderation always shows 10 posts
« on June 9th, 2013, 05:11 AM »
Shouldn't it obey the settings?

https://github.com/SimpleMachines/SMF2.1/pull/385/files

(I checked the code and the hardcoded number is indeed still there.)
26
Bug reports / Re: Raw HTML in Custom Profile Fields
« on May 25th, 2013, 03:04 AM »
Quote
There is a separate side bug related to the selectbox. I have a piece of text with an image that's substantially bigger than a single line of text. It was the first image at hand, and was 40x40. When the selectbox is expanded, it is displayed normally. But when closed and it is the selected item, something else happens entirely. See attached. The picture shows both the expanded behaviour and the unexpanded behaviour (i.e. it doesn't change height, and the text is base-line aligned, so the text is actually out of sight)
Most (if not all) people using images in the options will treat them as icons. That said, I think the height should be elastic, jut like the width.
27
Bug reports / Re: When a bug is fixed
« on May 24th, 2013, 02:56 AM »
Just attached a pic of the button.
28
Bug reports / Re: wrong browser title for PM sent box
« on May 24th, 2013, 02:53 AM »
Yup, yup. The HTML title tag is wrong.
29
Bug reports / When a bug is fixed
« on May 24th, 2013, 02:51 AM »
Once you can confirm the bug you reported in this board is fixed, mark it as solved. I can then easily spot such topics and move them away.
30
Bug reports / Re: add_plugin_css_file issues
« on March 29th, 2013, 09:34 PM »
Maybe merge functions, but keep add_plugin_css_file() as a shortcut of sorts?