News:

Wondering if this will always be free?  See why free is better.

Main Menu

Private Topics

Started by All Colours Sam, February 07, 2013, 03:42:35 PM

Previous topic - Next topic

Skaty

Suki,  i'm still trying to work this mod. Sometimes it is working sometimes it is not. i wonder maybe i'm doing something wrong with entegrate it my theme. can you help me with just this part ?

how should has to be ?

find

if (!empty($board['last_post']['id']))
echo '
<p><span>', $board['last_post']['member']['link'] , ' ', $txt['in'], ' ', $board['last_post']['link'], '</span><br />
', $board['last_post']['time'],'
</p>';


change

if (!empty($board['last_post']['id']))
if (!empty($modSettings['PrivateTopics_enable']))
{
global $user_info;
$ptTrue = false;
$pt = new PrivateTopics($board['last_post']['id']);
$ptCache = $pt->doGet();

if (!empty($ptCache) && is_array($ptCache) && !allowedTo('can_always_see_private_topics'))
{
if (!in_array($user_info['id'], $ptCache))
echo '
<p>', !empty($modSettings['PrivateTopics_boardindex_message']) ? $modSettings['PrivateTopics_boardindex_message'] : PrivateTopics::doTools()->getText('boardindex_message_default') ,'</p>';

else
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
}

else
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
}

else
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';



All Colours Sam

Exactly like you posted it?  just find/replace.

To say "not working" doesn't really help, at all.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

i couldn't express myself.


in defaul theme it has these codes.
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';


but in mine theme it has these, how has to be the modified.


if (!empty($board['last_post']['id']))
echo '
<p><span>', $board['last_post']['member']['link'] , ' ', $txt['in'], ' ', $board['last_post']['link'], '</span><br />
', $board['last_post']['time'],'
</p>';

All Colours Sam

The only thing that changes is this:


echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>'


Just replace that echo part with what you have:


echo '
<p><span>', $board['last_post']['member']['link'] , ' ', $txt['in'], ' ', $board['last_post']['link'], '</span><br />
', $board['last_post']['time'],'
</p>';



If you see closely on the code you need to add, there are multiple instance of that echo statement, replace all of them with what you have.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

Okay i did it like this:


if (!empty($board['last_post']['id']))
if (!empty($modSettings['PrivateTopics_enable']))
{
global $user_info;
$ptTrue = false;
$pt = new PrivateTopics($board['last_post']['id']);
$ptCache = $pt->doGet();

if (!empty($ptCache) && is_array($ptCache) && !allowedTo('can_always_see_private_topics'))
{
if (!in_array($user_info['id'], $ptCache))
echo '
<p>', !empty($modSettings['PrivateTopics_boardindex_message']) ? $modSettings['PrivateTopics_boardindex_message'] : PrivateTopics::doTools()->getText('boardindex_message_default') ,'</p>';

else
echo '
<p><span>', $board['last_post']['member']['link'] , ' ', $txt['in'], ' ', $board['last_post']['link'], '</span><br />
', $board['last_post']['time'],'
</p>';
}

else
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
}

else
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';


when i make a topic private and put a id, other members can't see the all boards it gives a DB error. in default theme can see the topic but can't open it, it seems working in default.

All Colours Sam

Did you do all the other edits the mod needs?

This is just a template edit.  Anyway, you only replaced one echo statement, there are more two more.

Can really help you if you don't provide more details.... what DB error? what did you do? did you installed this manually?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Skaty

the mod is sending pm to invite users but it is do it just in the first time when post is created. if you add couple of more id after that it is not sending pms to the new ids.

is ''anyone'' have and idea how to fix this ?

thanks in advance.

Advertisement: