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

  • Home
  • SEARCH
  • 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 6676735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:01:45+00:00 2026-05-26T04:01:45+00:00

In a Smarty templated theme I would like to implement MD5 within the template

  • 0

In a Smarty templated theme I would like to implement MD5 within the template to get a unique hash based on a string and a salt. (Do not have access to the PHP calling the template, or this would be trivial). Smarty does not seem to have an MD5 function built into it. I thought I might be able to create a hash based on the length of the string and some other unique account information and by using Smarty’s Math function, but was hoping there might be a better way to do this that I’m overlooking. Anyone have any thoughts or ideas on this? Thank you!

  • 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-26T04:01:46+00:00Added an answer on May 26, 2026 at 4:01 am

    If you’re just using the stock md5 function, you can use it as a modifier.

    {$string|md5}
    

    From documentation:

    All php-functions can be used as modifiers implicitly, as demonstrated in the example above. However, using php-functions as modifiers has two little pitfalls:

    • First – sometimes the order of the function-parameters is not the desirable one. Formatting $foo with {"%2.f"|sprintf:$foo} actually works, but asks for the more intuitive, like {$foo|string_format:"%2.f"} that is provided by the Smarty distribution.

    • Secondly – if $security is enabled, all php-functions that are to be used as modifiers have to be declared trusted in the MODIFIER_FUNCS element of the $security_settings array.

    Source v2
    Source v3

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

Sidebar

Related Questions

I'm writing a template class and at one point in my code would like
I have a smarty template, that I want to display a random sentence on
Is it possible to extend a base template with another template in Smarty? I
Someone tried to recreate smarty in js: // actually from a template file, not
I have a small problem with Smarty... I have two different template files in
Smarty Pants sounds like a cool idea to me: SmartyPants can perform the following
I want to keep my templates tidy and nicely intented but would like to
I can't find the solution of applying modifiers dynamicly in Smarty. Template - I
i would like to know which one is the best for performance: 1- use
We are using Smarty Templates on our LAMP site but my question would also

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.