The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
5 posters

    Custom BB CODE!

    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Custom BB CODE!

    Post by Manish17xxx January 23rd 2015, 10:26 am

    Hello i want a code that i can put on my website as a custom bb code. Can somebody please make it up for me or tell me how to?

    I can tell my BB CODE USAGE AND HTML REPLACEMENT.


    Last edited by Manish17xxx on February 7th 2015, 4:50 pm; edited 1 time in total
    Ikerepc
    Ikerepc
    Active Poster


    Male Posts : 1186
    Reputation : 167
    Language : Who cares...
    Location : Where web help & support is needed

    Solved Re: Custom BB CODE!

    Post by Ikerepc January 23rd 2015, 11:03 am

    That's not possible at forumotion by default.

    You can check this tutorial at AvacWeb for that: http://www.avacweb.com/t428-13-create-new-bbcodes-with-new-lgbb
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx January 23rd 2015, 11:16 am

    I cannot understand that properly .
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx January 23rd 2015, 11:22 am

    @AngeTuteur Can you please help me out?
    avatar
    BL@DE
    Forumember


    Male Posts : 161
    Reputation : 10
    Language : English
    Location : England

    Solved Re: Custom BB CODE!

    Post by BL@DE January 23rd 2015, 5:39 pm

    what do u want done to your site ? if u need some cool stuff on your site I can put it on for u.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ January 23rd 2015, 6:15 pm

    what do u want this custom bb code 2 do?
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx January 31st 2015, 7:39 am

    BL@DE wrote:what do u want done to your site ? if u need some cool stuff on your site I can put it on for u.

    I want a custom bb code for pokemon display. Like , 

    if a user types [pokemon]Name of the pokemon[/pokemon] 

    then it will display the picture of that pokemon.
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx January 31st 2015, 7:47 am

    I can tell it more clearly. 

    The user types - 


    Code:
    [pokemon](Name of the pokemon)[/pokemon]




    The actual code used is - 


    Code:
    [img]https://i2.dstatic.com/images/pokemon/front/normal/(name of the pokemon).png[/img]


    Somebody please help me out with it . Thanks in advance!
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx February 1st 2015, 6:05 am

    Bump ~
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ February 1st 2015, 7:57 am

    bb code is used for wrapping stuff between two things i think what your wanting is more of a replacement script

    this will let you put in [charizard]  [squirtle]   [snorlax] and will replace it with the image

    every pokemon name and image must be between '' and must be separated by ,

    for each name you add to pokemon list add the image in same place on pokeimage list

    only thing you need to change is pokemon list and pokeimage list

    goto acp>modules>JavaScript management
    make sure JavaScript management is turned on if not turn it on and save
    next create a new script
    title:whatever you want
    placement in topic
    the copy the code below to the code box
    and save/submit
    Code:
    var pokemon = ['charizard','squirtle','snorlax'];
    var pokeimage = ['imageforcharizard.gif','imageforsquirtle.gif','imageforsnorlax.gif'];
    $('.postbody').each(function(){
          var oldhtml = "";
       oldhtml = $(this).html();
       for(var i = 0;i<pokemon.length;i++){
       oldhtml=oldhtml.replace('['+pokemon[i]+']','<img src="'+pokeimage[i]+'">');};
       $(this).html(oldhtml);
    });});

    so if you want to add new pokemon just add 'pokemonname' to pokemon list
    same for image just make sure they are separated with a comma ,
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx February 7th 2015, 6:17 am

    Yes i did it. i EDITED the code and added image for charizard, but when i type [charizard] in my forums , its not showing that. any solution to it?
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx February 7th 2015, 6:21 am

    Its nice that both of us are online.  I hope we can have a nice talk now and i can get the solution to my problem.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ February 7th 2015, 9:14 am

    my fault i missed part of the code when i copied it


    Code:
    $(function(){
    var pokemon = ['charizard','squirtle','snorlax'];
    var pokeimage = ['imageforcharizard.gif','imageforsquirtle.gif','imageforsnorlax.gif'];
    $('.postbody').each(function(){
          var oldhtml = "";
      oldhtml = $(this).html();
      for(var i = 0;i<pokemon.length;i++){
      oldhtml=oldhtml.replace('['+pokemon[i]+']','<img src="'+pokeimage[i]+'">');};
      $(this).html(oldhtml);
    });});
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx February 7th 2015, 4:49 pm

    Working! Working! Working! Man you are awesome, thanks ! Finally problem , solved. thanks , you rock , you really rock!!!!!

    3 cheers for Twisted Mods - Hip Hip Pokemon ; Hip Hip Pokemon
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ February 7th 2015, 5:55 pm

    lol your welcome
    avatar
    Manish17xxx
    New Member


    Posts : 12
    Reputation : 1
    Language : English

    Solved Re: Custom BB CODE!

    Post by Manish17xxx February 8th 2015, 5:42 am

    I even edited the code a bit more - 

    Code:
    $(function(){
    var pokemon = ['charizard','squirtle','snorlax'];
    var pokeimage = ['imageforcharizard.gif','imageforsquirtle.gif','imageforsnorlax.gif'];
    $('.postbody').each(function(){
          var oldhtml = "";
      oldhtml = $(this).html();
      for(var i = 0;i<pokemon.length;i++){
      oldhtml=oldhtml.replace('['+pokemon[i]+']',<img src="'+pokeimage[i]+'" title="'+pokemon[i]+'">');};
      $(this).html(oldhtml);
    });});

    Now it also adds a tooltip to the code , it means when i point my cursor near the image, then it shows the name of the pokemon as a tooltip.
    avatar
    Guest
    Guest


    Solved Re: Custom BB CODE!

    Post by Guest February 8th 2015, 8:36 am

    I'd like to add this little tutorial to it for future reference if you want to make your own BBCodes: http://www.avacweb.com/t428-13-create-new-bbcodes-with-new-lgbb
    avatar
    PA
    Forumember


    Posts : 219
    Reputation : 2
    Language : english

    Solved Re: Custom BB CODE!

    Post by PA February 9th 2015, 12:27 am

    Is this still bbcode?
    Like will it work in profile fields?
    If not, how can I make it work??
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ February 9th 2015, 2:33 am

    yes u can make work in profile fields but you will need to open a new topic for your issue
    avatar
    PA
    Forumember


    Posts : 219
    Reputation : 2
    Language : english

    Solved Re: Custom BB CODE!

    Post by PA February 9th 2015, 2:58 am

    Done, sir!
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Custom BB CODE!

    Post by _Twisted_Mods_ February 15th 2015, 8:22 pm

    Topic solved and archived

      Current date/time is September 23rd 2024, 7:19 am