PDA

View Full Version : Default icon only for the first message in a thread?


ThomasP
06-08-2001, 07:53 PM
Hi there,

does anyone has a clue if it is hard to hack that?

Referring to http://161.58.84.213/forum/showthread.php?s=&threadid=19592 I would like to show a default icon only for the first Message in a topic, so that there's no "empty icon" on forumdisplay-view

Thanks for any hint,
-Tom

Mas*Mind
06-08-2001, 08:33 PM
There is an option in general settings:

Show default icon
Show a default icon if a user doesn't choose a message icon or is unable to choose one based on forum settings? {imagesfolder}/icons/icon1.gif will be used.
Yes No

ThomasP
06-08-2001, 08:46 PM
Yes, I know, but then it shows on every message :(
I want it only for the first Message in a topic :D
cu,
-Tom

ThomasP
06-16-2001, 07:01 PM
Does anyone has at least an idea if this could be done at all and has a kind of model if so how?
thx,
-Tom

Tic Tac
06-30-2001, 02:06 PM
ThomasP please show me an example of this and perhaps i can look into getting it working, therefore making my first hack for vB :) ! Please post a screenshot or a link to your board where this is a problem!

Thanks,
Tic Tac

ThomasP
06-30-2001, 02:22 PM
Hi :)

thanks for the answer, Tic Tac!
Are you fluent in php? I still am more into perl, but willing to learn...

Here is the screen:

http://62.144.1.112/backup/def_icon2.gif
This is how it looks like if the poster doesn't chose an icon (1st three posts, 4th post with icon). I don't like that empty cells...

Now if I chose to include a default icon in the CP, vB does include the default icon in every post - even in threads.

-> I want a default icon only for the first post of a thread if the user doesn't chose one.

Btw: I saw a lot of people posting this

thx,
-Tom

Tic Tac
06-30-2001, 02:32 PM
hmm... it can be done... im just trying to think of something that happens ONLY when the first post is posted in the forum.... if i could figure that out, i could most likely write this hack. no im not all that good with php, but if i get in there and look around i am sure i can get what your wanting! if you could think of anything right off that would help me, please let me know... also if you could refer me to files in which it may be in, that would be great too! i just need to know how to "check" and see if it is the first post in the forum and if it is then display "X-icon". Other Questions follow...

1. Do you want the same icon to be shown whether they choose an icon or not?

2. Do you want this icon to be shown on ALL pages that have a display of threads (i.e. say forum1 has 75 posts and they only display 25 on each page... do you want "X-icon" to appear on every page or just the first one?)

Please answer thes questions to the best of your ability to further help me through this situation!

Thanks,
Tic Tac

ThomasP
07-01-2001, 11:22 AM
Hi Tic Tac,

sorry, I have no idea where this is don... :o

Hmm, no if someone choses an icon that's fine, just if a user forgets to chose one, there should be the default posting icon, that would be great.
Best would be if the icon would show in the "forumdisplay" pages, so that the effect as seen on the screenshot wouldn't appear anymore...
Thanks,
-Tom

dwh
07-01-2001, 05:25 PM
Originally posted by Tic Tac
hmm... it can be done... im just trying to think of something that happens ONLY when the first post is posted in the forum.... if i could figure that out, i could most likely write this hack.

I don't think there really is anything that happens only on the first post, but from looking at the database structure, it looks like there is no countid telling what the order of the posts within a postid/threadid are... it seems the system does an sql call and sort for all posts within a threadid, and the post with lowest numerical postid is the first post. So you'd have to do a mysqlcall for the same thing, or find where vbulletin makes the call and get the info from there.... I think it should be in showthread.php. I'd like this feature too and may eventually hack this but I have a lot to do first so it won't be for a long time till I get to it....

Freddie Bingham
07-02-2001, 04:25 PM
Eh? Just turn the option on and remove the code from showthread.php that puts in the default icon. You will then get the icon on all the posts on the forumdisplay listing but not when viewing threads. In other words remove this from showthread.php if ($showdeficon) {
$post[icon]='<img src="{imagesfolder}/icons/icon1.gif" border="0" alt="">';
} and turn the option MasMind mentioned on.

dwh
07-02-2001, 04:46 PM
oh.
Good idea.
;)
vbmoderators, you need an embarassed icon/smilie

dwh
07-07-2001, 05:38 AM
When you turn this option on, it doesn't put the default icon in the subscribed messages section of the usercp.

Wayne Luke
07-07-2001, 08:33 PM
A way to do this would be:

1. Turn off the option "Show Default Icon".

2. Go into PHPMyAdmin and change the default for the iconid field in the thread table. The default is ID 1.

Or you could use this query through telnet:

SQL-query:
ALTER TABLE thread CHANGE iconid iconid SMALLINT (5) UNSIGNED DEFAULT '1' not null

ThomasP
07-07-2001, 09:52 PM
Thanks a bunch freddie,
works peferct! :D :)
*jumpingaroundintheroom*
cu,
-Tom

dwh
07-07-2001, 10:14 PM
Wouldn't that cause default icons in all posts of the thread, which was the original problem?

Wayne Luke
07-08-2001, 05:48 AM
Originally posted by dwh
Wouldn't that cause default icons in all posts of the thread, which was the original problem?

My idea? No.. Each post also has an iconid which would still be set to zero by default.

Reef Board
07-30-2001, 10:07 PM
Originally posted by freddie
In other words remove this from showthread.php if ($showdeficon) {
$post[icon]='<img src="images/icons/icon1.gif" border="0" alt="">';
} and turn the option MasMind mentioned on.

I can't find this in showthread.php for version 2.0.2.. Whats the code I need to edit to do this with 2.0.2?

Phil~

FWC
08-01-2001, 05:36 AM
I can't find this in showthread.php for version 2.0.2.. Whats the code I need to edit to do this with 2.0.2?

This is a very good question. I have the same problem. But, you have to figure everybody who can figure out how to do it is a little busy right now. :D

dwh
08-01-2001, 01:33 PM
admin/functions.php

around line 125 or so, comment out the line. Basically that functionality moved into a function instead of being specific to showthread.php.

FWC
08-01-2001, 03:31 PM
admin/functions.php

around line 125 or so, comment out the line. Basically that functionality moved into a function instead of being specific to showthread.php.

I went where you said and deleted the same code that used to be in showthread.php and it worked perfectly. Thanks again, dwh!!

ThomasP
08-02-2001, 10:43 PM
Hi again,

yes works perfect in 2.0.3
My bad I read your post too late dwh ;) here's my edit in functions.php:

Comment or remove the following

if ($showdeficon) {
$post[icon]='<img src="{ imagesfolder}/icons/icon1.gif" border="0" alt="">';
}


cu,
-Tom

P.S.: Installing fresh on 2.0.3: Edit codepiece in admin/functions.php as showing above and turn "Show default icon" ON in your vB's Control Panel.

Please note the blank within { imagesfolder} which doesn't appear in the orginal code - was left there intentionally because it would be parsed by vb as code...

Island Roots
12-13-2001, 02:35 PM
[QUOTE]Originally posted by freddie
Eh? Just turn the option on and remove the code from showthread.php that puts in the default icon. You will then get the icon on all the posts on the forumdisplay listing but not when viewing threads. In other words remove this from showthread.php if ($showdeficon) {
$post[icon]='<img src="images/icons/icon1.gif" border="0" alt="">';
} and turn the option MasMind mentioned on.

FWC
12-13-2001, 04:23 PM
Originally posted by Justin Hancock


I can't find that. I'm using 2.2.1 also. The code to be removed is in admin/functions.php now.

Island Roots
12-14-2001, 12:47 AM
I searched for it with the Find feature several times and nothing came up in admin/functions.php. :confused:

FWC
12-14-2001, 01:16 AM
Originally posted by Justin Hancock
I searched for it with the Find feature several times and nothing came up in admin/functions.php. :confused: Line 127-129 in a clean version of admin/functions.php.