MyBB Community Forums

Full Version: Forcing a post icon?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Is it possible to force a user to choose a post icon before the post goes through? Maybe an warning that a post icon must be selected before they can post?

Or maybe a way to specify a default post icon to be used if they don't pick one instead? Either way would work for me Smile
Or if you would rather edit the templates:

http://community.mybb.com/thread-89827.html
(2011-05-10, 06:50 AM)faviouz Wrote: [ -> ]Or if you would rather edit the templates:

http://community.mybb.com/thread-89827.html

This. A core modification should be the last resort if there is no other solution.
That worked perfectly thanks! One last question if I may, is it possible to have the post icons hidden until clicked?

Like this:
[Image: 95k9i.png]

[Image: fZGAV.png]
Try this:
<tr>
<td class="trow1" style="vertical-align: top"><strong>{$lang->post_icon}</strong></td>
<td class="trow1" valign="top" ><span class="smalltext"><label><input type="radio" class="radio" name="icon" value="-1"{$no_icons_checked} />{$lang->no_post_icon}</label> <a href="#" onclick="$('posticons').toggle();return false;">[Toggle icons]</a></span><div id="posticons" style="display:none">{$iconlist}</div></td>
</tr>

You might need to change the "-1" value again with the default post icon.
(2011-05-10, 03:03 PM)xomp Wrote: [ -> ]That worked perfectly thanks! One last question if I may, is it possible to have the post icons hidden until clicked?

Like this:
[Image: 95k9i.png]

[Image: fZGAV.png]

Go to: ACP > Templates > Ungrouped Templates > posticons > and find;
{$iconlist}
and Change it into;
<script language="javascript"> 
<!--
var state = 'none';

function showhide(layer_ref) {

if (state == 'block') { 
state = 'none'; 
} 
else { 
state = 'block'; 
} 
if (document.all) { //IS IE 4 or 5 (or 6 beta) 
eval( "document.all." + layer_ref + ".style.display = state"); 
} 
if (document.layers) { //IS NETSCAPE 4 or below 
document.layers[layer_ref].display = state; 
} 
if (document.getElementById &&!document.all) { 
hza = document.getElementById(layer_ref); 
hza.style.display = state; 
} 
} 
//--> 
</script>
<a href="#" onclick="showhide('div1');">[Choose an Icon]</a>
<div id="div1" style="display: none;">{$iconlist}</div>
(2011-05-10, 03:18 PM)Yaldaram Wrote: [ -> ]
(2011-05-10, 03:03 PM)xomp Wrote: [ -> ]That worked perfectly thanks! One last question if I may, is it possible to have the post icons hidden until clicked?

Like this:
[Image: 95k9i.png]

[Image: fZGAV.png]

Go to: ACP > Templates > Ungrouped Templates > posticons > and find;
{$iconlist}
and Change it into;
<script language="javascript"> 
<!--
var state = 'none';

function showhide(layer_ref) {

if (state == 'block') { 
state = 'none'; 
} 
else { 
state = 'block'; 
} 
if (document.all) { //IS IE 4 or 5 (or 6 beta) 
eval( "document.all." + layer_ref + ".style.display = state"); 
} 
if (document.layers) { //IS NETSCAPE 4 or below 
document.layers[layer_ref].display = state; 
} 
if (document.getElementById &&!document.all) { 
hza = document.getElementById(layer_ref); 
hza.style.display = state; 
} 
} 
//--> 
</script>
<a href="#" onclick="showhide('div1');">[Choose an Icon]</a>
<div id="div1" style="display: none;">{$iconlist}</div>

Mint! Thanks ever so much!
Yaldaram is adding unnecessary javascript into the template. Prototype can handle this and it is already included in MyBB.