Jump to content

How to call username variable?


Black Tiger

Recommended Posts

Posted

Hello.

I'm trying to customize some piece of javascript which I would like to put on my forum in a page.

Hello {member_name} welcome on our forum

Or maybe also the sitename variable. However, if I put this in the wysiwig editor in source code html, it will display exactly this and not the username.

I also tried with:

Hello {member_name|raw} welcome on our forum

which had the same result. Somewhere else on the net I've seen somebody using %member_name% but that was for messages. In the mass email function {member_name} is used.

How can I use the variables (and which) in the forum itself in a page or block like described above?

 

Posted

Email templates and theme templates for display are different animals. {member=name} would be what you need for the currently logged in member IF you're working in a theme template. Add raw="true" within the {} if you don't want it html escaped. 

Posted

I'm not working in a theme, at least... I don't now. I'm not into coding normally.

I just created a page with and wanted that this page said "hello" to the user visiting it.

So i should do it like this then?

Hello {member=name raw="true"}

 

Posted
3 minutes ago, Black Tiger said:

I just created a page with

How are you creating the page? Is it using Pages.....are you using 'Page Builder' or is it 'Manual HTML'?

Give more detail about what you are creating, and it gives an idea of what your options will actually be.

Posted

I tried with Pages by choosing Manual HTML and I also tried with the Page Builder and using the Wysiwyg editor using source html code with the source button.

I'm trying to put something like this there (it's in dutch):

<font color=red>Welkom op Satellite Fun</font>
Leuk om je erbij te hebben <b>{member="name" raw="true"}</b><br />
Veel plezier gewenst!<br />
<script language="JavaScript" type="text/javascript">
document.write(' Uw laatste bezoek was op ');
document.write(maakDatum(new Date()));
document.write('.');
</script>
<script LANGUAGE="JavaScript" type="text/javascript">schrijfKlok()
</script>

It's part of some larger script code I got, and it puts in all the text and the time and date correctly. The only thing not showing is the username.

 

Posted

Ehmz... I'm not native English and I'm new to Invision. I presume you mean it can't be done via the Wysiwig editor in page builder? That's a pity.

I'll go and search the manual then on how to create custom blocks then.

Thank you.

Posted

WYSIWYG is exactly what it means. What you see is what you get. There isn't automation built into it because it then wouldn't be WYSIWYG. 

To build it with any kind of automation, you have to build it as a custom block with manual HTML or PHP. 

Posted

Yes I know what wysiwyg means. But since you can also put html source code in the wysiwyg editor with html enabled.... html=html. So I don't understand the difference between html source code and html source code in a manual created page.

Bug I will figure out how to create a custom block, as soon as Tier II is ready investigating why my database gets cleared out after forum conversion except for uses and forums.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...