MyBB Community Forums

Full Version: Add "mark forums read" link to top
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the index_boardstats template is the link to mark all forums read. I wanted to also have this link appear at the top in header_welcomeblock_member, directly in front of the buddy list link. So I added it like below. The part I added is in red:
Quote:<a href="misc.php?action=markread">{$lang->markread}</a> | <a href="#" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/misc.php?action=buddypopup', 'buddyList', 350, 350);">{$lang->welcome_open_buddy_list}</a>

After I do this the only change I made that shows is the vertical line. The link that's supposed to appear in front of it does not.

Can someone help me with this?
Is there a lang variable for markread? That might be why.

EDIT: Excuse me, variable for markread in global.lang.php. ^^;
Go to: http://yourdomain.com/admin/index.php?mo...&expand=27

Replace yourdomain.com with your own domain name and find;

{$lang->welcome_pms_usage}

Just after add the following;

 | <a href="misc.php?action=markread">Mark Forum As Read</a>
(2010-12-01, 10:16 AM)Kazuto Wrote: [ -> ]Is there a lang variable for markread? That might be why.

EDIT: Excuse me, variable for markread in global.lang.php. ^^;
The red text in my first message is copied directly from the index_boardstats template. That is the template near the bottom of the index page that contains a working link that marks forums read. So that language variable has to exist. And all I did is copy that statement from index_boardstats and put it in my welcome block.

With your suggestion about global.lang.php, I'm not sure how I should use that. I don't see such a file in the forum folder. I looked in global.php, but didn't find what could help me.

(2010-12-01, 10:48 AM)Yaldaram Wrote: [ -> ]
 | <a href="misc.php?action=markread">Mark Forum As Read</a>

Thanks! That definitely works. I can't change languages, but this solves my immediate problem.
The template you edited is the header and that is evaluated before the index page starts its real work, thus the code you copied is going to use language variables from the index, but the index language has not yet been loaded. Hopefully that makes sense.

so you would need to modify the global.lang.php file(s) to add a variable for markread or do as you did and hard code the language
(2010-12-01, 05:04 PM)pavemen Wrote: [ -> ]The template you edited is the header and that is evaluated before the index page starts... modify the global.lang.php file(s) to add a variable for markread or do as you did and hard code the language

Thanks, Paveman. Now I understand it better. I also figured out how to locate global.lang.php. I made the change and it worked.

BTW, I tried to take an online course in PHP a few years ago. Once I got past "Hello World" my head started to spin. I had to give up. It's nice to be able to actually do something.