VGOEmulator.net

A Development Project for the Vanguard:Saga of Heroes MMO

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • Portal
  • Project Manager
  • Bug Tracker
  • Server List
  • Wiki
  • Donate
  • Login
  • Register
  • Board index Community Off-Topic
  • Search

Formatted [CODE] Blocks - Who Knew?

Random thoughts...

Moderator: Community Managers

Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
User avatar
John Adams
Retired
Posts: 4582
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Formatted [CODE] Blocks - Who Knew?
  • Quote

Post by John Adams » Fri Jul 11, 2014 4:46 pm

Just a random discovery, brought on by Amadeus asking for non-wrapping CODE blocks. I never knew you could add a "=php" and get nicely formatted code So this is a reminder, since I'll probably forget again.

Without =php

Code: Select all

		switch ($type)
		{
			case 'php':
				// Not the english way, but valid because of hardcoded syntax highlighting
				if (strpos($code, '<span class="syntaxdefault"><br /></span>') === 0)
				{
					$code = substr($code, 41);
				}

			// no break;
With =php

Code: Select all

        switch ($type)        {            case 'php':                // Not the english way, but valid because of hardcoded syntax highlighting                if (strpos($code, '<span class="syntaxdefault"><br /></span>') === 0)                {                    $code = substr($code, 41);                }            // no break;
Usage:

Code: Select all

[code=php]My Fancy Code
[/code]
Top

User avatar
theFoof
Developer
Developer
Posts: 446
Joined: Fri Jan 24, 2014 10:23 pm
Location: Florida
Re: Formatted [CODE] Blocks - Who Knew?
  • Quote

Post by theFoof » Fri Jul 11, 2014 7:04 pm

lol that's awesome
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Off-Topic”

Jump to
  • Information
  • ↳   Announcements
  • ↳   Dev Chats
  • ↳   Events
  • Community
  • ↳   General Discussions
  • ↳   VGO Team Help Requests
  • ↳   Introductions
  • ↳   Game Features
  • ↳   Wish List
  • ↳   Off-Topic
  • Support
  • ↳   How-To's
  • ↳   General Support
  • ↳   Windows
  • ↳   Linux
  • Bugs
  • ↳   Server Bugs
  • ↳   Server Bugs (Closed)
  • ↳   Content Bugs
  • ↳   Content Bugs (Closed)
  • ↳   Database Bugs
  • ↳   Tools Bugs
  • Board index
  • All times are UTC-07:00
  • Delete cookies
  • Contact us
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD