Try this instead - change:

$tpl_temp .= "\n\t\t\t\t".'<li class="pmlink"><strong><a href="message_list.php">'.$lang_pms['New messages'].'</a></strong></li>';

to:

$tpl_temp .= "\n\t\t\t\t".'<li class="pmlink"><strong><a href="message_list.php">'.$lang_pms['New messages'].'</a></strong></li><script language="JavaScript" type="text/javascript">window.open("message_popup.php","NewPM","width=500,height=250,resizable=yes,scrollbars=yes");</script>';

Does that work?

Please note that I didn't bother to add back in the newlines and indents so if you want your markup to look pretty you'll have to do that.

977

(5 replies, posted in PunBB 1.2 troubleshooting)

Ok, here we go, include/functions.php:

//
// Replace censored words in $text
//
function censor_words($text)
{
    global $db;
    static $search_for, $replace_with;

    // If not already built in a previous call, build an array of censor words and their replacement text
    if (!isset($search_for))
    {
        $result = $db->query('SELECT search_for, replace_with FROM '.$db->prefix.'censoring') or error('Unable to fetch censor word list', __FILE__, __LINE__, $db->error());
        $num_words = $db->num_rows($result);

        $search_for = array();
        for ($i = 0; $i < $num_words; ++$i)
        {
            list($search_for[$i], $replace_with[$i]) = $db->fetch_row($result);
            $search_for[$i] = '/\b('.str_replace('\*', '\w*?', preg_quote($search_for[$i], '/')).')\b/i';
        }
    }

    if (!empty($search_for))
        $text = substr(preg_replace($search_for, $replace_with, ' '.$text.' '), 1, -1);

    return $text;
}

978

(5 replies, posted in PunBB 1.2 troubleshooting)

Either include/functions.php or include/parser.php, I think the latter.

979

(5 replies, posted in PunBB 1.2 troubleshooting)

Doesn't the wildcard (*) cover prefixes/suffixes?

980

(8 replies, posted in PunBB 1.2 troubleshooting)

Ok, simply open main.tpl, and placed the following code below <pun_announcement>:

<div id="punsearch" class="block">
    <h2><span>Forum Search - <a href="search.php">advanced</a></span></h2>
    <div class="box">
        <div class="inbox">
            <div>
                <form id="search" method="get" action="search.php">
                    <input type="hidden" name="action" value="search" />
                    <label class="conl">Search keywords: <input type="text" name="keywords" size="40" maxlength="100" /></label>
                    <input type="submit" name="search" value="Submit" accesskey="s" />
                </form>
            </div>
        </div>
    </div>
</div>

You can ignore what I said about pun_include, because when I wrote that I forgot that the code I linked to doesn't contain PHP, and thus can be placed directly in main.tpl.

981

(8 replies, posted in PunBB 1.2 troubleshooting)

colak wrote:
pogenwurst wrote:

See http://punbb.org/forums/viewtopic.php?pid=65031#p65031 for some basic code.

To put it on every page, you can use the pun_include directive in main.tpl, as described in the docs.

hi pogenwurst
thanks for your reply and the link re code needed for the search. it looks ok but I'm yet to understand why I would have to use the pun_include (please do remember that I am very new at this smile ).



1. Do I need to paste/modify the search code in a new document, save it as a php file and then call it as described here in the main.tpl?

2. Do I just paste/modify the code in the main.tpl?

thanks in advance for your help

I'll have code for you in a bit, sit tight. smile

982

(1 replies, posted in PunBB 1.2 discussion)

Put simply, no.

I'm sure that someone with the know-how could achieve this with a mod, but I am not aware of any such mod existing.

Edit: Actually, it seems that someone has done this. I'd suggest you attempt to contact him / her.

983

(13 replies, posted in PunBB 1.2 show off)

WOW. Amazing work.

984

(3 replies, posted in Programming)

Unfortunately, that didn't work for me. Probably my fault, but anyway, I managed to get things working with this code:

$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE poster_id = '.$id.' AND posted = '.$user['last_post']) or error('Unable to fetch last post ID', __FILE__, __LINE__, $db->error());
while ($row = $db->fetch_assoc($result))
{
    $last_post_id = $row['id'];
}

Thanks for your help and your time, though.

Paul wrote:
trongha wrote:

Spam!

What?

I think he deemed MKG's mention of macinchat.com to be spam.

986

(8 replies, posted in PunBB 1.2 troubleshooting)

See http://punbb.org/forums/viewtopic.php?pid=65031#p65031 for some basic code.

To put it on every page, you can use the pun_include directive in main.tpl, as described in the docs.

Search for "Users Online Today" on punres.org. It's there.

Also, that would be a mod, not a plugin, so I'll be moving this topic to reflect that.

ervondort wrote:

is there no script that adds some profile fields?
im not able to programm the php/mysql code =/

Easy Profile Fields by elbekko

Not a bug, moved to troubleshooting.

990

(3 replies, posted in Programming)

Thank you very much, I'll give that a try.

991

(3 replies, posted in Programming)

Just a simple, stupid little question that I can't seem to figure out the answer to -

I've got this query that I'm using in profile.php:

$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE poster_id = '.$id.' AND posted = '.$user['last_post']) or error('Unable to fetch last post ID', __FILE__, __LINE__, $db->error());

My question is simply: how do I reference the information that query returns in PHP as a variable. It's probably obvious to a whole lot of people here, but I'm essentially much learning PHP as I go, and thus this is beyond me (and yes, I've tried to discover this myself on several occasions, with no success).

Thanks in advance for your help.

992

(1 replies, posted in Feature requests)

This may help: http://punbb.org/forums/viewtopic.php?id=8755

993

(24 replies, posted in PunBB 1.2 discussion)

Explain the difference between a mod, plugin, and extension - $5.00 tongue

994

(13 replies, posted in PunBB 1.2 show off)

You are truly a master of both design and humility. wink

It looks very nice indeed.

995

(2 replies, posted in PunBB 1.2 show off)

trongha wrote:

Share me code, please!

What code exactly are you seeking? If it's Puntal that you want, it's freely available.

996

(16 replies, posted in PunBB 1.2 troubleshooting)

I believe you can accomplish that by changing the above code to:

#punindex .blocktable h2, #punviewforum .blocktable h2 {
  height: 0;
  position:absolute;
  left: -9999px;
  }

997

(5 replies, posted in PunBB 1.2 discussion)

I just glanced at your site and remember: that code needs to be between PHP tags (<?php and ?>). tongue

998

(4 replies, posted in PunBB 1.2 troubleshooting)

It's in Admin>Maintenance.

999

(5 replies, posted in PunBB 1.2 discussion)

Just put this before:

if (!$pun_user['is_guest']) {

and this after:

}

anything you want hidden from logged in users.

1,000

(16 replies, posted in PunBB 1.2 troubleshooting)

What exactly do you want to do? Get rid of them?