The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
When posting a new topic and/or replying to a topic, you have the option of selecting an icon. By default, "No Icon" is selected.
I was wondering if there was a simple way to have the "No Icon" renamed to "Random Icon" and have the thread automatically select a random post icon from the posticon folder. My reasoning is almost none of my users will pick an icon, and if I remove the "No Icon" button, then all the post icons will look the same. It looks ugly on the forum. Here's an example. ![]() The only one using post icons is me, so there's only one selected in the image. Is this possible? How would I go about doing this? |
#2
|
||||
|
||||
![]()
Bump
|
#3
|
||||
|
||||
![]()
Possible. You'll have to override the setting in newreply and choose an id at random.
|
#4
|
||||
|
||||
![]()
Wouldn't it make more sense to just apply a default icon? As if you have a random one selected, it would turn into a mish mash of random colors and shit all over which will look worse than no icons.
|
#5
|
||||
|
||||
![]() Quote:
![]() |
#6
|
||||
|
||||
![]()
Well then it looks like were in the same preticament. Although I am slightly more proficient in coding, but also have a good eye for design. In your case, you'll need a pretty unique script as I have never seen such a thing anywhere else, best of luck. Maybe consider requesting it in the Paid section if you're willing to dish out some cash for it.
|
#7
|
||||
|
||||
![]()
Here's a way to do this. As this involves editing newthread.php, not everyone may like this solution.
Anyways, here's what to do: (UPDATED) In newthread.php, FIND: Code:
$newpost['iconid'] =& $vbulletin->GPC['iconid']; Code:
if($vbulletin->GPC['iconid'] != 0){ $newpost['iconid'] =& $vbulletin->GPC['iconid']; } else{ $icons_list = array(); $iconids = $db->query_read("SELECT iconid FROM icon"); while($row=mysql_fetch_assoc($iconids)){ array_push($icons_list, $row); } $newpost['iconid'] = array_rand($icons_list) + 1; } If you want to change the "No icon" text to "Random Icon" just edit the posticons template: FIND: Code:
$vbphrase[no_icon] Code:
Random Icon |
#8
|
||||
|
||||
![]()
You can hook a plugin further down the code to overwrite the variable. You also don't really need a query, just do a random number between 1-10 or something.
|
#9
|
||||
|
||||
![]()
if a posticon is deleted its ID is no longer valid right? so i used a query to get all the IDs in the table instead of generating a random number directly.
could you explain a little about hooking a plugin? |
#10
|
||||
|
||||
![]()
Well, you could always make a setting that lets the admin list ids that they want for the random icon. As for the plugin, find a plugin before the post is submitted, but after the varuable has been initialised.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|