You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 7 of 30)
Pages Previous 1 … 5 6 7 8 9 … 30 Next
This won't work for me. I think you misunderstood what I am asking. I may not be explaining it properly. I'll try again.
Lets say I have Index - Forum - Downloads. I click on Index and it is shaded as "red", now I click on Forum and that is now "red" but Index is now "white"...Hope you follow.
Bingiman
There seems to be a problem with my mod_active_topics. I modified the db query in order to show the Hot Topics Icon. Here is the code below. The problem is that if I reply to the post for example 5 times, I see 5 different lines of the same subject when in fact it should just show as one. Can someone please look at it and tell me what needs to be changed?
<?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
)
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="Moved" title="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 Bingiman
Well, not really. For example I have thi sin my extra links:
1 = <a href="blogs.php">Blog</a>
2 = <a href="forum.php">Forum</a>
3 = <a href="chatbox.php">ChatBox</a>
8 = <a href="Links.php">Links</a>
10 = <a href="contact.php">Contact Us</a>
11 = <a href="online.php">Online</a>
If I have additional links on my nav area and I want them change color when I actually click on it. How would I go about doing that without editing the functions file.
The functions file only contains the standard links that comes with pun such as index, search, profile etc...
Does anyone have any ideas on this?
ok, cool..I do have a workaround as I previously mentioned but it sucks having to edit every admin or plugin.
Thanks Paul.
Bingiman.
Well, that method works but it still doesn't show the rounded images for the admin files.
ok, I got it now. You were right. I looked for other styles that use this layout but I could not find any out there.
Actually Paul, the problem is not the left or right image. it is the middle cellpic as shown in the image above. These aren't 2 images. It is 3 images I am using.
left, center and right.
I have figured out the first part as shown in the image. The second part is the problem. PunBB does not use the blocktable class for the 1st opening DIV in all the admin areas or for that matter in the plugins as well. I have tried adding the right rounded image to:
<h2 class="block2"><span>Statistics</span></h2>
but it is impossible, at least for me. Unless I add <div class="blocktable"> before it. Hope you understand.
Bingiman
Well, after some time I eventually figured out how to add a rounded image to the right side of the blocks. There are only2 areas I am finding very difficult and that is the admin and plugin areas. The reason is because of this:
<h2 class="block2"><span>Existing groups</span></h2>
As you can see there is no:
<div class="blockform">
<h2><span>Add/setup groups</span></h2>
<div class="box">
Now, I could add this to replace the first but I did not want to modify the core files unless I really have to. Can anyone help me to try and figure this out?
Here is an example of how it looks so far. I will show a pic. With the finished look and the other with the problem.
You know how you can add a rounded edge to the styles using .pun h2 span. Is there a way to add a rounded image to the right side?
Thanks
Bingiman
I am currently using the attachment mod and the image upload mod. (last versions)
Attachment Mod: http://www.punres.org/files.php?pid=77
Image Upload Mod: http://www.punres.org/files.php?pid=117
The problem I am having is that when both mods are installed the attachment mod "Max filesize" affects the "Max size" of the Image Upload mod. I can't figure it out because they have their own tables. Can anyone take a look at these 2 mods to tell me why this is happening?
Thanks
Bingiman
Not that I have a clue how to do it but wouldn't this be better as an array for all the images. So in other words if all those png files (normal, sticky etc...) doesn't exist then the ones with the gif extension would be displayed.
I got it now..
<?php
if(file_exists('img/'.$pun_user['style'].'/new.gif')) {
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.gif" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
<?php
}else {
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.png" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
<?php
}
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/normal.png" alt="No new posts" /><small> <?php echo $lang_index['No new posts']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/sticky.png" alt="Sticky thread" /><small> <?php echo $lang_index['Sticky thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/closed.png" alt="Closed thread" /><small> <?php echo $lang_index['Closed thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/moved.png" alt="Moved thread" /><small> <?php echo $lang_index['Moved thread']; ?></small><br /><br />
</div></div>
</div></div>
Well, at least now I get no errors but I don't understand why it doesn't work. In my case the default image is new.png but if new.png doesn't' exist it should display new.gif but it doesn't show new.gif when I remove new.png
<?php
if(file_exists('img/'.$pun_user['style'].'/new.gif')) {
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.png" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
<?php
}
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/normal.png" alt="No new posts" /><small> <?php echo $lang_index['No new posts']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/sticky.png" alt="Sticky thread" /><small> <?php echo $lang_index['Sticky thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/closed.png" alt="Closed thread" /><small> <?php echo $lang_index['Closed thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/moved.png" alt="Moved thread" /><small> <?php echo $lang_index['Moved thread']; ?></small><br /><br />
</div></div>
</div></div>
This is what I have:
<div id="stats" class="block">
<h2><span><?php echo $lang_index['board_legend'] ?></span></h2>
<div class="box">
<div style="padding-top: 10px; text-align: center;" class="inbox">
<?php
if(file_exists(img/'.$pun_user['style'].'/new.gif)) {
?>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.png" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
<?php
}
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/normal.png" alt="No new posts" /><small> <?php echo $lang_index['No new posts']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/sticky.png" alt="Sticky thread" /><small> <?php echo $lang_index['Sticky thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/closed.png" alt="Closed thread" /><small> <?php echo $lang_index['Closed thread']; ?></small>
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/moved.png" alt="Moved thread" /><small> <?php echo $lang_index['Moved thread']; ?></small><br /><br />
</div></div>
</div></div>
I did. I tried it as PHP and it doesn't' seem to work for me so I must be doing something wrong.
I just don't get it. This is what I have at the moment.
if(file_exists(img/'.$pun_user['style'].'/new.gif))
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.png" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
I have something similar that I use on another CMS but I don't know how to do it in pun
$filename = THEME."forum/whosonline.gif";
if (file_exists($filename)) { echo "<img src='$filename' align='left' alt=''>"; }
else { echo "<img src='".THEME."images/blank.gif' width='40' alt=''>"; }
How would I do this? Here is the line I wanted to use:
<img style="vertical-align: middle;" src="img/<?php echo $pun_user['style'] ?>/new.png" alt="New posts" /> <small><?php echo $lang_index['New posts']; ?></small>
Open the install_mod.php and change 1.2.15 to 1.2.16
Is it possible to use an image for example: 1.gif but if it doesn't exist then something like 1.png or 1.jpg will be displayed in its place?
Bingiman
There was a new mod released for this. I don't have the file anymore but you can set it under User Groups.
Posts found: 151 to 175 of 740
Pages Previous 1 … 5 6 7 8 9 … 30 Next