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 a class that contains objects of two other classes. I need one
I have some HTML that I need to toggle between two structures - one
I need to have two UITableViews on one UIView. I can make it work
I have two different modules that need access to a single file (One will
I have a bunch of XSD's from https://github.com/XeroAPI/XeroAPI-Schemas/tree/master/v2.00 I need to do two things:
I have a small app using Drive.Info. I want to do two things. Check
I need to display one of two items in an array based up on
I need two methods one to encrypt and one to decrypt an xml file
I need a very simple menu which probably contains only one or two items:
I need to create one list based on two other lists. But seems like

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.