Start
Help
Forum
Addons
Projects
Welcome,
Guest
. Please
login
or
register
.
August 20, 2008, 05:23:49 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Website Baker 2.7.0 (stable) veröffentlicht!
Nähere Informationen findet ihr
hier
.
Das Diskussionsboard findet ihr
hier
.
60556
Posts in
9791
Topics by
5824
Members
Latest Member:
blubb
Website Baker Community Forum
English
Archive
Module: Display highlighted PHP code
Pages:
[
1
]
Author
Topic: Module: Display highlighted PHP code (Read 1581 times)
snipe
Apprentice Baker
Offline
Posts: 62
Module: Display highlighted PHP code
«
on:
January 19, 2006, 04:33:42 AM »
For those of you running a PHP tutorial site, or a site that needs to display PHP code snippets, this module will let you do just that. It's *extremely* simple - it is basically just the core "code" module using PHP's highlight_string() function to give you syntax highlighting. (Syntax highlighting is snazzier in PEAR, and I may make an alternate version of the script to use PEAR's text highlighting capabilities, but I wanted to get this done so I could start putting my own site back together.
You can see a basic example here:
http://www.snipe.net/content/php_stuff/breadcrumbs.php
To format the area where the code is displayed, just add a CSS value for div.highlightcode somewhere in your CSS file.
Works for 2.6.x, and I would assume it should work for 2.5.x, but I haven't tried it.
Anyway, I don't know if any of you will find this useful, but here it is.
Logged
-- snipe
snipe.net
·
phpchick.com
·
everydayactivist.com
·
snipegallery.com
Woudloper
Guest
Re: Module: Display highlighted PHP code
«
Reply #1 on:
January 19, 2006, 08:30:35 AM »
Looks like a nice module. The link where you referring to does not have PHP highlighting, but I saw the highlighting on the following page:
http://www.snipe.net/content/php_stuff/filesize.php
Will test it later on. Not that I am going to use it at the moment, but it is always good to see new modules coming...
Must update the module list somewhere in the next week...
Logged
snipe
Apprentice Baker
Offline
Posts: 62
Re: Module: Display highlighted PHP code
«
Reply #2 on:
January 19, 2006, 08:42:35 AM »
LOL yeah, sorry - was trying to do too many things at once, so I pasted the wrong url. I don't know that it can even be called a nice module - I basically changed one line of code... LOL... But hey, it accomplished what I needed...
I'm working on an Amazon.com module as well (as was requested by someone else in another thread) - that one is a bit slower going, since the Amazon.Com XML is pretty gnarly (stuff like $array_name[ITEMLOOKUPRESPONSE][0][ITEMS][0][ITEM][0][OFFERSUMMARY][0][LOWESTNEWPRICE][0][AMOUNT][0][VALUE]), but it's coming along. I need to do a little digging in the other modules to see how categories and ordering is handled in the more mature modules.
Logged
-- snipe
snipe.net
·
phpchick.com
·
everydayactivist.com
·
snipegallery.com
kweitzel
Forum Team
A Baker's Baker
Online
Posts: 4214
Re: Module: Display highlighted PHP code
«
Reply #3 on:
January 19, 2006, 08:59:32 AM »
it does look nice ...
whith the amazon module, do you by any chance know, if the other amazon sites (co.uk, .de, .fr, ...) use the same setup, so the amazon module could be used for them as well?
cheers
Klaus
Logged
http://www.weitzel.biz
snipe
Apprentice Baker
Offline
Posts: 62
Re: Module: Display highlighted PHP code
«
Reply #4 on:
January 19, 2006, 09:11:34 AM »
The one drag with using highlight_string() is that the outputted code isn't XHTML compliant. I know that's a big issue on the net these days, but I have never run into ANY issues with non-XHTML compliant sites, so if it bothers someone that much, they can write the PEAR version.
I'm not sure how the alt. tld amazons work, to be honest. Since I am .us, I don't have much experience with it, but I do think that they should function in the same way. I haven't gotten there yet, but internationalizing it is a goal. The tld would likely be part of the mod_amazon_settings table.
Logged
-- snipe
snipe.net
·
phpchick.com
·
everydayactivist.com
·
snipegallery.com
kweitzel
Forum Team
A Baker's Baker
Online
Posts: 4214
Re: Module: Display highlighted PHP code
«
Reply #5 on:
January 19, 2006, 09:39:53 AM »
great ... if you give me your languag.php file, I can switch it to german (maybe even other European languages, like french and italian, depends on my staff ...). This offer is for any module.
cheers
Klaus
Logged
http://www.weitzel.biz
snipe
Apprentice Baker
Offline
Posts: 62
Re: Module: Display highlighted PHP code
«
Reply #6 on:
January 19, 2006, 11:19:27 AM »
For the amazon module you mean? Hah - I need to check into how languages are handled in modules before I get that ambitious
I have written a ton of custom code for WB, especially for
www.pet-abuse.com
, integrating it into the cruelty database - but I have a whole custom admin application to handle case management, so it was just a matter of calling up existing data from the database - it its something so specific, I wasn't concerned about releasing it to the public. So I need to download a few more of the mods and see how everything gets handled, and then hopefully abstract the language as I go. (I still haven't abstracted the languages for my own non-WB image gallery software.. LOL)
Logged
-- snipe
snipe.net
·
phpchick.com
·
everydayactivist.com
·
snipegallery.com
kweitzel
Forum Team
A Baker's Baker
Online
Posts: 4214
Re: Module: Display highlighted PHP code
«
Reply #7 on:
January 19, 2006, 12:16:51 PM »
I actually meant any of the modules, you want to release in a multilanguag version ...
Logged
http://www.weitzel.biz
Pages:
[
1
]
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Announcements
===> Security Announcements
=> Guest Area and Off-Topic
=> Website Showcase
-----------------------------
English
-----------------------------
=> Help/Support
===> Help/Support of WB2.7.x core
=> Website Baker Development
===> Website Baker 3
=> Documentation
=> Templates
=> Modules
===> Code Snippets
=> Languages
=> Archive
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Hilfe/Support
===> Templates, Module & Co.
===> Hilfe/Support von WB2.7.x core
=> Diskussion über WB
=> Off-Topic
=> Archiv
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Help / Support
===> WB Core
===> Templates, Modules & Languages
=> WB Discussie
=> Niet-Terzake (Off Topic)
-----------------------------
French
-----------------------------
=> Help/Support
-----------------------------
Italian
-----------------------------
=> Help/Support
Loading...