vbulletin 4 make bbcode [code] have syntax highlight like [php]

Goal #1: vbulletin 4 bbcode [code] have syntax highlight like [php]
Goal #2: Code wrapped in the [code] and [php] bbcodes to have Consolas as font like StackOverflow

The default [code] bbcode of vbulletin doesn't highlight the code which is wrapped inside of it. It actually is using a "pre" html tag to keep the format. The solution for this is mainly a 2 steps process:

Step 1 - Make vbulletin bbcode [code] have syntax highlight like [php]
- Edit the file includes/class_bbcode.php
- Locate

function handle_bbcode_code

and in there replace the whole code in the function by the code located at the

function handle_bbcode_php

- Finally in the new copied code locate:

$templater = vB_Template::create($this->printable ? 'bbcode_php_printable' : 'bbcode_php');

and replace it with:
$templater = vB_Template::create($this->printable ? 'bbcode_code_printable' : 'bbcode_code');

By now you should be already able to see your code having syntax highlight.

Step 2 - Code using Consolas font-family
- Go to the admin control panel
- Styles & Templates
- At your template pick "Edit Templates"
- CSS Templates
- And then edit the additional.css

In there add

.bbcode_code, .bbcode_code span {
font-family: Consolas;
}

Step 3 - This is an optional step
In order to be more precise you need to remove the "pre" tag from the bbcode_code, and make it like bbcode_php same for the printable ones.
So locate them both from the "Edit Templates" under BB Code Layout Templates and make the needed replacements. Be careful not to replace the

{vb:rawphrase code}:

as it will change the title given to your wrapped code.

This entry was posted in Scripts, Solutions and tagged , , , , . Bookmark the permalink.

24 Responses to vbulletin 4 make bbcode [code] have syntax highlight like [php]

  1. absolutist says:

    Making your own photography equipment might seem
    like a somewhat silly idea. With the extremely wide apertures, they collect a lot of light and work well in dimly lit areas (like a church).
    A good photography education needs to be put into practice.

  2. Hi, I wish for to subscribe for this blog to obtain most
    up-to-date updates, therefore where can i do it please help out.

  3. Mozelle says:

    Welcome to All Shore Paving where we have every the required
    amount without any patterns or designs. We don’t always understand marketing’s impact on the rise, contractor today, with military spokesmen. The
    lawn service is very real. For this aspect check whether they should use a credentialed
    home remodeler. A perfect contractor for weeks after they’re done,
    it is our success. Here’s how: First, you will have no clue who
    to call in the House Transportation and Motor Vehicles Committee, even before it outsourced contractor certain city projects.

    my page website (Mozelle)

  4. youtube.com says:

    What’s up, this weekend is nice ffor me, since this
    occasion i am reading this enormous informative post here at my residence.

    Also visit my wewblog :: youtube.com

  5. Wonderful, what a webpage it is! This webpage gives useful
    facts to us, keep it up.

  6. Reynaldo says:

    We stumbled over here by a different website and thought I might check
    things out. I like what I see so now i’m following you. Look forward to looking into your
    web page yet again.

    Take a look at my web page webpage – Reynaldo,

  7. Your dui attorney court appearance, your family. One can also look at
    how she was going to get the case. You can make
    all the time, and who understands your particular needs.
    Your chemical test, what we call it the correct way to dui
    attorney lose your opportunities and reputation. The laws of the attorneys before the
    court system. There are some special cases in Los Angeles
    can help make our clients of the key to having a DUI conviction?

    my weblog check this site out

  8. hajj London says:

    - Misery (may Allah be Allah’s mercy on him) said to one of his disciples: “If you are able to completely sacrifice themselves, then come to me! Otherwise, do not get carried away, “Sufi” bustle and chatter “(ies,. E. Impersonate various Sufi and pretense. Tons. D.).O my son! I’m cutting instructions intended for you to eight points, four of which ones you want to keep, and the four that should make to the Day of Judgment is your knowledge were not enemies and witnesses against you. Dear brother

  9. The field of Information Technology IT industry in the
    industry best services. Because the design concept and design creates your distinction from all over the world
    closer. I learned from past clients. Navigation EaseUsers
    like to advance their career. Visuals4U provides a pleasant visual application along with some
    user actions.

    My webpage: search engine optimization prices

  10. Bernardo says:

    I read a lot of interesting articles here. Probably you spend a lot of
    time writing, i know how to save you a lot of work, there is an online tool that creates readable, google friendly articles in seconds, just type in google – laranitas free content source

  11. Hajj is performed in the month of Zill Hajj (12th month of Islamic calendar), as umrah can be performed all the year. Muslims around the world perform the holy journey to the holy cities of Makah and Madina. However, there are few things to believe for all Muslims before planning Hajj so that you can achieve this religious duty with enough comfort and satisfaction. Alhijaz travel provide cheap umrah 2015 offers with grand discount 24/7, if you can take these offers then contact with alhijaz travel London, UK, services.

  12. The most serious peril when completing the Hajj is at the Jamarat Bridge domain. There have been different charges and right now, yet the Saudi government has enhanced working environments in the zone. Umrah experts provides cheap hajj packages 2015 from London uk, if want to take these packages or services theen contact with umrahexperts London uk.

  13. pozyczkowej says:

    Chwilowki prywatne Do 1500 bez kosztow. Decyzja w 15 minut. Sprawdz na http://pozyczka-ogloszenia.pl

  14. cheap kicks says:

    According to the U.S. China Press reported net December 24, in order to grab a pair of the latest Cheap Jordans trapeze scene out of control “Black Friday” buying frenzy reproduce the number of shopping centers in the United States 23 local time. Someone buying a fight scene, some even shot, police used pepper spray to disperse the crowd and arrested more than ten people. Jordan announced his retirement after the second time, Adidas rely on booming popularity of Kobe, Kobe shoes quickly launched. Last season, Iverson makeovers, Everson red shoes and take the opportunity and moment.

  15. Abdul says:

    Alhamdulillah my umrah trip has been brilliant, can’t fault the operators. http://sakeenahtours.com/package/umrah-packages-2016/

  16. abelljims says:

    Abell Morliss International is the best Chartered Accountant Firm situated in London.
    We provide the best services of bookkeeping, tax filing, VAT, PAYE, RTI, annual accounts, company formations, etc.
    Abell Morliss International have the good grip on all the aspects ofPrivate Limited Company from formation to tax return filling.
    Feel free to consult us.
    TEL : 44 (0) 207 148 4785
    visit us for more details : http://www.chartered.org/

  17. Umrah is also considered as one of the highest forms of worship, devotion and submission towards Allah and His teachings, next to Hajj. Hajj is done once in a lifetime, whereas, Umrah can be done anytime of the year and a number of times. It may not be compulsory, but it is highly encouraged and recommended. Before performing an Umrah, it is necessary that one should know and follow its virtues and adhere to the teachings of the Prophets.

  18. Kemble Station Taxis providing the best Cirencester Local taxi cirencester services in Cheltenham, Warwick, Oxford, Wantage, Kemble Railway Station, Cirencester, Swindon, Paddington, Bristol, Cotswold, Birmingham, Bibury, Tetbury, Burford, Wiltshire and Gloucestershire. We have the best comfort and luxurious taxi services in United Kingdom.
    Feel free to call us or you can request a call back.
    Call us : 07795 159 974
    Visit us for more details :
    http://www.kemblestationtaxis.co.uk/

  19. We are introducing best comfortable taxi services “Kemble Station Taxis” which no one has introduce yet .
    So entertain yourself through our
    Cirencester Taxi
    with low cost rates . It would be a source of pleasure for you because we have the best comfort and luxurious taxi services in United Kingdom.
    Feel free to call us. Our professional consultant are always there for your support.
    Call us : 07795 159 974
    Visit us for more details :
    http://www.kemblestationtaxis.co.uk/

  20. Ruhaan & Co is the name of professionalism, our clients speak for the excellence we deliver to the work. The competencies which make us better than any other firm is the professional approach to the work. We are the best accounting firm providing our services in VAT Return Birmingham United Kingdom. We specialised in bookkeeping, accounting services, trademark registration, VAT return and tax return etc. The deep professional analysis gives the true image of your business position. We optimise the weak points and guide the clients for the most effective solutions.
    Call us : 0121 572 3457
    visit our website

  21. Cheap offers of 2017 for Umrah Package UK, book now from Registered and Certified Travel Agency in the UK.
    For best:
    Cheap Umrah Package UK

  22. Find the best packages for Morocco and Book affordable family packages with the certified agency in the UK and also get the Easter discount.

  23. My wife and i were really satisfied John managed to finish off his preliminary research with the precious recommendations he acquired out of your web pages. It’s not at all simplistic to simply happen to be giving for free guidance that many people could have been selling. We really discover we’ve got the blog owner to appreciate for this. The specific explanations you’ve made, the easy web site menu, the relationships your site give support to foster – it’s most unbelievable, and it’s assisting our son and the family reason why the theme is fun, which is certainly wonderfully vital. Thank you for all the pieces!

  24. Islamic Travel UK is a well-known travel firm all around the United Kingdom because they are offered cheap but luxury Hajj and Umrah Packages for the respected inhabitants of London, Manchester, and Birmingham.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>