Topic: Lock & Sticky topics logos

It looks like the following:

http://img71.echo.cx/img71/8197/icons4md.jpg

First, download these two images and put them in the folder where your forum is located.
Rename them to:
lock.gif : http://img71.echo.cx/img71/4403/lock6ye.gif
sticky.gif : http://img71.echo.cx/img71/1713/sticky2sl.gif

Open up viewforum.php and find:

else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }

Replace with:

else
        {
            $subject = '<img src="lock.gif" alt="lock"> <a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }

Find:

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

Replace with:

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

Save viewforum.php and upload!

That's it you're done.

- ultime

Re: Lock & Sticky topics logos

you can do this simply with just the css, by setting a background on the new post indicators

Re: Lock & Sticky topics logos

Connorhd wrote:

you can do this simply with just the css, by setting a background on the new post indicators

Are you sure you can do this with the sticky icon too?

4 (edited by Paul 2005-06-17 18:02)

Re: Lock & Sticky topics logos

Yep. The only thing you have to decide is when something is sticky and new, which image gets priority. My preference is to indicate sticky topics by changing the row colour and use the icons/images for new, closed etc.

Even if you want to use a second image as well as the post indicators you can do it with just css, just set the background image on one of other tags inside the table cell.

Re: Lock & Sticky topics logos

I'd say sticky gets priority.

Eg.

*= new box   ' = not new box   ^ = Sticky   # = locked

* ^ stuck at the top
' ^ not
* hi
* # hola
' bonjour
' # bienvenidos

ultime, why did you give the images names like stickysl4.gif?

Re: Lock & Sticky topics logos

you could have an image for "sticky" and an image for "new-sticky"

Re: Lock & Sticky topics logos

scottywz wrote:

I'd say sticky gets priority.

Eg.

*= new box   ' = not new box   ^ = Sticky   # = locked

* ^ stuck at the top
' ^ not
* hi
* # hola
' bonjour
' # bienvenidos

thats not what they were saying, Paul meant if you have a sticky topic with new posts, which icon does it display, the new one or the sticky one

8

Re: Lock & Sticky topics logos

This does not work in MyPunBB...
Help... xD

-AssD-

Re: Lock & Sticky topics logos

The locked one just doesn't work (sticky works fine) on 1.2.6...

10

Re: Lock & Sticky topics logos

Yeah, mod was created for 1.2.5.

Re: Lock & Sticky topics logos

Ah, I see what went wrong.  It does work.  Yay.

12

Re: Lock & Sticky topics logos

How do i get rid of the text (like "sticky:")?
I'd like logos only..

13

Re: Lock & Sticky topics logos

add:

span.stickytext { display: none; }

to the .css

14

Re: Lock & Sticky topics logos

Thank you pabb!


Another thing though.. The little dot that indicates i have written in a certain topic is placed after the sticky logo. If a topic is closed though it gets placed before the closed logo (like i want it to).

15

Re: Lock & Sticky topics logos

i think that can be resolved if you move the

if ($cur_topic['sticky'] == '1') bracket

above

the

// Should we display the dot or not? smile
if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')

bracket

16

Re: Lock & Sticky topics logos

Beautiful!

17

Re: Lock & Sticky topics logos

I have my forum in Swedish and the only swe word for "poll" i can think of is pretty long ("omröstning"), so if someone could show me how to do the same thing with a poll (replace the text with an image), i'd be very happy!

I have Easy-Poll 1.1.3 installed..

Re: Lock & Sticky topics logos

I use a slightly modified version (only sticky):

if ($cur_topic['sticky'] == '1')
        {
            $subject = '<img src="sticky.gif" alt="'.$lang_forum['Sticky'].'"/>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];
        }

It omits the sticky text in favor of the icon (in other words, just icon, no text), uses $lang_forum['Sticky'] for the alt text, and adds a closing "/" to make the img tag comply with W3C standards for XHTML.

Looking for a certain modification for your forum? Please take a look here before posting.

19

Re: Lock & Sticky topics logos

BTW. According to subSilver licence you should have a line somewhere saying that those images originate from phpBB group.

Re: Lock & Sticky topics logos

Jacq wrote:

BTW. According to subSilver licence you should have a line somewhere saying that those images originate from phpBB group.

Yeah I was wondering about the legal stuff surrounding these icons.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Lock & Sticky topics logos

I tried chancing the viewforum.php and it works fine but how do i chance the new en old icons?

I tried the css like in http://punbb.org/forums/viewtopic.php?id=9133 but it doesn't work.

Anyone any ideas how to manage that in the viewforum.php. Played with:


if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $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>';
        }

Need held here!!!

22 (edited by t2 2005-11-18 02:09)

Re: Lock & Sticky topics logos

What's the CSS method of doing this?  I don't want to change any code.  I tried modifying the Oxygen_cs.css with the following but it didn't work:

div.isticky {
  background-image: url('http://www.clreviewboard.org/images/sticky.gif');
  background-repeat: no-repeat;
  background-position: center;
}
div.isticky span {display:none;}

23

Re: Lock & Sticky topics logos

t2 wrote:

What's the CSS method of doing this?  I don't want to change any code.  I tried modifying the Oxygen_cs.css with the following but it didn't work:

div.isticky {
  background-image: url('http://www.clreviewboard.org/images/sticky.gif');
  background-repeat: no-repeat;
  background-position: center;
}
div.isticky span {display:none;}

That should be:


TR.isticky DIV.icon {
/* CSS Code here */
}