676

(8 replies, posted in General discussion)

This is the mod I am using and I am assuming that this is the only one that can send it out. http://www.punres.org/viewtopic.php?id=729

677

(8 replies, posted in General discussion)

That's just it. I checked every file and I can't find it. The only mod that would send the PM would be the Private Message mod and I have checked every file, including the readme file that came with it.

678

(8 replies, posted in General discussion)

I obviously installed a mod on my site so that when I am notified by email if I receive a new Private Message. When I do receive the message it is in French and for the life of me I can't find it in any of the language files:

L'utilisateur 'user' dans le forum http://site.com vous a envoy  un Message Priv .

-- E-mail automatique (Ne r pondez pas ce message)

I have checked every file I can possibly think of, including core files but can't find it anywhere. I also checked the PM mod and nothing in there either. Can anyone tell me where this text coul dbe located?

Thanks
Bingiman

Even though I know I won't get an answer for this problem on these forums, I figure it would be worth a final try. So here goes. I am using the Easy Poll + mod but also have the Icon Topics installed. This is my problem. When I use the Topic Icons in the post they are not displayed unless I remove the Easy Poll MOD code from the post.php file. Hopefully someone can help me with it. Here is the code area I know the problem is in.

        // If it's a new topic
        else if ($fid)
        {
            $icon_topic = $_POST['icon_topic'];
            if(isset($ptype)) // Si c'est un sondage
            {
                if ($ptype == 3) 
                    $db->query('INSERT INTO ' . $db->prefix . 'topics (poster, subject, posted, last_post, last_poster, forum_id, question, yes, no) VALUES(\'' . $db->escape($username) . '\', \'' . $db->escape($subject) . '\', ' . $now . ', ' . $now . ', \'' . $db->escape($username) . '\', ' . $fid . ', \'' . $db->escape($question) . '\', \'' . $db->escape($yesval) . '\', \'' . $db->escape($noval) . '\')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());
                else
                    $db->query('INSERT INTO ' . $db->prefix . 'topics (poster, subject, posted, last_post, last_poster, forum_id, question) VALUES(\'' . $db->escape($username) . '\', \'' . $db->escape($subject) . '\', ' . $now . ', ' . $now . ', \'' . $db->escape($username) . '\', ' . $fid . ', \'' . $db->escape($question) . '\')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());

                $new_tid = $db->insert_id();
                if ($ptype != 0) 
                    $db->query('INSERT INTO ' . $db->prefix . 'polls (pollid, options, ptype) VALUES(' . $new_tid . ', \'' . $db->escape(serialize($option)) . '\', ' . $ptype . ')') or error('Unable to create poll', __FILE__, __LINE__, $db->error());
            }
            else
            {
            // Create the topic
    $db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id, icon_topic) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.', '.$icon_topic.')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());
            $new_tid = $db->insert_id();
            }
            if (!$pun_user['is_guest'])
            {
                // To subscribe or not to subscribe, that ...
                if ($pun_config['o_subscriptions'] == '1' && (isset($_POST['subscribe']) && $_POST['subscribe'] == '1'))
                    $db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$new_tid.')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());

                // Create the post ("topic post")
                $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
            }
            else
            {
                // Create the post ("topic post")
                $email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
                $db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
            }
            $new_pid = $db->insert_id();

            // Update the topic with last_post_id
            $db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());

            update_search_index('post', $new_pid, $message, $subject);

            update_forum($fid);
        }

        // If the posting user is logged in, increment his/her post count
        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

                $upload_result = process_uploaded_images($new_pid);
        redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $upload_result.$lang_post['Post redirect']);
    }
}

I added a new <pun_status> block below the original one and just named it <pun_status2>. Here is my problem. If I enter the forums it displays as it should but in viewtopic I would like it to be completley invisible. I've tried for hours and hours and I don't know what I can add to remove it when in viewtopic mode. Can someone please tell me what I need to add: Here is the code:

Original code:

// START SUBST - <pun_status>
require PUN_ROOT.'lang/'.$pun_user['language'].'/welcome.php';
if ($pun_user['is_guest'])
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".($pun_config['o_welcome_guest']? '<b>'.$lang_welcome['Welcome'].'!</b>'."\n\t\t" : '').'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';  //welcome mod
else
{
    $is_welcome = time()-$pun_user['cur_visit']<60*$pun_config['o_timeout_welcome'];    //display welcome text for N mins.
    $is_welcome = $pun_config['o_timeout_welcome']<0? 1 : $is_welcome;              //if negative, always show the text.
    $realname = $pun_config['o_welcome_full_name']? $pun_user['realname'] : substr($pun_user['realname'],0,strpos($pun_user['realname'],' '));
    $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".($is_welcome? '<li><b>'.$lang_welcome['Welcome'].' '.pun_htmlspecialchars($realname).'!</b></li>' : '').'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
    if ($pun_user['g_id'] < PUN_GUEST)
    {
        $result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());

        if ($db->result($result_header))
            $tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';

        if ($pun_config['o_maintenance'] == '1')
            $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
    }
    require(PUN_ROOT.'include/pms/header_new_messages.php');
        if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}

$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status>

New code I added:

// START SUBST - <pun_status>
 
if ($pun_user['is_guest'])
    $tpl_temp = '<div id="brdwelcome2" class="inbox"> </div>';  //welcome mod
else
{
 
 
    $tpl_temp = '<div id="brdwelcome2" class="boxed">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".($is_welcome? '<li><b>'.$lang_welcome['Welcome'].' '.pun_htmlspecialchars($realname).'!</b></li>' : '').'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
    if ($pun_user['g_id'] < PUN_GUEST)
    {
 
        if ($pun_config['o_maintenance'] == '1')
            $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
    }
 
        if (in_array(basename($_SERVER['PHP_SELF']), array('forum.php', 'search.php')))
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
    else
        $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}

$tpl_main = str_replace('<pun_status2>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status2>

Thanks

681

(3 replies, posted in PunBB 1.2 discussion)

Glad to have helped.

If you're using the Karma, Colored Usergroup and Country Flag MOD, then this one will be to your liking:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';


if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);


// Load the userlist.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/userlist.php';

// Load the search.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/search.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/profile.php';

// Determine if we are allowed to view post counts
$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;

$username = (isset($_GET['username']) && $pun_user['g_search_users'] == '1') ? $_GET['username'] : '';
$show_group = (!isset($_GET['show_group']) || intval($_GET['show_group']) < -1 && intval($_GET['show_group']) > 2) ? -1 : intval($_GET['show_group']);
$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
$sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']);


$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list'];
if ($pun_user['g_search_users'] == '1')
    $focus_element = array('userlist', 'username');

define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

?>
<div class="blockform">
    <h2><span><?php echo $lang_search['User search'] ?></span></h2>
    <div class="box">
    <form id="userlist" method="get" action="userlist.php">
        <div class="inform">
            <fieldset>
                <legend><?php echo $lang_ul['User find legend'] ?></legend>
                <div class="infldset">
<?php if ($pun_user['g_search_users'] == '1'): ?>                    <label class="conl"><?php echo $lang_common['Username'] ?><br /><input class="textbox" type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
<?php endif; ?>                    <label class="conl"><?php echo $lang_ul['User group']."\n" ?>
                    <br /><select class="textbox" name="show_group">
                        <option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
<?php

$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());

while ($cur_group = $db->fetch_assoc($result))
{
    if ($cur_group['g_id'] == $show_group)
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
    else
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
}

?>
                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
                    <br /><select class="textbox" name="sort_by">
                        <option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
                        <option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
<?php if ($show_post_count): ?>                        <option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
<?php endif; ?>                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
                    <br /><select class="textbox" name="sort_dir">
                        <option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
                        <option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
                    </select>
                    <br /></label>
                    <p class="clearb"><?php echo $lang_ul['User search info'] ?></p>
                </div>
            </fieldset>
        </div>
        <p><input class="button" type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
    </form>
    </div>
</div>
<?php


// Create any SQL for the WHERE clause
$where_sql = array();
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';

if ($pun_user['g_search_users'] == '1' && $username != '')
    $where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
if ($show_group > -1)
    $where_sql[] = 'u.group_id='.$show_group;

// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);


// Determine the user offset (based on $_GET['p'])
$num_pages = ceil($num_users / 50);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = 50 * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&show_group='.$show_group.'&sort_by='.$sort_by.'&sort_dir='.strtoupper($sort_dir));


?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>

<div id="users1" class="blocktable">
    <h2><span><?php echo $lang_common['User list'] ?></span></h2>
    <div class="box">
        <div class="inbox">
        <table cellspacing="0">
        <thead>
            <tr>
                <th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
                <th class="tc2" scope="col"><?php echo 'Group Title'; ?></th>
            <th class="tc4" scope="col">Avatar</th>
            <th class="tc3" scope="col">Karma</th>
<?php if ($show_post_count): ?>                <th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>                                    
<?php endif; ?>                <th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
                     <th class="tcr" scope="col"><?php echo $lang_profile['Country'] ?></th>
            </tr>
        </thead>
        <tbody>
<?php

// Grab the users
$result = $db->query('SELECT u.karma, u.id, u.username, u.title, u.num_posts, u.registered, u.use_avatar, u.country, g.g_id, g.g_user_title, g.g_color FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
{
    while ($user_data = $db->fetch_assoc($result))
    {
        $user_group = $user_data['g_user_title'];
        $user_title_field = get_title($user_data);
        $user_country = $user_data['country'];
        $user_avatar = '';
        
        if ($pun_config['o_avatars'] == '1' && $user_data['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png" '.$img_size[3].' alt="" />';
        }
        else
            $user_avatar = '';
        
?>
                <tr>
                    <td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'"><span style="color:'.$user_data['g_color'].'">'.pun_htmlspecialchars($user_data['username']).'</span></a>' ?><br /><?php echo $user_title_field ?></td>
        <td class="tc2"><?php echo $user_group ?></td>
        <td class="tc4"><?php echo $user_avatar ?></td>
        <td class="tc3"><?php echo $user_data['karma'] ?></td>
<?php if ($show_post_count): ?>
        <td class="tc3"><?php echo $user_data['num_posts'] ?></td>
<?php endif; ?>
        <td class="tcr"><?php echo format_time($user_data['registered'], true) ?></td>
        <td class="tcr">
<?php if ( $user_country != '' ) {
echo '<img src="./img/flags/'.$user_country.'.png" alt="'.$user_country.'" title="'.$user_country.'" />'; } ?>
        </td>
            </tr>
<?php

    }
}
else
    echo "\t\t\t".'<tr>'."\n\t\t\t\t\t".'<td class="tcl" colspan="'.(($show_post_count) ? 4 : 3).'">'.$lang_search['No hits'].'</td></tr>'."\n";

?>
            </tbody>
            </table>
        </div>
    </div>
</div>

<div class="linksb">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>
<?php

require PUN_ROOT.'footer.php';

683

(3 replies, posted in PunBB 1.2 discussion)

You could use my tweak in the viewtopic.php file

        // Format the online indicator
        $is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic[''].'</strong>' : $lang_topic[''];

        if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' title="'.$cur_post['username'].'\'s Avatar" alt="'.$cur_post['username'].'\'s Avatar" /></a>';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' title="'.$cur_post['username'].'\'s Avatar" alt="'.$cur_post['username'].'\'s Avatar" /></a>';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' title="'.$cur_post['username'].'\'s Avatar" alt="'.$cur_post['username'].'\'s Avatar" /></a>';
        }
        else
            $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img alt="" src="img/noimage.gif" /></a>';

adding RSS to the sub-forum mod.

Open viewforum.php and look for:

        $forum_field = '<h3><a href="viewforum.php?id='.$cur_subforum['id'].'">'.pun_htmlspecialchars($cur_subforum['forum_name']).'</a></h3>

replace with:

        $forum_field = '<h3><a href="viewforum.php?id='.$cur_subforum['id'].'">'.pun_htmlspecialchars($cur_subforum['forum_name']).'</a></h3><div style="float:right;"><a href="extern.php?type=rss&action=active&fid='.$cur_subforum['id'].'"><img style="vertical-align: middle;" src="img/rss.png" border="0" height="15" width="27" alt="RSS" align="middle" /></a></div>';

Can someone please help me out here. I have the image upload mod installed and I just installed the Easy Poll + mod. It all seems to work fine but I have a problem in the admin_option.php file. When I click on the checkbox to save the permissions, it just remains blank.

Here is the code I am using at the moment:

                // Now let's deal with the permissions
        if (isset($_POST['read_forum_old']))
        {
            $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics, g_post_polls FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Impossible de reFIND la liste des groupes d\'utilisateurs', __FILE__, __LINE__, $db->error());
            while ($cur_group = $db->fetch_assoc($result))
            {
                $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']];
                $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0';
                $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0';
                $post_polls_new = isset($_POST['post_polls_new'][$cur_group['g_id']]) ? $_POST['post_polls_new'][$cur_group['g_id']] : '0';

                // Check if the new settings differ from the old
                if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']] || $post_polls_new != $_POST['post_polls_old'][$cur_group['g_id']])
                {
                    // If the new settings are identical to the default settings for this group, delete it's row in forum_perms
                    if ($read_forum_new == '1' && $post_replies_new == $cur_group['g_post_replies'] && $post_topics_new == $cur_group['g_post_topics'] && $post_polls_new == $cur_group['g_post_polls'])
                        $db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                    else
                    {
                        // Run an UPDATE and see if it affected a row, if not, INSERT
                        $db->query('UPDATE '.$db->prefix.'forum_perms SET read_forum='.$read_forum_new.', post_replies='.$post_replies_new.', post_topics='.$post_topics_new.', post_polls='.$post_polls_new.' WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible d\'insérer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                        if (!$db->affected_rows())
                            $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics, post_polls) VALUES('.$cur_group['g_id'].', '.$forum_id.', '.$read_forum_new.', '.$post_replies_new.', '.$post_topics_new.', '.$post_polls_new.')') or error('Impossible d\'insérer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                    }
                }
            }
        }

and this is the code from the readme.txt file of the Easy Poll +

                // Now let's deal with the permissions
        if (isset($_POST['read_forum_old']))
        {
            $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics, g_post_polls FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Impossible de reFIND la liste des groupes d\'utilisateurs', __FILE__, __LINE__, $db->error());
            while ($cur_group = $db->fetch_assoc($result))
            {
                $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']];
                $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0';
                $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0';
                $post_polls_new = isset($_POST['post_polls_new'][$cur_group['g_id']]) ? $_POST['post_polls_new'][$cur_group['g_id']] : '0';

                // Check if the new settings differ from the old
                if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']] || $post_polls_new != $_POST['post_polls_old'][$cur_group['g_id']])
                {
                    // If the new settings are identical to the default settings for this group, delete it's row in forum_perms
                    if ($read_forum_new == '1' && $post_replies_new == $cur_group['g_post_replies'] && $post_topics_new == $cur_group['g_post_topics'] && $post_polls_new == $cur_group['g_post_polls'])
                        $db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                    else
                    {
                        // Run an UPDATE and see if it affected a row, if not, INSERT
                        $db->query('UPDATE '.$db->prefix.'forum_perms SET read_forum='.$read_forum_new.', post_replies='.$post_replies_new.', post_topics='.$post_topics_new.', post_polls='.$post_polls_new.' WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible d\'insérer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                        if (!$db->affected_rows())
                            $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics, post_polls) VALUES('.$cur_group['g_id'].', '.$forum_id.', '.$read_forum_new.', '.$post_replies_new.', '.$post_topics_new.', '.$post_polls_new.')') or error('Impossible d\'insérer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
                    }
                }
            }
        }

I need to incorporate the code below with the one above where you can see I am using the image_upload mod.

Thank you for any help.

Bingiman

I am just using Windows XP Pro on my PC

I also noticed something today. How come I don't see the saved info in the "Alter Settings" area. I add the paths to the icons etc and the path to save files and it always shows up blank and icons aren't displayed next to the attachments. I also noticed that my files are being saved in my C drive root folder. (It is my local site and not a production site just yet) and it doesn't matter what I use as the path.

Thanks Frank,

I've sent the files via email to you.

Cheers!
Bingiman

I am having a strange problem with this mod. I am using the latest version of punBB. Here is the problem. I attach a file either using "post" or "new thread" but the file does not get posted. However, if I edit the post and then attach the file, it then displays on the thread. Any idea why this is happening? I've reinstalled this mod 3 times so far and get the same results.

Thanks
Bingiman

Can someone please tell me how I can format my button for other sites such as DIGG, Technorati etc..

I have the digg url working but I don't know how to do the others like on this site here:

http://www.hunlock.com/blogs/Ten_Javasc … hould_Have

Here is my Digg URL:

<img src="http://digg.com/img/badges/10x10-digg-thumb.png" width="10" height="10" alt="Digg!" /> <a href="http://digg.com/submit?phase=2&url='.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Digg It</a>

any help would be greatly appreciated.

Thanks
Bingiman

Can someone please tell me if this Digg url has been formatted properly. I am running a local site and I'm assuming that it does not work because of the static ip address

<img src="http://digg.com/img/badges/10x10-digg-thumb.png" width="10" height="10" alt="Digg!" /> <a href="http://digg.com/submit?phase=2&url='.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Digg It</a>

Thanks!
Bingiman

692

(15 replies, posted in PunBB 1.2 troubleshooting)

Thank you very much for that. I still need to figure out the answer to my previous question above your last post.:(

693

(15 replies, posted in PunBB 1.2 troubleshooting)

Can I ask you another question. I added a read more icon to my news index but I wanted to know if there is a way I can have it so that if there isn't any more text in that particular post to read then the read more button remains hidden.

Thanks
Bingiman

694

(15 replies, posted in PunBB 1.2 troubleshooting)

Thank you very, very much. I really appreciate this. It works great now.

Cheers!
Bingiman big_smile

695

(15 replies, posted in PunBB 1.2 troubleshooting)

Here is my index file. Hopefully you can help me with it.

<?php
 
define('PUN_ROOT', './');
//define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
 
function pun_news($fid='', $show=15, $truncate=1)
{
    global $lang_common, $db, $pun_config, $db_prefix;
    $max_subject_length = 30;
    $show_max_topics = 50;
    $fid = intval($fid);
    $order_by = 't.posted';
    $forum_sql = '';
    // Was a forum ID supplied?
    if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
    $show = intval($show);
    if ($show < 1 || $show > $show_max_topics)
    $show = 15;
    $saveddate="";
    // Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.num_replies, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
    $show_count = 0;
    if ( !$db->num_rows($result) ) return $output;
    while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {
        $temp = '';
        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);
        if (pun_strlen($cur_topic['subject']) > $max_subject_length)
            $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
        else
            $subject_truncated = $cur_topic['subject'];
        $newsheading = '<div style="margin-top:-8px;"><a class="news-links" href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a><br /><em>Posted by <b>'.$cur_topic['poster'].'</b> at '.date('h:i A', $cur_topic['posted']).'</em><br /><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$cur_topic['num_replies'].' Comments...</a></div>';
        // Group posts by date    
        $thisdate = date('l, d F Y', $cur_topic['posted']);
        if ($thisdate != $saveddate) 
 
        {
            if ($saveddate)
            {
                $temp .= "</div></div>";
            }
            $temp .= '<div class="block"><h2><span>'.$thisdate.'</span></h2><div class="box"><div class="inbox"><br />';
            $saveddate = $thisdate;
        }
        else {
            $temp .= '<div class="inbox"><br />';
        }
        $temp .= $newsheading.'<br />';
        $id = $cur_topic['id'];
        $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
            if ( !$db->num_rows($msg) ) continue;
        $cur_post = $db->fetch_assoc($msg);
        // Display first paragraph only (comment out next four lines to turn off)
        if ($truncate == 1)
        {
        $paragraph = preg_split("/s*n+/", $cur_post['message']);
            if (isset($paragraph[1])) {
                $cur_post['message'] = $paragraph[0] . "...";
            }
        }
        $cur_post['message'] = parse_message($cur_post['message'], 0);
        $temp .= $cur_post['message'];
        $temp .= "</div>";
        if (isset($output)) {
            $output .= $temp;
        }
        else {
            $output = $temp;
        }
        ++$show_count;
    } // end of while
    $output .= "</div></div>";
    return $output;
}
?>
 
        <div class="block">
            <h2><span>Welcome</span></h2>
            <div class="box">
                <div class="inbox">
Welcome
                </div>
            </div>
        </div>
<?php
echo pun_news(2, 5, 0);
 
require PUN_ROOT.'footer.php';

Thanks in advance
Bingiman

696

(15 replies, posted in PunBB 1.2 troubleshooting)

Well, I added the comments like on your page but I can't figure out how to truncate at 250. I am using the miniportal hack and I am just totally lost as to how I can do it.

Bingiman

697

(15 replies, posted in PunBB 1.2 troubleshooting)

What about now? Is it a good time to bump? I can't believe no one can help me on this.

Hi Quaker,

Where did you get the mod (punfrontapage) to add blocks to both sides of your site?

Thanks
Bingiman

My solution to this problem is simple. I commented out this line in index.php

//define('PUN_QUIET_VISIT', 1);

Can someone please help me out here. I am using the minportal and I would like to have the avatars show up to the right of the news on the index page. I've tried adding it from code taken out from the viewtopic but nothing seems to work. Here is my code for index.php.

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
 
function pun_news($fid='', $show=15, $truncate=1)
{
    global $lang_common, $db, $pun_config, $db_prefix;
    $max_subject_length = 30;
    $show_max_topics = 50;
    $fid = intval($fid);
    $order_by = 't.posted';
    $forum_sql = '';
    // Was a forum ID supplied?
    if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
    $show = intval($show);
    if ($show < 1 || $show > $show_max_topics)
    $show = 15;
    $saveddate="";
    // Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.num_replies, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
    $show_count = 0;
    if ( !$db->num_rows($result) ) return $output;
    while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {
        $temp = '';
        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);
        if (pun_strlen($cur_topic['subject']) > $max_subject_length)
            $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
        else
            $subject_truncated = $cur_topic['subject'];
        $newsheading = '<div style="margin-top:-8px;"><a class="news-links" href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a><br /><em>Posted by <b>'.$cur_topic['poster'].'</b> at '.date('h:i A', $cur_topic['posted']).'</em><br /><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$cur_topic['num_replies'].' Comments...</a></div>';
        // Group posts by date    
        $thisdate = date('l, d F Y', $cur_topic['posted']);
        if ($thisdate != $saveddate) 
 
        {
            if ($saveddate)
            {
                $temp .= "</div></div>";
            }
            $temp .= '<div class="block"><h2><span>'.$thisdate.'</span></h2><div class="box"><div class="inbox"><br />';
            $saveddate = $thisdate;
        }
        else {
            $temp .= '<div class="inbox"><br />';
        }
        $temp .= $newsheading.'<br />';
        $id = $cur_topic['id'];
        $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
            if ( !$db->num_rows($msg) ) continue;
        $cur_post = $db->fetch_assoc($msg);
        // Display first paragraph only (comment out next four lines to turn off)
        if ($truncate == 1)
        {
        $paragraph = preg_split("/s*n+/", $cur_post['message']);
            if (isset($paragraph[1])) {
                $cur_post['message'] = $paragraph[0] . "...";
            }
        }
        $cur_post['message'] = parse_message($cur_post['message'], 0);
        $temp .= $cur_post['message'];
        $temp .= "</div>";
        if (isset($output)) {
            $output .= $temp;
        }
        else {
            $output = $temp;
        }
        ++$show_count;
    } // end of while
    $output .= "</div></div>";
    return $output;
}
?>
 
        <div class="block">
            <h2><span>Welcome</span></h2>
            <div class="box">
                <div class="inbox">
                Welcome to <font color="#2F7000"><b>Skefe</b></font> - <b>Freeup your Mind.</b><br />I truly hope you enjoy your stay with us. If you're not a registered member, then please go right ahead and sign up now.
                </div>
            </div>
        </div>
<?php
echo pun_news(2, 5, 0);
 
require PUN_ROOT.'footer.php';

Thanks in advance.
Bingiman