Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
March 21, 2010, 10:14:38 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem Website Baker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
110577
Posts in
15968
Topics by
9312
Members
Latest Member:
rumarsies
WebsiteBaker Community Forum
English
Archive (posts up to 2007)
(Moderators:
Argos
,
BerndJM
)
Module: Display highlighted PHP code
Pages:
[
1
]
Author
Topic: Module: Display highlighted PHP code (Read 2927 times)
snipe
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.co
m
·
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
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.co
m
·
snipegallery.com
kweitzel
Forum administrator
Online
Posts: 5561
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
PM has been disabled
snipe
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.co
m
·
snipegallery.com
kweitzel
Forum administrator
Online
Posts: 5561
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
PM has been disabled
snipe
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.co
m
·
snipegallery.com
kweitzel
Forum administrator
Online
Posts: 5561
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
PM has been disabled
Pages:
[
1
]
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
Loading...