Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 663423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:29:16+00:00 2026-05-13T23:29:16+00:00

I am creating a Rule in D6 to notify a person when approved volunteer

  • 0

I am creating a Rule in D6 to notify a person when “approved” volunteer hours reach a multiple of 8. Hours are logged as a custom content type with a numeric CCK field, and “approved” is a Flag. I was doing a modulo 8 calculation but realized that won’t suffice. If a user has 7 hours approved and puts in another 2, the Rule returns false and the notification isn’t sent. Here is the current Rule code that fires whenever a node is flagged:

$result = db_result(db_query("SELECT 
SUM(vol_hours.field_hours_worked_value) AS TotalHours 
FROM node 
INNER JOIN content_type_volunteer_log vol_hours ON node.vid = vol_hours.vid
INNER JOIN flag_content ON node.vid = flag_content.content_id AND flag_content.fid = 3
WHERE node.uid = '%d'
AND YEAR(field_date_worked_value) = YEAR(NOW())" , $node->uid));

if ($result % 8 == 0) {
return TRUE;
}
else {
return FALSE;
}

Any advice for how to solve this? Do I need an additional Flag type of “multiple of 8” that increments after each threshold is passed, maybe as a scheduled Rule instead of a triggering Rule?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:29:17+00:00Added an answer on May 13, 2026 at 11:29 pm

    i’d store the “last_checked_value” and trigger an event when floor(current_value/8) > floor(last_checked_value/8)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the general rule of thumb when deciding between creating multiple schemas versus
I am creating a formal spec for a very simple rule language, very simple.
I need some advice, what is the rule of the thumb when creating Rails
I'm stuck with creating a validation rule where I'd like to restrict my users
Who is the acting user for cron updates drupal when creating a triggered rule?
I'm creating a TemporaryFolder using the @Rule annotation in JUnit 4.7. I've tried to
Sticking to the rule of releasing everything I'm creating, why does the line [cellText
I'm having some difficulty creating an htaccess mod_rewrite rule which would take the following
I'm having quite a challenge creating an appropriate rewrite rule for Apache/2.2.14 on Fedora
I'm trying to build a validation rule for a C# WPF application by creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.