%name% on news

Messages
89
Likes
4
#1
Hi guys!

I would like to add that the name of the user who is viewing the page is displayed with the %name% function.

Example
Hello %name% = Hello AlexstyleRetro on page News.

Thanks :)
 
Messages
4,840
Likes
1,049
#8
In me.php is this:

<?php echo $user['username']; ?>

If I try to insert it, it goes out as it is written, Can I shorten it for the news?
News gets filtered in the database that's why it won't work. You'll need to go into where the news gets loaded and in the PHP code call to the body variable and do a replace function. Search for %username% and replace with $user[username]
 
Messages
89
Likes
4
#9
News gets filtered in the database that's why it won't work. You'll need to go into where the news gets loaded and in the PHP code call to the body variable and do a replace function. Search for %username% and replace with $user[username]
You can not find anything with% username% or something like that.
 

SaW

Member
Messages
95
Likes
10
#10
You'd have to write your own function that filters the news content and replaces the %username% placeholder. I assume preg_replace would do the job.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top