UBB.Dev
Posted By: Neil Random icon when the first one is picked. - 12/13/2001 10:56 PM
Hi I want to change my 6.04 board so that when the first icon is picked (the default one) it then gives a random icon when the post is sent.

I'm not much of a code junkie so my own attempts at this have failed. All I need is a check when the post is sent, and if they have chosen icon1.gif then a random icon is chosen instead,,can anyone help?

I'm using the drop down message icon hack,,here's where I think the code should go,,I'd really appreciate some help with this.

[code][/code]

[ 12-13-2001 02:59 PM: Message edited by: Neil ]
Posted By: Dave_L Re: Random icon when the first one is picked. - 12/15/2001 2:47 AM
quote:
I want to change my 6.04 board so that when the first icon is picked (the default one) it then gives a random icon when the post is sent.


I don't understand why you want to do this.

However:

In ubb_lib_posting.cgi, sub create_topic, find the place where $icon_number is used to construct the string $this_icon. If you want to assume that the icon files are numbered consecutively starting with 1, you can simply set $icon_number to int(rand N) + 1, where N is the number of icons. If you don't want to make that assumption, it's messier. You could use glob() to get the icon file names into a list, select a random item from the list, then construct $this_icon from that selected item.
Posted By: Neil Re: Random icon when the first one is picked. - 12/15/2001 4:16 AM
[code][/code]

Thanks for your help by the way.
Posted By: Dave_L Re: Random icon when the first one is picked. - 12/15/2001 9:38 PM
Code
[/code]
could be written more simply as
[code]
Posted By: Neil Re: Random icon when the first one is picked. - 01/15/2002 9:29 PM
Thanks for that. Does anyone know which file the processing of posts is done in so I can change it to do what I want?
Posted By: Neil Re: Random icon when the first one is picked. - 03/04/2002 9:37 PM
*bump*

Please,,,someone must know where this happens! This has been driving me nuts for months.

All I want to know is where the processing of icons is done, doesn't anyone know which file takes care of that?
© UBB.Developers