MyBB Community Forums

Full Version: Reply In Portal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(I'm new, first post, I've been using Mybb for about a week as of now.)I am very new at php, but i will be able to follow most directions when i ask this. Can i have "reply" show up as a link in the portal for announcements/news? Not the button, but actual text? I would like it to show up whether your are logged in or not, and if you aren't logged in, it redirects you.(I have the forum permissions set to only users and above can post.) I can customize the text with CSS, HTML, and what not(even though there is a default link style), but I have no experience in php. I know where i want to put it, I just need to know the php code to insert for the static link? Could someone please help me?
In portal.php
find:
$announcement['message'] = $posts[$announcement['tid']]['message'];
Add above:
if($mybb->user['uid'] != 0)
{
	$reply_link = "<a href=\"{$mybb->settings['bburl']}/newreply.php?tid={$announcement['tid']}\">Reply</a>";
}
else
{
	$reply_link = "";
}

Then go to Admin CP -> Templates -> Modify / delete -> *your template set* -> Portal Templates -> portal_announcement
Add:
{$reply_link}
Where you want it to display.
For example after:
{$numcomments}
like:
{$numcomments} - {$reply_link}

Hope this helps.
Awesome!!! I changed that code you gave a little so the "reply" link shows up whether you're logged in or not (just simple copy and paste). Thanx!!!