1. Add tag %username% to your site

Add tag %username% to your site

  |   5
Add tag %username% to your siteWhne you write the article in your website, and want to add the user who is reading that article to tell them who they are or you want to put the username in the post, you can use this hack to display the username easily, for example:
Hello, %username%! Our site the best, etc.


This hack allows to replace a tag %username % addressed to the user in any place of a site.

Open file index.php
Find:
echo $tpl->result['main'];

Replace with
echo $tpl->result['main'] = str_replace("%username%", $is_logged?$member_id['name']:'Guest', $tpl->result['main']);


That's all! For visitors, the tag %username % will be replaced with a word "Visitor" but you can change it to your own language.

---------------------------
Last update by spamhater (2/2/2013): correct tag and instruction...
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

0

Comments 5

ContactUs
ContactUs
V.I.P.
Commented By ContactUs on January 31, 2013 (6:36 am)
Sorry but not working in dle 9.6
N/A 11Forum topics : 14Forum replies : 46Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on January 31, 2013 (9:22 pm)
personally I never know how it work but I never got it to work with any versions...maybe I am terrible with hack like this. request
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
ContactUs
ContactUs
V.I.P.
Commented By ContactUs on February 2, 2013 (3:45 am)
Thats amazing... that if this mode is not working with any version then what is this doing here...delete it...haha

EDIT : it is working....hahaha
N/A 11Forum topics : 14Forum replies : 46Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on February 2, 2013 (6:22 pm)
well, at that time I wasn't join the team yet, and the user shared this tutorial from other site and somehow it might be working for them at that time or maybe something missing here, I will review the tutorial and update it as soon as I can..

I agree there is no point to post with nothing working...but I will review it and update it if it still working or not...

update...

I have reviewed and correct the correct tag...tested on dle 9.7, should work with all versions...
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
ContactUs
ContactUs
V.I.P.
Commented By ContactUs on February 6, 2013 (1:41 am)
Yeh now its working...
N/A 11Forum topics : 14Forum replies : 46Forum likes : 0
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.