Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 23, 2012, 12:09:09 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
155411
Posts in
21698
Topics by
7731
Members
Latest Member:
elwin90
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
Highlight Code & Syntax while modify 'Code' sections
Pages: [
1
]
Go Down
Author
Topic: Highlight Code & Syntax while modify 'Code' sections (Read 439 times)
sharmpro
Offline
Posts: 64
Highlight Code & Syntax while modify 'Code' sections
«
on:
July 25, 2008, 11:34:35 PM »
Hi,
using a lot of code programming I found really useful to implement the code/syntax highlignt feature already implemented in Template Edit.
....
....
....
....
NEW LINES IN RED
File: WB_PATH/modules/code/modify.php
// Get page content
$query = "SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section_id'";
$get_content = $database->query($query);
$content = $get_content->fetchRow();
$content = (htmlspecialchars($content['content']));
/* Codepress ****************************************************************************/
// make sure that codepress stuff is only used if the framework is available
$CODEPRESS_CLASS = '';
$CODEPRESS_JS = '';
if(file_exists(WB_PATH .'/include/codepress/codepress.js')) {
$CODEPRESS_JS = 'onclick="javascript: data_codepress_'.$section_id.'.value = my_codepress_'.$section_id.'.getCode();"';
$CODEPRESS_CLASS = 'class="codepress php" ';
}
/* Codepress ****************************************************************************/
// Insert vars
$template->set_var(array(
'PAGE_ID' => $page_id,
'SECTION_ID' => $section_id,
'WB_URL' => WB_URL,
'CONTENT' => $content,
/* Codepress ****************************************************************************/
'CODEPRESS_CLASS' => $CODEPRESS_CLASS,
'CODEPRESS_JS' => $CODEPRESS_JS,
/* Codepress ****************************************************************************/
'TEXT_SAVE' => $TEXT['SAVE'],
....
....
....
....
NEW LINES IN YELLOW
File: WB_PATH/modules/code/modify.html
<textarea name="content"
id ="my_codepress_{SECTION_ID}" {CODEPRESS_CLASS}
style="WIDTH: 100%; HEIGHT: 380px">{CONTENT}</textarea>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left">
<input type="submit" value="{TEXT_SAVE}"
{CODEPRESS_JS}
style="width: 100px; margin-top: 5px;" />
....
....
....
Stefano
Logged
SharmPRO
http://www.sharmpro.com
http://www.jcwebden.com
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> 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
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> 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
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...