1

(1 replies, posted in PunBB 1.2 discussion)

Are you talking about URL rewriting or changing the title of the page?

2

(2 replies, posted in PunBB 1.2 troubleshooting)

http://punbb.informer.com/download/plug … styles.zip
Use this plugin to change all of the users style to the default and then delete all other styles from /style and /style/imports.  The files you'd want to keep in /style/imports are:
base.css
base_admin.css
minmax.js
[defaultstyle]_cs.css
index.html

Keep index.html and [defaultstyle].css in /style as well.

oban14 wrote:

I think there is a variable for emoticon size limit somewhere in the code that I need to adjust, but I'm not sure where it is and could use some advice on where to find it.

parser.php, line 775:

    foreach ($smilies as $smiley_text => $smiley_img)
    {
        if (strpos($text, $smiley_text) !== false)
            $text = preg_replace("#(?<=[>\s])".preg_quote($smiley_text, '#')."(?=\W)#m", '<img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="15" height="15" alt="'.substr($smiley_img, 0, strrpos($smiley_img, '.')).'" />', $text);
    }

4

(3 replies, posted in PunBB 1.2 troubleshooting)

'New member' can be adjusted in the admin panel in the section (in English) Users > Ranks.

NiCk Newman wrote:
MattF wrote:

The column(s) type has absolutely no bearing on the query. You have already had an explanation of what the column types mean.

Why u keep posting stuff that u dont understand? lol

Like I said in previous posts..

From Smartys

For instance, in your query, you join the users table twice. You join on two columns which are TEXT, which will make your query incredibly slow. Those columns should be INTs, just like their corresponding columns in the users table.


SO TEXT MAKES THEM SLOW HUH? REALLY? NOW I MADE THEM VARCHAR AND STUFF SHOULD THE QUERY BE THE SAME ? OR DOES IT JUST AUTOMATICALLY SPEED IT UP SINCE NOT ALL TEXT?S??

Thanks.

It actually does speed up because of using the correct types.  MattF is right, you don't need to modify the query at all.

http://punbb.informer.com/forums/topic/ … ns-solved/

Sorry for missing that bit. tongue  Didn't think the absence of the else would effect anything.

MattF wrote:

Just ditch that fourth parameter from the code. It obviously does nothing anyhow, if the option isn't available. big_smile I believe changing the character set was probably the prime change needed, so that last option should be fairly moot.

This ^.

According to PHP.net, the fourth parameter (double_encode) was added in PHP v5.2.3.  The last parameter is false and is defaulted as false, so you don't need it there.

8k84 wrote:

Hm... that's odd: I have two forums running punbb1.3.2, one works fine with suggested correction, while the other one gives the following error at the top of topic view page:

Warning: htmlentities() expects at most 3 parameters, 4 given in d:hstsaabnet-ru_d2d222f5httpclassifheader.php(133) : eval()'d code on line 76

Different PHP versions perhaps?

Put this in header.php right under // END SUBST - <pun_announcement>

// START SUBST - <pun_guest_message>
if ($pun_user['g_id'] == PUN_GUEST)
{
    ob_start();

?>
<div class="block">
    <h2><span>Guest Announcement</span></h2>
    <div class="box">
        <div class="inbox">
            <div>Message here.</div>
        </div>
    </div>
</div>
<?php
    
    $tpl_temp = trim(ob_get_contents());
    $tpl_main = str_replace('<pun_guest_message>', $tpl_temp, $tpl_main);
    ob_end_clean();
}
// END SUBST - <pun_guest_message>

Then, in include/template/main.tpl add:

<pun_guest_message>

Where you want it to show up.

Klappspaten wrote:

I searched all template and include files - but there is no line containing this expression.

It is in header.php right under the line:

// START SUBST - <body>

12

(9 replies, posted in PunBB 1.3 troubleshooting)

http://punbb.informer.com/forums/topic/ … ns-solved/

That will disable the currently used extensions.

It is in header.php.

// START SUBST - <body>
if (isset($focus_element))
{
    $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
    $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();">', $tpl_main);
}
// END SUBST - <body>

14

(15 replies, posted in Programming)

MattF wrote:
Tieguy wrote:

Sorry for the switch to single quotes, but I don't like using two [they confuse me for whatever reason].

    echo '<td><img width='50' height='50' src='.PUN_ROOT.'gallery/'.$file.'></td>
';

You do need the double-quotes for 1.1 strict validation, (I believe. Cant remember if single quotes are okay?). Best to put it as:

echo '<td><img width="50" height="50" src="'.PUN_ROOT.'gallery/'.$file.'"/></td>'."
";
Wikipedia wrote:

This contrasts with some earlier established traditions that began around the time of HTML 2.0, when many used uppercase tags. In XHTML, all attribute values must be enclosed by quotes; either single (') or double (") quotes may be used

Doesn't seem you need to, but no real reason not to.

15

(15 replies, posted in Programming)

Sorry for the switch to single quotes, but I don't like using two [they confuse me for whatever reason].

    echo '<td><img width=\'50\' height=\'50\' src='.PUN_ROOT.'gallery/'.$file.'></td>\n';

Change the main.tpl in /extensions/rem_board_header/ to this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <!-- forum_local -->>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- forum_head -->
</head>
<body>

<div id="brd-wrap" class="brd">
<div <!-- forum_page -->>

<div id="brd-head" class="gen-content">
    <!-- forum_skip -->
    <!-- forum_title -->
    <!-- forum_desc -->
</div>

<div id="brd-navlinks" class="gen-content">
    <!-- forum_navlinks -->
    <!-- forum_admod -->
</div>

<div id="brd-visit" class="gen-content">
    <!-- forum_welcome -->
    <!-- forum_visit -->
</div>

<div class="hr"><hr /></div>

<div id="brd-main">
    <!-- forum_main_title -->
    <!-- forum_crumbs_top -->
    <!-- forum_main_pagepost_top -->
    <!-- forum_admin_menu -->
    <!-- forum_admin_submenu -->
    <!-- forum_main -->
    <!-- forum_main_pagepost_end -->
    <!-- forum_crumbs_end -->
</div>

<div class="hr"><hr /></div>

<div id="brd-about" class="gen-content">
    <!-- forum_about -->
</div>

<!-- forum_debug -->

</div>
</div>

</body>
</html>

Uninstall the extension, replace the extension files, then install again.  Sorry for the mixup tongue.

Use this one, sorry.

http://upit.cc/files/4a5377287c8377086f … a3b3fc.rar

The other had an unexpected error.

http://upit.cc/files/81f93497503fbad4b7 … ba6924.rar

This'll do it.

http://upit.cc/files/2f9f7fb4e9fa961e51 … 14bec6.rar

A quick extension I wrote that you can use to remove it.

I'll write this up for you real quick.

MySQL Query:

ALTER TABLE `users` ADD `last_pass_request` INT( 10 ) NOT NULL

Open Login.php
Find:

        // Validate the email-address
        $email = strtolower(trim($_POST['req_email']));
        if (!is_valid_email($email))
            message($lang_common['Invalid e-mail']);

Add after:

        $result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\' AND last_pass_request>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
        if ($db->num_rows($result))
            message('A user has requested a new password too recently to send another.  Please wait an hour or contact an admistrator.');

        // Add the last password request for this email to the database
        $db->query('UPDATE users SET last_pass_request="'.time().'" WHERE email="'.$db->escape($email).'"') or error('Unable to add last password request info to the database', __FILE__, __LINE__, $db->error());

I tested and it worked on my local server.  Let me know if there are any problems.

In search.php, find:

            // If it's a search for new posts
            if ($action == 'show_new')
            {
                if ($pun_user['is_guest'])
                    message($lang_common['No permission']);

                $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL ') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
                $num_hits = $db->num_rows($result);

                if (!$num_hits)
                    message($lang_search['No new posts']);
            }
            // If it's a search for todays posts
            else if ($action == 'show_24h')
            {
                $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400).' AND t.moved_to IS NULL') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
                $num_hits = $db->num_rows($result);

                if (!$num_hits)
                    message($lang_search['No recent posts']);
            }

Replace with:

            // If it's a search for new posts
            if ($action == 'show_new')
            {
                if ($pun_user['is_guest'])
                    message($lang_common['No permission']);

                $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL AND t.forum_id != *forumidhere*  ') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
                $num_hits = $db->num_rows($result);

                if (!$num_hits)
                    message($lang_search['No new posts']);
            }
            // If it's a search for todays posts
            else if ($action == 'show_24h')
            {
                $result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400).' AND t.moved_to IS NULL AND t.forum_id != *forumidhere* ') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
                $num_hits = $db->num_rows($result);

                if (!$num_hits)
                    message($lang_search['No recent posts']);
            }

Be sure to replace *forumidhere* with the forum id of the buy/sell forum.

22

(3 replies, posted in Discussions)

I believe it may only check versions for the 2.* branch.

Not sure if it's been posted, but http://bbs.archlinux.org/.  Arch is a rather large distro.

MattF wrote:
hcgtv wrote:
Anatoly wrote:

I can't say now for how long.

If and when you stop support for 1.2, you'll open the door to someone putting up their own community support site.

I'd completely agree on that point. There are a lot of us who have no intention of going with the latest and "greatest" unless absolutely necessary, or unless other circumstances require it.

I'll agree and join the club. 1.2 for the win. tongue

25

(3 replies, posted in PunBB 1.2 show off)

hcgtv wrote:

Invite your homies.

Nice skins, though the selector shouldn't show for guests, it does nothing.

The only problem I see is that with all the graphics on the top, the forum actually begins below my available browser space. Like I click a forum and all I see are the header images and I have to scroll down, could get old.

Yeah, I'm gonna disable that for guests, didn't think of that somehow. tongue

And for the ad, maybe I can add a javascript button to minimize it, I dunno.  Thanks for checking it out though.