• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » Foren Tags?
Foren Tags?
VictiniLP
Posts: 3
Reputation: 0

Message # 1 | 10:42 PM
Beautiful good day

In the minecraft forum there is the possibility to select a prefix when creating a topic. This also has a picture.

Example:

Is there perhaps a GENERAL html code, whereby I can make this also with me? (This tag is always displayed in the topic overview before the name as image)
In general, because I might also like to use it in another forum smile
Attachments: 0686960.png (39.7 Kb)
joexyz
JOE-vascript
Posts: 1770
Reputation: 78

Message # 2 | 11:58 AM
VictiniLP, this script might work.

Upload your images in .png format to your website into the /forumimg folder.

Insert this to the end of your CSS:
Code
.thDescr,            
    .threadDescr {display:none}            
    #frM30 img {opacity:.33; -moz-opacity: 0.33; filter: alpha(opacity=33);}                
    #frM30 img:hover {opacity:.5; -moz-opacity: 0.5; filter: alpha(opacity=50);}                
    #frM30 img.selectedImg {opacity:1; ; -moz-opacity: 1; filter: alpha(opacity=100);}


Insert this code after the $BODY$ tag in the General appearance of the forum pages template:

Code
<script type="text/javascript">$('.thDescr').each(function(){
    var s = $(this).html().match( /sml\[(\w+)\]/ );
    $(this).show();
    if (s==null) return;
    var name = s[1];
    s = s[0];
    $(this).html( $(this).html().replace(s,'') );
    if( $(this).html()=='()' ) $(this).html('');
    if( $('table.gTable:first td.gTableTop div.gTopCornerRight + img').size()==0 ) $('table.gTable:first td.gTableTop div.gTopCornerRight').after('<img src="http://yoursite.ex/forumimg/'+name+'.png" /> ');
    })
    $('.threadDescr').each(function(){
    var s = $(this).html().match( /sml\[(\w+)\]/ );
    $(this).show();
    if (s==null) return;
    var name = s[1];
    s = s[0];
    $(this).html( $(this).html().replace(s,'') );
    $(this).parent().prev().find('img').attr('src','http://yoursite.ex/forumimg/'+name+'.png');
    });
    </script>


Replace "yoursite.ex" with the address of your site.

Make a list of your images in the New message form template. Replace $_THREAD_DESCR$ with something like this:

Code
<input type="text" id="threadAbout" value="" class="postDescrFl" size="60" maxlength="50" />
    <img src="http://s3.ucoz.net/img/fr/ic1/thread.gif" alt="" class="selectedImg" />
    <img src="/forumimg/canary.png" alt="canary" />
    <img src="/forumimg/somethingelse.png" alt="somethingelse" />
    <div style="display:none">$_THREAD_DESCR$</div>


...and add this to the end of the template:
Code
<?if($_THREAD_NAME$)?>
    <script type="text/javascript">
    $('#frF3').css('width','auto').attr('size', 60);
    $('#frM30 img').click(function(){
                $('#frM30 .selectedImg').removeClass('selectedImg');
                $(this).addClass('selectedImg')
    });
    if( $('#frF4').val()!='' ){
                if( $('#frF4').val().match( /sml\[\w+\]/ ) ){
                 $('#threadAbout').val( $('#frF4').val().replace( $('#frF4').val().match( /sml\[(\w+)\]/ )[0], '' ) );
                 $('#frM30 .selectedImg').removeClass('selectedImg');
                 $('#frM30 img[src$="'+ $('#frF4').val().match( /sml\[(\w+)\]/ )[1] +'.png"]').addClass('selectedImg');
                } else $('#threadAbout').val( $('#frF4').val() );
    }
    function checksubmit(){
                var s = $('#frM30 .selectedImg').attr('src').match( /\/(\w*)\.png/i );
                if( s!=null ) s = 'sml['+s[1]+']'; else s='';
                $('#frF4').val( s + $('#threadAbout').val() );
                return true;
    }</script>
    <?endif?>


Hope it works.

hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau

sometimes i lurk here
VictiniLP
Posts: 3
Reputation: 0

Message # 3 | 4:19 AM
can you tell mew the last 2 things? sry i cant englich very good.
uCoz Community » For Webmasters » Custom Solutions » Foren Tags?
  • Page 1 of 1
  • 1
Search: