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 3605760
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:09:50+00:00 2026-05-18T21:09:50+00:00

I need to do one of two things in Drupal have the ability to

  • 0

I need to do one of two things in Drupal

  1. have the ability to set a info message to a specific user to view next time they login. This message would show up in the standard $messages variable. I looked to see if drupal_set_message() had the capabilities but didn’t find it
  2. run a function everytime a page is loaded that would then look for some info that would then cause the drupal_set_message to be sent

I prefer the second option, if anyone has suggestions.

  • 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-18T21:09:51+00:00Added an answer on May 18, 2026 at 9:09 pm

    I would place code in hook_init(). Most of Drupal has been loaded and it is available on every page load.

    Within that, you could query for a list of messages form the database and funnel them into drupal_set_message(). The $messages variable is stored in the session, so you need to call drupal_set_message() at the time you actually want to show the message.

    Storing the need to present the message is a different challenge, and depends on how you determine a message needs to be set. If it is based simply on elapsed time, you can skip custom coding and go straight to Rules–defining triggers and actions based on user login date.

    If it is a more dynamic messaging scheme, where you need to notify users of events which have happened in their absence, you might use write code based around the Message module or something like it, which would allow you to record messages to the database, and then query for anything dated since the user’s last login. In fact, I like that idea, it bears further thought…

    A more specific question would help in recommending more targeted solutions.

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

Sidebar

Related Questions

I have two tables with the same columns, and I need to copy one
Why do I need two of them? When I have to use one or
I need to be able to take a string like: '''foo, bar, one, two,
I need to have one column as the primary key and another to auto
I have two databases I need to work with, db_site and db_forum (these are
I have a situation where I need to check a couple of things before
I want the equivalent online resource to DNS in Twenty-One Days. I need one
When or why will one need to use Globally Unique Identifiers instead of the
Can some one specify the windows API, one need to use in order to
How does one start development in Silverlight? Does one need a new IDE? or

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.