126

(16 replies, posted in General discussion)

This area seems to be causing the problem Matt. If I remove it and curly bracket, all the errors go away. I am lost.


<?php
        if ($cur_topic['moved_to'] != 0) {
            $item_status .= 'imoved';
            $icon_type = 'icon imoved';
            echo '<td class="tcr"><img src="'.$pun_config['o_base_url'].'/img/topic_moved.gif" alt="Topic Moved" title="Topic Moved" /> Topic Moved</td>';
}else {


?>

127

(16 replies, posted in General discussion)

I tried that but it is required or else it doesn't work.

128

(16 replies, posted in General discussion)

This is my mod active topics and for the life of me I can't get it to validate. Can someone please lend a hand. I've been trying for hours now and with no success. Here is the code below as well as the link to show what is being displayed.

http://validator.w3.org/check?uri=http% … Findex.php

<?php
/*

PunBB Active Topics

Copyright 2004-2005 Alex King, http://www.alexking.org/

This is a mod for PunBB, http://www.punbb.org/
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (rickard@punbb.org)

This file is based on the viewtopic.php file in PunBB.

-------------------------------
*/

$ak_limit = 10; // change this to the number of active topics you want to display.

$result = $db->query('
    SELECT p.poster_id AS has_posted, t.* 
    FROM '.$db->prefix.'topics AS t 

LEFT JOIN '.$db->prefix.'posts AS p ON p.id=p.topic_id AND p.poster_id='.$pun_user['id'].' 
    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
    ) 
    GROUP BY t.id
    ORDER BY t.last_post DESC
    LIMIT '.$ak_limit
) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

$new_topics = get_all_new_topics();

?>

<div id="vf" class="blocktable">
    <h2><span>Latest Active Topics</span></h2>


    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr><th style="border-left: 0px;" class="tc0"> </th>
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>
            <tbody>
<?php

// If there are topics in this forum.
if ($db->num_rows($result))
{
// added for forum row differnetial colors
$alt = true;
// added for forum row differnetial colors

    while ($cur_topic = $db->fetch_assoc($result))
    {
// added for forum row differnetial colors
    $alt = !$alt;
// added for forum row differnetial colors

        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'icon';

        if ($cur_topic['moved_to'] == null)
            $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
        else
            $last_post = ' ';

        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        if ($cur_topic['moved_to'] != 0) {
            $item_status .= 'imoved';
            $icon_type = 'icon imoved';
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
}
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class=""><br />'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }
                            // gleek edit
                        if ($cur_topic['num_replies'] >= $pun_config['o_hot_count'])
                        {
                                $item_status .= 'ihot';
                                $icon_type = 'icon ihot';
                        }
        if (!$pun_user['is_guest'] && topic_is_new($cur_topic['id'], $id,  $cur_topic['last_post']) && $cur_topic['moved_to'] == null)
        {
            $icon_text .= ' '.$lang_common['New icon'];
            $item_status .= ' inew';
            $icon_type = 'icon inew';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '<span class="newtext">[<a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>]</span>';
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
        {
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<img src="img/'.$pun_user['style'].'/buttons/btn_just_posted.png" title="'.$lang_forum['User has just posted'].'" alt="'.$lang_forum['User has just posted'].'" /> '.$subject;
            else
                $subject = '  '.$subject;
        }

        if ($cur_topic['sticky'] == '1')
        {
            $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];
        }

        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= '  '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
        }
// added for forum row differnetial colors
if ($alt)
{
    $item_status .= 'alt';
}
// added for forum row differnetial colors
?>
                <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
            <td style="border-left: 0;" class="tc0"><div class="<?php echo $icon_type ?>"> </div></td>
                    <td class="tc1"><?php echo $subject."\n" ?> </td>


                    <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : ' ' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></td>


<?php
        if ($cur_topic['moved_to'] != 0) {
            $item_status .= 'imoved';
            $icon_type = 'icon imoved';
            echo '<td class="tcr"><img src="'.$pun_config['o_base_url'].'/img/topic_moved.gif" alt="Topic Moved" title="Topic Moved" /> Topic Moved</td>';
}else {


?>


                    <td class="tcr"><?php echo $last_post ?></td>
                </tr>
<?php
}
    }
}
else
{

?>
                <tr>
                    <td class="tcl" colspan="5"><?php echo $lang_forum['Empty forum'] ?></td>
                </tr>
<?php

}

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

Thanks in advance.

Well, thank you very much Smartys. I removed the first line. I am learning slowly. smile

Is this correct:

        $username = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><span style="color:'.$cur_post['g_color'].'">' . pun_htmlspecialchars($cur_post['username']) . '</span></a> ';

        if ($cur_post['username'] != $pun_user['username']) {
        $username = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><span style="color:'.$cur_post['g_color'].'">' . pun_htmlspecialchars($cur_post['username']) . '</span></a> <a href="javascript:void(0)" onClick="document.getElementById(\'show_quick\').style.display = \'none\' ? \'block\' : \'none\'; insert_text(\'[b][color=red]@'.pun_htmlspecialchars($cur_post['username']).'[/color][/b] - \',\'\');" rel="nofollow" title="'.$lang_topic['Address Post'].'"><img style="vertical-align: middle;" src="'.$pun_config['o_base_url'].'/img/address_to.gif" alt="'.$lang_topic['Address To'].'" title="'.$lang_topic['Address To'].'" /></a>';
        }else{
        $username = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><span style="color:'.$cur_post['g_color'].'">' . pun_htmlspecialchars($cur_post['username']) . '</span></a>';
        }

Well, what that does is it makes ever user have the same name.

In my viewtopic I added a small feature that simply uses javascript to insert some text that would allow you to insert @usename. The problem I have is that I need to find out how I can make it so that I myself can't address the feature to myself. I have posted the code below and it is the code after the username while in viewtopic:

$username = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><span style="color:'.$cur_post['g_color'].'">' . pun_htmlspecialchars($cur_post['username']) . '</span></a> <a href="javascript:void(0)" onClick="document.getElementById(\'show_quick\').style.display = \'none\' ? \'block\' : \'none\'; insert_text(\'[b][color=red]@'.pun_htmlspecialchars($cur_post['username']).'[/color][/b] - \',\'\');" rel="nofollow" title="'.$lang_topic['Address Post'].'"><img style="vertical-align: middle;" src="'.$pun_config['o_base_url'].'/img/address_to.gif" alt="'.$lang_topic['Address To'].'" title="'.$lang_topic['Address To'].'" /></a>';

133

(3 replies, posted in General discussion)

Thanks Matt. smile

134

(3 replies, posted in General discussion)

This is just a general announcement to let those of you who are interested in Mega Pun know that it is now on a new domain. Please come on over and check it out. I have added a new style which now uses 3 images to accomplish the rounded edges. I think it is a first for punBB becuase I have not seen it before on any styles. Anyway, here is the new link.

http://megapun.com

Cheers!

135

(12 replies, posted in General discussion)

Thanks guys. That solved the problem.

136

(12 replies, posted in General discussion)

That didn't work. In in fact triples all the subjects.

137

(12 replies, posted in General discussion)

Ok, so how do I go about doing that? I have no clue. sad

138

(12 replies, posted in General discussion)

ohh..ok, thank you very much. big_smile

139

(12 replies, posted in General discussion)

That actually worked. Can you tell me why that works?

140

(24 replies, posted in General discussion)

Well, I assigned an id to the link in the additional links window and setup the style for it. There was no effect.

141

(24 replies, posted in General discussion)

I could do that but what would separate it from when I click on the link and when I don't?

142

(24 replies, posted in General discussion)

yes, and it only works with those that are also assigned id's in the functions file.

143

(24 replies, posted in General discussion)

That does not work.

144

(24 replies, posted in General discussion)

Hi Matt,

This is what I have as an example. So how would I use for the blogs based on what you said above.

#punindex        #brdmenu li#navindex a, 
#punuserlist     #brdmenu li#navuserlist a, 
#punnews         #brdmenu li#navnews a,
#pundownloads    #brdmenu li#navdownloads a,
#punuploadimg     #brdmenu li#navuploadimg a, 
#punprofile      #brdmenu li#navprofile a, 
#punadmin        #brdmenu li#navadmin a,
#punregister     #brdmenu li#navregister a, 
#punmessage_list  #brdmenu li#navmessage_list a, 
#punlogin        #brdmenu li#navlogin a, 
#punsearch       #brdmenu li#navsearch a
{    font-weight: bold;
    color: #0049a4;
    background-color: inherit;
}

145

(24 replies, posted in General discussion)

That would be a great idea actually. As for the 1st part of your response. I did not want to add those links to the functions file.

Scot, I think you should start coding this idea. big_smile

146

(24 replies, posted in General discussion)

Well, what I mean when I say external links is the extra links. So in my case I have <a href="blogs.php">Blog</a> with no id there it is impossible to accomplish what I want to do, unless I add it to the functions file. That sorta defeats the purpose of it all. I didn't wnat to have to add a new link each time to functions.

Maybe they should have it default to a message that says something like: Invalid Search. Just a thought. big_smile

148

(24 replies, posted in General discussion)

I know that, and this is what I was trying to avoid.

I am not sure if anyone has experienced this before but I just endtered in the search filed on punres. tabs' and it comes up with:


An error was encountered
Error: Unable to perform search.

150

(24 replies, posted in General discussion)

I will try that but I am not sure if that recognizes external links. I woul dhave thought that the id navextra would do that. Maybe some code should be written for that to recognize all external links to use that.