Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
RRK Posted January 24, 2020 Posted January 24, 2020 I want to display a custom message based on a database condition after success of registration, Where I can do this? Requirements: If user coming from a specific url of website and complete the registration then user must have seen a custom message. Ex- You are now eligible for XXXXXXXX. Please help me
bfarber Posted January 24, 2020 Posted January 24, 2020 Firstly, you'd need a way to identify when the user comes from the specific URL. This may be best implemented as a plugin on your registration form that tracks the HTTP_REFERER header so you know where the user is coming from, or you may want to do it in javascript if that's easiest for you. Upon successful registration, you would then check the URL you earlier tracked, and if it matches you would show the message. I'm not sure which part you are asking for help with. If you are not familiar with coding, you may need to contract a developer to help build this. If you are familiar, let us know which bits you are trying to work on.
RRK Posted January 27, 2020 Author Posted January 27, 2020 On 1/24/2020 at 7:26 PM, bfarber said: Firstly, you'd need a way to identify when the user comes from the specific URL. This may be best implemented as a plugin on your registration form that tracks the HTTP_REFERER header so you know where the user is coming from, or you may want to do it in javascript if that's easiest for you. Upon successful registration, you would then check the URL you earlier tracked, and if it matches you would show the message. I'm not sure which part you are asking for help with. If you are not familiar with coding, you may need to contract a developer to help build this. If you are familiar, let us know which bits you are trying to work on. Thanks or your reply, Yes I know coding but I am new to IPS forum coding structure. I will try with javascript first for referer url . I have issue issue with message that need to be display after success of registration. It would be very helpful i you can tell me where to code for this message in forum.
bfarber Posted January 27, 2020 Posted January 27, 2020 <div class='ipsMessage ipsMessage_info'>Your message here</div> If you are going the javascript route, you can simply insert this HTML where-ever in the DOM you want. Note that there are other ipsMessage_* classes if they're more appropriate for your purposes (error and warning stand out).
RRK Posted January 28, 2020 Author Posted January 28, 2020 18 hours ago, bfarber said: <div class='ipsMessage ipsMessage_info'>Your message here</div> If you are going the javascript route, you can simply insert this HTML where-ever in the DOM you want. Note that there are other ipsMessage_* classes if they're more appropriate for your purposes (error and warning stand out). ok thanks, I will try
RRK Posted January 31, 2020 Author Posted January 31, 2020 On 1/28/2020 at 7:16 PM, RRK said: ok thanks, I will try Can you tell me where is the forum registration code file so that i can put my code there.
bfarber Posted January 31, 2020 Posted January 31, 2020 Are you talking about for javascript? If so, javascript is dynamically compiled and cached with a random hashed extension, so you won't be able to actually just go in and edit our javascript files. You'll need to add inline script code into your templates, or write a plugin to add a new js file.
RRK Posted February 3, 2020 Author Posted February 3, 2020 On 2/1/2020 at 3:01 AM, bfarber said: Are you talking about for javascript? If so, javascript is dynamically compiled and cached with a random hashed extension, so you won't be able to actually just go in and edit our javascript files. You'll need to add inline script code into your templates, or write a plugin to add a new js file. yes, i am talking about javascript. and i am not aware much about forum file structure so not sure where the template file for registration. I can see a lot of file in admin panel of theme template and we also have option to edit those but did not ind the particular file for registration inside the template.
bfarber Posted February 3, 2020 Posted February 3, 2020 As I mentioned, you cannot just edit our javascript code. It is actually stored in the database (in core_javascript), and then compiled into files that are built. These files can be deleted and rebuilt at any time, and the code in the database will be updated anytime an upgrade is ran. What you will want to do is create a new plugin, and add a new javascript file in your plugin. You will likely want to create a mixin javascript file for your purpose.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.