TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-07-2007, 02:52 PM   #1 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default Added Geshi Syntax Highlighting

To make code easier to read, we have added another aptly named vB hack to TalkPHP. This allows you to specify various languages to highlight. If I can find a comprehensive list then I will list that later.

The syntax highlighting can be used like so:

[highlight=language] var myVar = myFunc(myArg); [/highlight]

Where language is the name of the language, such as javascript.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-07-2007, 03:07 PM   #2 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

why not just edit the [code] tag? less stuff to remember..
Nor is offline  
Reply With Quote
Old 11-07-2007, 03:18 PM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default

Will set up some aliases in due time. Such as [js].
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-07-2007, 03:49 PM   #4 (permalink)
The Wanderer
 
cherries's Avatar
 
Join Date: Oct 2007
Posts: 20
Thanks: 0
cherries is an unknown quantity at this point
Default

php Code:
<?php
    class MyClass
    {
        public $var = 'MyVar';
        private $lulz = true;
       
        public function __construct ( $str )
        {
            $parts = explode(':', $str);
            $this->var = $parts[0];
            $this->lulz = $parts[1];
        }
    }
?>

Brackets don't show []

Last edited by cherries : 11-07-2007 at 03:50 PM. Reason: added message :O
cherries is offline  
Reply With Quote
Old 11-07-2007, 04:15 PM   #5 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default

Thanks for pointing that out. Well spotted! Updated Geshi and it seems to be working now. You'll have to re-post your code, though.

Edit: Ignore that, it's still broken!
Edit: Voila :) All fixed.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.

Last edited by Wildhoney : 11-18-2007 at 06:19 PM.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-18-2007, 08:06 PM   #6 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 978
Thanks: 103
Tanax is on a distinguished road
Default

php Code:
$variable = 'Success';
if($phpbox == true) {
echo $variable;
}
else {
echo 'Failed!';
}
Tanax is offline  
Reply With Quote
Old 11-18-2007, 09:12 PM   #7 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default

Smashing, Aye? :)
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-18-2007, 09:40 PM   #8 (permalink)
The Wanderer
Newcomer 
 
Jeff Andersen's Avatar
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Jeff Andersen is on a distinguished road
Default

Looks good Wild!
( Now how about the buttons that are missing their custom images ;) )
Jeff Andersen is offline  
Reply With Quote
Old 11-19-2007, 11:26 PM   #9 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default

Which buttons would those be, Jeff? Do explain yourself! We are re-coding the design, as you may have heard, so it'd be nice to cover all of these.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-20-2007, 12:31 AM   #11 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,182
Thanks: 88
Wildhoney is on a distinguished road
Default

Aha :) Onto those. Thanks a lot for filling me in!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-20-2007, 01:51 AM   #12 (permalink)
The Wanderer
Newcomer 
 
Jeff Andersen's Avatar
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Jeff Andersen is on a distinguished road
Default

I'll post a screenshot when I get home, I'm just at work and don't have the means.
__________________
By industry standards I am a noob.
Jeff Andersen is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:47 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design