Archived
1
0

Compare commits

...

1753 Commits

Author SHA1 Message Date
Garvin Hicking 262c9174f0 prepare release 2013-07-26 16:59:11 +02:00
Matthias Gutjahr cda50f40fa Added fix for comment_author_self (cp. http://board.s9y.org/viewtopic.php?f=10&t=19115) 2013-07-26 12:48:13 +02:00
Matthias Mees 61a85c28f8 Bump 2k11 update date. 2013-07-24 16:23:58 +02:00
Matthias Mees 81d1a77c66 Remove protocol from google webfonts in 2k11's preview. 2013-07-23 10:47:53 +02:00
Matthias Mees 28d8a0fb34 Remove protocol from google webfonts in 2k11. 2013-07-23 10:46:17 +02:00
Garvin Hicking e283ba69b3 backport 2013-07-23 10:03:53 +02:00
Garvin Hicking 1ea154b028 fix parse error, sorry 2013-07-23 09:34:39 +02:00
Garvin Hicking 3d7f4dc250 switch to mysqli if php5.5 is detected (mysql deprecated) 2013-07-23 09:32:42 +02:00
Ian dfcd778001 Update serendipity_event_spartacus.php
disabled todo note 
Serendipity version check is working
2013-07-21 16:47:09 +02:00
Ian 39e8dbe05c upgrader note BP template change 2013-07-16 15:20:40 +02:00
Ian 694a81a286 accessify throw new ErrorException to PHP >= 5.3 only
since 5.2.x (sometimes?) may create strange errors, see http://board.s9y.org/viewtopic.php?f=10&t=19436

I think we don't need to upport this to 2.0, since we will need to bump Serendipity's PHP version to need 5.3 or even up, because of namespaces, security and others soon. PHP 5.2 support has stopped and the PHP 5.3 series has reached end-of-life this summer and will receive only security fixes for the next year.
2013-07-15 20:11:47 +02:00
Ian 34de15298d document 2013-06-28 18:06:58 +02:00
Ian a68f57498b upgrade Smarty to 3.1.14 - see changelog 2013-06-28 17:01:48 +02:00
Garvin Hicking 33a649d624 thanks, ian 2013-06-09 20:07:28 +02:00
Garvin Hicking 16a14d2965 Upgrade will now remove browsercompat plugin (hopefully, needs testing) ;) 2013-06-09 13:33:39 +02:00
Ian e2bad7dd50 revisited 1082a5c
better use the hook, if available, but still left .htaccess file and .thumbs dir exludement where this was necessary
2013-06-05 11:34:18 +02:00
Ian 1082a5c266 Fixed ML exclude path to not show/proceed ckeditor/kcfinders .thumbs dir
this also did some tab2whitespace cleanup
and also fixed serendipity_fetchImages() to skip .htaccess files for ckeditor/kcfinder usage
2013-06-04 19:23:21 +02:00
Ian 230175edd4 respect github sourcecode prettify 2013-05-31 21:05:05 +02:00
Ian e7c93ad835 plugin API method parseTemplate() is 1.7 ready 2013-05-31 12:11:33 +02:00
Ian f2c6983139 catch up add 2013-05-30 21:23:54 +02:00
Ian 4efc4c0ac1 catch up with "2.0" 2013-05-30 21:18:05 +02:00
Ian 7182b48991 use USERLEVEL_ADMIN 2013-05-29 15:43:16 +02:00
Ian 68fbc2112e bind production mode view errors to admin users 2013-05-29 15:05:16 +02:00
Ian b0af9f201a some more verbose doc notes in 2aab3f 2013-05-29 12:52:44 +02:00
Ian 2aab3f9ca4 production mode error accessment 2013-05-28 14:41:09 +02:00
Ian 3f2f853f23 document 2013-05-28 12:37:09 +02:00
Ian fc184b815f bump date for 4883824 2013-05-27 19:39:35 +02:00
Ian 4883824238 fixed categorytemplates in colorset bulletproof 2013-05-27 19:37:09 +02:00
Ian f743546d3b ixed some missing ending strong tags 2013-05-22 15:53:41 +02:00
Matthias Mees 4eaa36608b Properly encoded German translation for stable archives. 2013-05-21 10:10:15 +02:00
Matthias Mees 81ae9c9b21 German translation for stable archives added. 2013-05-20 19:01:08 +02:00
Ian 702663cae9 document 2013-05-16 17:47:46 +02:00
Ian 4db855dc40 spartacus - fixed curl result bug 2013-05-16 17:30:30 +02:00
Ian 07ef469c12 document rc meaning "in time of" 2013-05-15 12:05:43 +02:00
Ian 3b07311d9a document 2013-05-15 11:51:04 +02:00
Garvin Hicking 684ef4d3d1 document 2013-05-15 09:40:04 +02:00
onli 78f044c421 also copy baseURL if defaultBaseURL empty but set 2013-05-14 15:31:06 +02:00
onli 84eff93dec Merge branch 'master' of github.com:s9y/Serendipity 2013-05-14 00:52:35 +02:00
onli bc0519a453 copy baseURL to defaultBaseURL on upgrade 2013-05-14 00:52:18 +02:00
Ian 07493279ea logicals, thanks to Jos
http://board.s9y.org/viewtopic.php?f=4&t=19296
2013-05-13 19:50:33 +02:00
Ian 242520bb50 fixed statistics sidebar querys for PostgreSQL 2013-05-13 19:29:09 +02:00
Ian a12c4f306d fixed to UTF-8 w/o BOM and debug typo 2013-05-12 15:29:01 +02:00
Garvin Hicking 659ea22c58 1.7.1 2013-05-12 12:41:21 +02:00
Ian 61a51e10f8 typo 2013-05-11 19:21:20 +02:00
Ian 2c7af59f5f fixed bug in commit 9ce7e73 2013-05-11 18:53:27 +02:00
Garvin Hicking 2609304ab4 release doc 2013-05-11 16:17:35 +02:00
Garvin Hicking 5ff6793e55 release hints 2013-05-11 15:30:48 +02:00
Garvin Hicking f191883708 prepare release 2013-05-11 15:24:22 +02:00
Garvin Hicking 50322c9f63 merge to deployment 2013-05-11 15:23:37 +02:00
Garvin Hicking 8055e954ee fix typo 2013-05-09 12:38:34 +02:00
Ian 7fb6b5a305 serendipity_emit_htmlarea_code() does not need to return true
which can note badly as 1 in 'backend_wysiwyg' hooks
2013-05-08 20:10:38 +02:00
Ian 3a5af56fc9 note ckeditor plugin ready 2013-05-07 17:31:59 +02:00
Garvin Hicking 4fe1491eaf Merge pull request #16 from rlerdorf/master
Fix a bunch of typos and minor mistakes
2013-05-06 00:49:12 -07:00
Rasmus Lerdorf b79ab865c7 Fix a bunch of typos and minor mistakes 2013-05-05 23:45:38 -07:00
Ian 961add3ff6 disabled ckeditor source mode fallback 2013-05-05 19:08:55 +02:00
Ian b959adf5c8 get JS ready for CKEDITOR plugin 2013-05-05 17:06:00 +02:00
Ian 2f8e0a75d4 note 53ed3ab issue 2013-05-05 15:49:07 +02:00
Ian 53ed3ab139 fixed plugin-hooks staticpage form textarea element objects in non-wysiwyg mode 2013-05-05 15:34:42 +02:00
Matthias Mees 9f671a47b1 Forgot to bump the date. 2013-05-04 13:28:24 +02:00
Matthias Mees 214bbfdc22 Updated 2k11 to v1.2.7. 2013-05-04 13:26:26 +02:00
Garvin Hicking c498dee9fd document 2013-04-29 13:25:05 +02:00
Garvin Hicking 90cc96fd7d htaccess fix by dlange 2013-04-29 13:22:20 +02:00
Ian b54d5f9693 fixed testing checksum empty 2013-04-25 11:11:38 +02:00
Ian ae2414134e fixed spamblock PHP 5.4 warning 2013-04-23 09:56:53 +02:00
Vladimir Ajgl 8d0f3db5ba big cleanup of czech language file - unification of used terms, fix of wrongly translated terms 2013-04-13 15:12:07 +02:00
Ian 1b53092a21 enhance 7548e68c31 to better check null first 2013-04-08 18:38:16 +02:00
Ian 7548e68c31 better exception switch for db connect errors 2013-04-08 17:56:43 +02:00
Ian 0c0367ceab fixed 1e5c38d065 doc typo 2013-04-07 18:38:54 +02:00
Ian 1e5c38d065 avoid SPL exception display db connect data 2013-04-07 17:23:10 +02:00
Vladimir Ajgl 9d8829f0df update of czech translation for 2k11 template 2013-03-31 20:53:18 +02:00
Matthias Mees 59676677b9 Missed a JS file due to friggin' permissions. Grrr. 2013-03-30 12:54:38 +01:00
Matthias Mees cf4b76ee21 Updated 2k11 to v1.2.6. 2013-03-30 12:53:18 +01:00
Matthias Mees cf2f7c1528 Fixes static page date format. 2013-03-26 18:44:15 +01:00
Ian 4c483e7f73 fixed upgrader typo 2013-03-21 17:36:19 +01:00
Ian df505a4d93 news update 2013-03-13 09:58:17 +01:00
Ian 1d1a68aa17 entryproperties userlevel check var has strictly changed...
this old var (and the new) did work before, but what made it change?
2013-03-10 10:38:40 +01:00
Vladimir Ajgl 1c302acb5e czech translation update 2013-03-03 12:54:14 +01:00
Ian 5fbe6850f4 stick to constant string and revert 412359a 2013-02-20 17:18:01 +01:00
Ian cac6e0f0e2 fixed media_items wrong th tag 2013-02-18 15:34:50 +01:00
Ian f107736a41 fixed media pane redundant </td> 2013-02-18 15:32:40 +01:00
Ian 412359adf7 fixed echo mixed array name constant/vars in groups 2013-02-18 14:44:13 +01:00
Ian 8f168c8665 debug_backtrace >= php 5.3.6 only 2013-02-12 09:16:36 +01:00
Garvin Hicking 6de3d6c5b6 rc4 (not to be released right now though) 2013-02-08 08:40:39 +01:00
Garvin Hicking e846b0ea8c backport 2013-02-08 08:40:03 +01:00
Garvin Hicking 54e044ff09 escape hotlinked image 2013-02-08 08:28:22 +01:00
Matthias Mees 75ab019136 Escaping. Final version. Hopefully. 2013-02-07 23:46:12 +01:00
Matthias Mees 7d2febdb22 Escaping JS instead of HTML. 2013-02-07 19:35:27 +01:00
Matthias Mees 8966e1605d Escape emitted template option HTML. 2013-02-07 17:01:30 +01:00
Matthias Mees ce09949de9 Escape emitted template option HTML. 2013-02-07 16:29:39 +01:00
Garvin Hicking 3a20602939 prep rc3 2013-02-07 13:26:23 +01:00
Garvin Hicking da58de906e Merge branch 'master' of github.com:s9y/Serendipity
Conflicts:
	docs/NEWS
2013-02-07 12:42:28 +01:00
Garvin Hicking e983c31ee4 Port missing from 2.0 2013-02-07 12:40:24 +01:00
Garvin Hicking 2962760352 better value escaping (please check) 2013-02-07 12:37:06 +01:00
Ian 8215d0dbcd typo 2013-02-07 12:07:33 +01:00
Ian ff4d511a2f reset verbosity in testing environments back to original intention
and be more strict to $serendipity['production']
2013-02-07 12:01:37 +01:00
Ian b72f6d98d9 fix double slash in target 2013-02-07 11:07:54 +01:00
Matthias Gutjahr aadc851bf1 Fix for "Illegal string offset 'tag'" error 2013-02-06 11:42:20 +01:00
Ian 2554e3cc6e temporary workaround "Illegal string offset 'tag'" error
until better idea, as using isset() here, ends up with count($files)
DEBUG: ERROR: XML tree did not contain requested plugin: error.
2013-02-04 14:21:27 +01:00
Ian b7e6952b36 added empty $template_config_groups var
for template changes, if previous template had these set
2013-02-03 11:20:28 +01:00
Ian fa53301283 smarty bugfix
as might be related to the microformat error reason (~?)
2013-01-25 09:16:58 +01:00
Ian 8c9f8d2a66 fixed explode 2cd param to string 2013-01-24 17:57:14 +01:00
Ian 95a21fea7d added smarty BC function get_template_vars()
relies on some additional plugins like serendipity_event_autotitle.php, serendipity_event_multilingual, serendipity_event_sidebarhider, serendipity_event_downloadmanager, serendipity_event_microformats and possibly also more plugins by custom developers.
2013-01-24 15:40:22 +01:00
Ian 4174a8f7fc bump date in changed BP template 2013-01-23 12:22:00 +01:00
Ian 985d8d29ca reflect POST in BP template configs re-set situations 2013-01-23 11:08:33 +01:00
Ian 16cf06e60e Update include/serendipity_smarty_class.inc.php
re-add prev removed disabled config switch
2013-01-21 17:11:44 +01:00
Matthias Mees 568bba8ade Note changed to reflect safer version. 2013-01-21 16:54:46 +01:00
Matthias Mees a55fd284c2 Safer version of Smarty3 compatibility. 2013-01-21 16:51:16 +01:00
Garvin Hicking b608d63e35 Smarty3 compatibility to promote $entry to sub-templates 2013-01-21 10:06:44 +01:00
Garvin Hicking fdeefd2cf7 Merge branch 'master' of https://github.com/s9y/Serendipity 2013-01-21 09:27:12 +01:00
Garvin Hicking edc8c35be2 browsercompat note 2013-01-20 13:10:46 +01:00
Garvin Hicking fef75b3f9f Merge branch 'master' of https://github.com/s9y/Serendipity 2013-01-20 13:09:08 +01:00
garvinhicking 10fddac2d8 add note about browsercompat 2013-01-20 13:07:39 +01:00
Garvin Hicking f704375a2c I guess I will never understand bitmasks.
This now seems to work in both PHP 5.2 and PHP 5.4, and I might even udnerstand why ;)
2013-01-20 11:04:14 +01:00
Garvin Hicking 6f2858ad27 Fix the error_reporting somewhat; until now, prevent E_STRICT errors were not correctly surpressed, but
we need to do this, because otherwise older plugins will prevent Serendipity from loading.

I actually wanted to at least "break" stuff and report errors, when $serendipity['production'] is set to "debug".

However, this does NOT work for me (PHP 5.2); even when set to "debug", E_STRICT errors do not seem to show up.
I'm quite at a loss here, so anyone reading this, go ahead and inspect.

At least it makes this version work when "older" plugins exists. It would be great if the code could be made to show the debug errors in debug mode.

I shuffled around the error_reporting() position because when someone sets the variable in serendipity_config_local.inc.php it would be too early to affect code flow; now it should evaluate the variable properly.
2013-01-20 01:24:23 +01:00
Garvin Hicking e952791bb1 Bump version, also add some upgrader notices for people to see 2013-01-19 15:52:41 +01:00
Garvin Hicking de2188ed0b This at least fixes some issues in the frontend.
I get errors only in my PHP 5.2 installation, PHP 5.4 is different.
In my backend now I do get a STRICT STANDARDS error still, even if it should be muted.
I don't understand this, needs more thorough investigation.
2013-01-19 15:49:42 +01:00
Ian 7143f43cf0 fixed Illegal string offset 'tag' 2013-01-19 12:42:23 +01:00
Garvin Hicking a4e14b62c2 Label as 1.7-rc1 2013-01-19 11:35:05 +01:00
Ian ba993f66de fixed some old markup missing tags
fixed non ending div tag with uneven radio buttons
fixed non ending ol and tr in sequence

please double check!
2013-01-16 17:55:37 +01:00
Ian 9012161c8b Smarty 3.1.13 - see changelog 2013-01-16 17:39:51 +01:00
Matthias Mees 9674ffb106 Updated 2k11 to v1.2.5. 2013-01-13 21:21:17 +01:00
Ian 82e8a44cf0 entry form toolbar document.write replacement 2013-01-13 13:49:22 +01:00
Matthias Mees 6716590c91 Added .editorconfig to .gitignore. 2013-01-06 16:32:07 +01:00
Garvin Hicking 511004af24 typo fix by qbi 2013-01-01 21:20:29 +01:00
Ian e2bec8a1d6 moved script part to head and some indent cleanup 2012-12-30 10:35:31 +01:00
Ian 6d8590c44b convert document.write and removed some wrong closing tags 2012-12-30 10:26:12 +01:00
Ian 326929d67d imageCrop now opens via window.open 2012-12-30 09:55:42 +01:00
Ian a5064dba23 fixed old bug with non closings tags which modern browser didn't mind 2012-12-17 13:22:16 +01:00
Ian a5d03bfb56 reverted last commit to only clear errored line 1512
"Only variables should be assigned by reference"
2012-12-13 15:10:44 +01:00
Ian 6a147be2cd Merge branch 'master' of github.com:s9y/Serendipity 2012-12-13 15:02:38 +01:00
Ian 6a796ebe93 Revert to 78cb307b73 2012-12-13 14:49:51 +01:00
Ian 6340e21614 upport: Only variables should be assigned by reference 2012-12-13 14:03:43 +01:00
Ian 78cb307b7e Only variables should be assigned by reference 2012-12-13 13:41:50 +01:00
Ian 57f5e8d48b fixUrl fix 2012-12-10 10:12:53 +01:00
Ian ae8230ebda fixUrl fix 2012-12-10 10:07:20 +01:00
Ian 78dd515f7d fixed comment entrylink url 2012-12-09 15:59:33 +01:00
Ian c90142080f outsourced comments scripting to serendipity_editor.js 2012-12-09 14:58:59 +01:00
Matthias Mees baa7d04860 Added fix for full/summary display as suggested by @ophian in 1618471d. 2012-12-09 13:49:11 +01:00
Ian dd4a1d97ba fixed note typo and shorten param 2012-12-08 14:23:54 +01:00
Ian 546e7c9ee6 minor - fix note typo and shorten param 2012-12-08 14:19:23 +01:00
Ian a66aa90424 tab2space cleanup 2012-12-08 14:12:12 +01:00
Ian 4028ac265b backport 9aebc99 - fixed doubled slashes without breaking URI
also fixing some tabs to spaces
2012-12-08 14:08:04 +01:00
Ian 2ea415976e Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-08 13:54:47 +01:00
Ian 9aebc99eac fixed doubled slashes without breaking URI 2012-12-08 13:54:17 +01:00
Matthias Mees 8784c81abe Minor layout improvements for category overview. 2012-12-08 13:41:37 +01:00
Matthias Mees 1618471dad Improved markup and basic styling for comments page. 2012-12-08 13:24:35 +01:00
Ian efd4d723fc better double slash fix,
as the first try did catch http prefixes too
2012-12-08 12:10:42 +01:00
Ian af2c7efa21 better empty message, based to constant NONE 2012-12-08 10:03:53 +01:00
Ian 5d5faddaa2 removed non js todo note (please read comment) 2012-12-07 19:44:44 +01:00
Ian 3a0c0ec158 temporary sequence dragpoint fixed in single plugins with sequencing 2012-12-07 19:24:36 +01:00
Ian 449367c7aa js ending delimiter S3 auto literal behaviour is quite bulletproof
tests have proofed " } ;" and " };" and even "};" are interpreted correct!
2012-12-07 18:00:52 +01:00
Ian 7544348e08 tabs to spaces 2012-12-07 17:13:14 +01:00
Ian 5193d4a785 one more auto literal whitespace added 2012-12-07 17:12:41 +01:00
Ian 253b871aec more on Smarty 3 auto literal recommended use 2012-12-07 16:48:00 +01:00
Ian d14085f3c7 recommended use Smarty3 auto literal }; whitespace}whitespace; 2012-12-07 16:36:09 +01:00
Ian 3b90cddfff some whitespace cleanup to e03e95b 2012-12-07 15:56:39 +01:00
Ian e03e95b33a fixed delimiters, tabs to whitespaces and fixed doubled &amp; 2012-12-07 15:44:47 +01:00
Ian 7214c413c8 arranged GET order to follow "codex" 2012-12-07 15:43:25 +01:00
Garvin Hicking ebd361c201 Insert/transfer variable from smarty to JS 2012-12-07 15:02:12 +01:00
Ian 6368a992f9 unstringify str_repeat math 2012-12-07 10:55:37 +01:00
Ian 69e0cbe1b9 arranged get-order in entry delete link 2012-12-06 12:56:52 +01:00
Ian 8731a1965c changed icon_link trash GET order to "codex" 2012-12-06 11:41:41 +01:00
Matthias Mees c132415bc1 Small layout fix for category info. 2012-12-05 14:53:01 +01:00
Matthias Mees 469c8391d1 Small screen layout for entry filters/sort. 2012-12-05 14:45:46 +01:00
Matthias Mees 01c871ff1a Introducing .msg_dialogue. 2012-12-05 14:37:28 +01:00
Matthias Mees 51ca1d36f2 Better layout for edit entries page. 2012-12-05 14:17:48 +01:00
Matthias Mees 44885ea0f0 Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-05 13:58:48 +01:00
Matthias Mees bd4daed2b7 Markup changes to permit better layout. 2012-12-05 13:58:32 +01:00
Ian 85c5cc4d82 fixed 'no entries to print'
- at last...?
2012-12-05 13:41:14 +01:00
Matthias Mees 26b883cb69 QA: make sure checkbox or radio elements are wrapped. 2012-12-05 12:34:45 +01:00
Matthias Mees 5984d26a57 Better widths for select elements here. 2012-12-05 12:19:12 +01:00
Matthias Mees 4580ba65e2 Very subtle text-shadow to make the header area a bit more plastic. 2012-12-05 12:15:07 +01:00
Matthias Mees 567e6dc74d Bug seems to be resolved. 2012-12-05 12:05:12 +01:00
Matthias Mees 49a8c07ad5 Bug note for @ophian. Still doesn't work expectedly. 2012-12-05 12:03:48 +01:00
Matthias Mees db60c3be04 QA: NOTE means TODO. 2012-12-05 12:01:50 +01:00
Matthias Mees 78a655911b QA: Fixed a few stray i18n notifiers. 2012-12-05 12:00:42 +01:00
Matthias Mees 5daf91c241 Typo fixed. 2012-12-05 11:39:25 +01:00
Matthias Mees 8798001270 Proper markup for media upload form; also modified jQuery code by @garvinhicking to clone label elements as well. 2012-12-05 11:27:55 +01:00
Matthias Mees d8d9785173 Some XHTML notation cleanup. 2012-12-05 10:26:05 +01:00
Matthias Mees 4694a70b18 Basic layout for entry editor. 2012-12-05 09:32:09 +01:00
Matthias Mees d2d64120ef Fix for banner if user is not logged in. 2012-12-05 08:18:17 +01:00
Matthias Mees d99d68c9da Adapted positioning of #user_menu to screen real estate. 2012-12-05 08:07:02 +01:00
Matthias Mees d6053157ed Adapted positioning of #user_menu to screen real estate. 2012-12-05 08:05:57 +01:00
Matthias Mees ade29fcc75 Adapt #user_menu icon sizes better to screen real estate. 2012-12-05 08:03:24 +01:00
Matthias Mees b49a592c50 Bigger icons for #user_menu. 2012-12-05 07:59:29 +01:00
Matthias Mees a9f33abfe2 Corrected margins for #banner elements. 2012-12-05 07:54:20 +01:00
Matthias Mees 798c86e5ff Dropped redundant header styles. 2012-12-05 07:51:33 +01:00
Matthias Mees 4903f33300 Restructured header area and user menu. 2012-12-05 07:50:20 +01:00
Matthias Mees 02ec1aeb14 Fixed falsely positioned if statement. 2012-12-05 07:47:32 +01:00
Matthias Mees 545e3224aa Icons need the title. 2012-12-04 15:39:43 +01:00
Matthias Mees 3faac482cb Better icon. 2012-12-04 15:38:46 +01:00
Matthias Mees 4e33b815b4 One class attribute only, stupidhead. 2012-12-04 15:37:35 +01:00
Matthias Mees 20fbdadcf8 Icons added. 2012-12-04 15:36:24 +01:00
Matthias Mees c1b833bd5e Icons added. 2012-12-04 15:30:24 +01:00
Matthias Mees 438237f3bd Icon added. 2012-12-04 15:19:57 +01:00
Matthias Mees 8a24cd47eb Updated 2k11 to v1.2.4. 2012-12-04 12:44:50 +01:00
Matthias Mees b3365c4a0d Updated 2k11 to v1.2.4. 2012-12-04 12:42:54 +01:00
Matthias Mees fb41727385 Added pagination icons. 2012-12-04 02:40:08 +01:00
Matthias Mees 635a39a772 More icons added. 2012-12-04 02:34:09 +01:00
Matthias Mees d516548532 Message icons added. 2012-12-04 02:21:43 +01:00
Matthias Mees 5da4f5cc35 Message icons added. 2012-12-04 02:19:08 +01:00
Matthias Mees 54f6ff4ea7 Message icons added. 2012-12-04 02:13:58 +01:00
Matthias Mees f8dae595af Message icons added. 2012-12-04 02:11:08 +01:00
Matthias Mees ec95c94bef Message icons added. 2012-12-04 02:10:22 +01:00
Matthias Mees f3488ff27c Message icons added. 2012-12-04 02:08:13 +01:00
Matthias Mees 5360662e2c Message icons added. 2012-12-04 02:07:08 +01:00
Matthias Mees 5385f750d9 Icons added. 2012-12-04 02:03:14 +01:00
Matthias Mees 65941106a8 Icons added. 2012-12-04 01:58:43 +01:00
Matthias Mees e26b25e056 Must. Remember. .icon_link class. 2012-12-04 01:55:13 +01:00
Matthias Mees 4133b81e38 Icons added. 2012-12-04 01:53:52 +01:00
Matthias Mees 92397e18a1 Icons added. 2012-12-04 01:51:38 +01:00
Matthias Mees bae2352a34 Icons added. 2012-12-04 01:42:37 +01:00
Matthias Mees 26150099de Switched some icons. 2012-12-04 01:36:05 +01:00
Matthias Mees dc1b31dac7 Added additional icons. 2012-12-04 01:33:47 +01:00
Matthias Mees 853d3847d2 (Some) Icons added. 2012-12-04 01:27:21 +01:00
Matthias Mees accc5f3341 Use the proper class names, stupidhead. 2012-12-04 01:15:24 +01:00
Matthias Mees 8056f384d2 Hide icon texts for visual browsers. 2012-12-04 01:14:12 +01:00
Matthias Mees 288f72aa85 Icons added. 2012-12-04 01:11:34 +01:00
Matthias Mees bce5c7d2e9 More icons for 2k11's tpls. 2012-12-04 01:00:23 +01:00
Matthias Mees a516480aac Proper label for media file path; associated with corresponding radio input element. 2012-12-04 00:51:25 +01:00
Ian a9e94e9569 fixed typos in 1f9ed0fa2a 2012-12-03 16:53:57 +01:00
Ian 96e2c8bc3c some more serendipity_moveMediaDirectory() message markup 2012-12-03 16:41:25 +01:00
Matthias Mees 4d79c89f0e Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-03 16:36:14 +01:00
Matthias Mees b7792bab2b Some icons for 2k11's admin tpls. 2012-12-03 16:32:01 +01:00
Ian 6998d1eed1 Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-03 16:27:06 +01:00
Ian 1f9ed0fa2a serendipity_moveMediaDirectory() messages markup 2012-12-03 16:18:29 +01:00
Matthias Mees 78044113aa More redundant br elements fixed. 2012-12-03 15:40:51 +01:00
Matthias Mees 87a68af4c3 More redundant br elements fixed. 2012-12-03 15:39:31 +01:00
Matthias Mees 7288ffdef8 Fixed most of the redundant br elements in the core. 2012-12-03 13:35:59 +01:00
Matthias Mees bd8c2bbda0 Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-03 11:22:09 +01:00
Matthias Mees f11169d396 Ported media_upload.tpl from default. 2012-12-03 11:21:44 +01:00
Ian a81cf60f79 Merge branch '2.0' of https://github.com/s9y/Serendipity into 2.0 2012-12-03 11:14:41 +01:00
Ian 13c3630ff6 fixed one smarty end and set some operating Parenthesis 2012-12-03 11:14:19 +01:00
Matthias Mees af251553df Ported media_choose.tpl from default. 2012-12-03 11:10:00 +01:00
Matthias Mees 00a32476f9 Dropped redundant category_selector.js, ported entries.tpl from default. 2012-12-03 11:00:58 +01:00
Ian bfea00fba4 fixed typo in c8105426 2012-12-03 10:50:14 +01:00
Ian 15a05c8d7c declare array 2012-12-03 10:47:36 +01:00
Garvin Hicking c810542654 Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-12-03 10:21:02 +01:00
Garvin Hicking aff47d1d48 For yellowled: Remove this strange cloning dependency, port it to jquery.
Also remove as much inline JS as possible and move it into serendipity_editor.js
Got rid of category_selector JS file, as I prefer the single serendipity_editor.js file

NOTE: Those changes will need to be ported/merged into the 2k11 style, I think?
2012-12-03 10:18:04 +01:00
Matthias Mees db2f7ce63e Added icon font and basic CSS for it to 2k11 admin tpl. 2012-12-03 09:56:24 +01:00
Matthias Mees 8397b08b88 Added new backend template files (smartified core tpls and 2k11 admin tpls as well as related assets). 2012-12-03 00:59:42 +01:00
onli ca61181daa customURI != customURL, let spartacus fail 2012-12-02 18:00:59 +01:00
Ian 9ccb4c6edd fixed sequence js var 2012-12-02 13:03:30 +01:00
Ian 128d85c9a2 fixed if to NO_ENTRIES_TO_PRINT 2012-12-01 20:06:25 +01:00
Ian 8a259eb2ab Merge branch '2.0' of https://github.com/s9y/Serendipity into 2.0 2012-12-01 19:01:00 +01:00
Ian 37403920a2 fixed create new group startform 2012-12-01 18:59:36 +01:00
Ian 4fcc7dc1f6 fixed another two by reference errors 2012-12-01 18:58:50 +01:00
Garvin Hicking e4530d4ae0 backport (hopefully alright) 2012-11-29 16:03:01 +01:00
Garvin Hicking 3dd1a40f58 added constant for every language 2012-11-29 16:00:28 +01:00
Ian 68712333e1 added renaming description constant to backend media upload 2012-11-29 14:06:18 +01:00
Ian a036248d63 added new constant PLAIN_ASCII_NAMES 2012-11-29 14:05:03 +01:00
Ian 41f5f0aea7 added renaming description constant to backend media upload 2012-11-29 14:02:08 +01:00
Ian 28a30ce050 added new constant PLAIN_ASCII_NAMES 2012-11-29 14:00:41 +01:00
Garvin Hicking 48993971f2 Merge pull request #12 from weltling/2.0
Support port config for postgres db connection
2012-11-27 23:56:08 -08:00
Anatoliy Belsky f574fe1a87 Support port config for postgres db connection
Upport from master
2012-11-28 08:39:10 +01:00
Garvin Hicking 7aab7dde09 Merge pull request #11 from weltling/master
Support port config for postgres
2012-11-26 00:19:47 -08:00
Anatoliy Belsky b55e516651 Support port config for postgres db connection 2012-11-25 14:56:52 +01:00
Ian 0f51f5ec4d fixed wrong sidebar array var 2012-11-25 13:38:27 +01:00
Ian a94b4a618a just to make sure Mattsches... ;-) 2012-11-20 19:40:30 +01:00
Ian 912889fccc upport Garvins Spartacus master fixes and mattches 10a1a5c565 commit,
which could sadly not get cherry-picked! (Possibly being based to a differing parent commit)
2012-11-20 16:36:45 +01:00
Garvin Hicking ae8c7768ec one more try 2012-11-20 16:30:22 +01:00
Garvin Hicking 082f4b729c try to circumvent a problem 2012-11-20 16:29:52 +01:00
Ian 312c886d62 last commits switch to functions_plugins_admin.inc too 2012-11-20 15:33:36 +01:00
Ian fb81d6a121 added temporary backend developer template dir switch - Please read:
The smartified code as forked from master to 2.0 being outsourced,
now is to find in /include/admin/tplold, which will still be used as
the default backend template dir.
To switch to the new version, please paste the dirs and files of s9y-admin-tpl
as adviced in the readme and reload, but also add a
```php
	// End of Serendipity configuration file
	// You can place your own special variables after here:

	define('SWITCH_TEMPLATE_VERSION', 'true');

```
to the end of your serendipity_config_local.inc.php.

To switch back to the old smartified files, just set a // to the define().
2012-11-20 14:38:28 +01:00
Matthias Gutjahr 10a1a5c565 Added check for non-existing 'tag' key 2012-11-14 18:34:19 +01:00
Matthias Mees 370f30a269 Updated jQuery to v1.8.3. 2012-11-13 15:19:49 +01:00
Matthias Mees 64adea2cee Updated jQuery to v1.8.3. 2012-11-13 15:19:08 +01:00
Ian d3d557de91 strip down double slashes in prev & next links
see http://board.s9y.org/viewtopic.php?f=10&t=18944
2012-11-12 13:26:05 +01:00
Ian 9c7b579a1e strip down double slashes in prev & next links
see http://board.s9y.org/viewtopic.php?f=10&t=18944
2012-11-12 13:23:47 +01:00
Ian 46e7bcf40d trying to upport garvins entryproperty commit
d4d24c4c31 and 5a33a7c8d0

Sorry I missed that this commit wasn't upported to 2.0, before I tried to cherry pick my tiny fix. Now this had to be done manually.
2012-11-12 12:10:50 +01:00
Ian a6ac1daff3 fixed last commits array to string 2012-11-12 11:58:30 +01:00
Ian d4d24c4c31 fixed last commits array to string 2012-11-12 11:41:49 +01:00
Garvin Hicking b3755bcb28 one more try 2012-11-06 14:50:12 +01:00
Garvin Hicking 3b00ba8767 try to circumvent a problem 2012-11-06 12:39:19 +01:00
Garvin Hicking 94c4f32b08 backport 2012-11-06 11:25:39 +01:00
Garvin Hicking e354ecdd3e Bugfix, wrong variable. 2012-11-06 11:24:29 +01:00
Garvin Hicking 5a33a7c8d0 * Allow entryproperties plugin to define defaults for custom fields 2012-10-30 11:35:40 +01:00
Garvin Hicking ffd034811d PHP5 compat 2012-10-18 11:19:58 +02:00
Garvin Hicking d887078a3d PHP5 compat 2012-10-18 11:19:44 +02:00
Garvin Hicking 9adcfecc38 More PHP5 compatibility (this constructor thing order did not remove the error for me)
Also be able to set $serendipity['production'] in serendipity_config_local.inc.php
2012-10-18 10:14:04 +02:00
Garvin Hicking 48861c5505 More PHP5 compatibility (this constructor thing order did not remove the error for me)
Also be able to set $serendipity['production'] in serendipity_config_local.inc.php
2012-10-18 10:13:11 +02:00
Ian a8ffe23890 another str_repeat math issue 2012-10-17 18:05:15 +02:00
Ian 22ab2433c7 another php5 combat assign reference issue 2012-10-17 18:04:07 +02:00
Ian 802c1dc18e another php5 compat assigned by reference 2012-10-17 18:01:16 +02:00
Ian 3ba8bdc854 another str_replace math issue 2012-10-17 17:59:52 +02:00
Ian 8a42ed74c4 fixed wrong paranthesis in media_upload.tpl 2012-10-17 15:00:08 +03:00
Grischa Brockhaus 7d8fdc7db6 ESTRICT double constructor (wrong order of them) 2012-10-16 11:30:51 +02:00
Matthias Mees 71ca3cd6de Updated 2k11 to v1.2.3. 2012-10-15 08:37:35 +02:00
Matthias Mees 7be050e1e2 Updated 2k11 to v1.2.3. 2012-10-15 08:36:10 +02:00
Don Chambers 1889a7d248 Update bulletproof with staticpage breadcrumb nav 2012-10-13 14:34:40 -05:00
Ian 706ffbe594 fixed PHP5 only variables should be assigned by reference 2012-10-09 20:49:05 +02:00
Ian 84b1569fe5 fixed PHP5 only variables should be assigned by reference 2012-10-09 20:16:10 +02:00
Ian 878cb2befa fix str_repeat modifier use …
A Smarty3 modifier has higher priority than multiplication, so we have to use () to execute math first
2012-10-07 10:36:12 +02:00
Matthias Mees 1f10d4bc4e Oops, screwed up file permissions reverted. 2012-10-07 10:32:25 +02:00
Ian 1087a75cf1 fix str_repeat modifier use
A Smarty3 modifier has higher priority than multiplication, so we have to use () to execute math first
2012-10-07 10:25:00 +02:00
Ian 475fadf31c fixed groups.inc.tpl wrong {} 2012-10-06 20:29:15 +02:00
Matthias Mees 2ca675a90e Updated 2k11 to v1.2. 2012-10-03 15:42:05 +02:00
Matthias Mees 614a9abe29 Oops, screwed up file permissions reverted. 2012-10-03 15:38:50 +02:00
Matthias Mees 3526eb6ab3 Updated 2k11 to v1.2. 2012-10-03 15:35:30 +02:00
Ian d9647b0086 fixed issue in last 4e56b44 commit 2012-09-27 16:10:06 +02:00
Ian 4e56b4400d some document.write replacements with better method 2012-09-27 15:58:34 +02:00
Ian dae8075e47 some document.write replacements with better method 2012-09-27 15:45:06 +02:00
Ian a34fd72449 Smarty 3.1.12 has been released.
3.1.12 has minor bug fixes and improvements. Smarty also received a security fix regarding the escapement of Smarty error messages. ie. an unrealistic but testable case where you call $smarty->display($_GET['id']); and the GET value is passed directly to the error message. To resolve any probable concern, error messages are now escaped.

For details please read the Smarty 3.1.12 Change Log.
2012-09-26 09:01:54 +02:00
Ian b22c4d315c Update plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
empty entries caused error in alpha versions.
2012-09-26 09:01:08 +02:00
Ian 0644cd803c Smarty 3.1.12 has been released.
3.1.12 has minor bug fixes and improvements. Smarty also received a security fix regarding the escapement of Smarty error messages. ie. an unrealistic but testable case where you call $smarty->display($_GET['id']); and the GET value is passed directly to the error message. To resolve any probable concern, error messages are now escaped.

For details please read the Smarty 3.1.12 Change Log.
2012-09-26 08:59:16 +02:00
Ian 10af3cf189 Update plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
empty entries caused error in alpha versions.
2012-09-24 19:49:58 +03:00
Matthias Mees 0df4069928 Updated jQuery to v1.8.2. 2012-09-21 11:21:56 +02:00
Matthias Mees 192fa8bf05 Updated jQuery to v1.8.2. 2012-09-21 11:21:13 +02:00
Vladimir Ajgl 388e0bf67c update of czech translation 2012-09-09 20:23:17 +02:00
Matthias Mees fd12904965 Updated jQuery to 1.8.1. 2012-09-01 20:55:17 +02:00
Matthias Mees 1d2380ca65 Updated jQuery to 1.8.1. 2012-09-01 20:54:34 +02:00
Matthias Mees f0b71a50f3 Added OS X hidden files to ignored files. 2012-08-24 14:34:17 +02:00
Matthias Mees ab4a8da625 Added OS X hidden files to ignore file. 2012-08-24 14:24:35 +02:00
Ian 57e63251b3 cleared whitespace missmatch in serendipity_die() 2012-08-23 17:18:31 +02:00
Ian 36b9441af0 cleared whitespace missmatch in serendipity_die() 2012-08-23 17:16:35 +02:00
Ian 2fafa72157 fixed github preview image path 2012-08-22 20:45:36 +02:00
Ian 71c1011eb5 fixed github preview image path 2012-08-22 20:41:58 +02:00
Matthias Mees 16b4cc6741 Updated jQuery to 1.8.0. 2012-08-10 00:13:25 +02:00
Matthias Mees 66f84cfee7 Updated jQuery to 1.8.0. 2012-08-10 00:12:21 +02:00
Matthias Mees c04aeca1d7 Updated 2k11 to v1.1.8. 2012-08-01 14:25:01 +02:00
Matthias Mees 8bd891bc80 Updated 2k11 to v1.1.8. 2012-08-01 14:23:28 +02:00
Garvin Hicking 1593395f21 issue fix 2012-07-27 11:46:58 +02:00
Ian 03e8d3ce7b Smarty 3.1.11 2012-07-01 18:28:27 +02:00
Ian 81c3de9a3d Smarty 3.1.11 2012-07-01 18:25:01 +02:00
Ian ea66e5b89f fixed tabs 2012-07-01 18:22:39 +02:00
Grischa Brockhaus 823e39f22e ESTRICT double constructor (wrong order of them) 2012-06-22 19:16:58 +02:00
Grischa Brockhaus fb71ff7ba9 E_STRICT fix 2012-06-14 14:05:21 +02:00
Grischa Brockhaus 8f87205cdd E_STRICT fix. :-/ (this really starts to get annoying..) 2012-06-14 14:03:51 +02:00
Grischa Brockhaus aa3435c62e E_STRICT fix 2012-06-14 13:14:17 +02:00
Grischa Brockhaus dd6ab83600 E_STRICT fixes 2012-06-14 13:12:51 +02:00
Grischa Brockhaus e67ffb6b7d Backport from master: Made simplepie work with E_STRICT 2012-06-14 12:13:48 +02:00
Grischa Brockhaus 001ea42d96 Fixed simplepie to make it work with E_STRICT. 2012-06-14 12:05:52 +02:00
Ian b3c7358f6f non-release fix #4625 -
include failed, if tabs are used to separate attributes
2012-06-13 16:21:18 +02:00
Ian 4d9fa16b1e re-added 2.0 Smartification needs, which got lost by up-port 2012-06-13 16:17:11 +02:00
Grischa Brockhaus 74a9d3b31a ESTRICT fixes 2012-06-13 15:37:05 +02:00
Grischa Brockhaus f951f4498f ESTRICT compatibility fixes 2012-06-13 15:35:02 +02:00
Grischa Brockhaus 4dc7741351 ESTRICT compatibility 2012-06-13 15:29:14 +02:00
Grischa Brockhaus d6c4f8a4de Merge branch 'master' of git+ssh://git@github.com/s9y/Serendipity.git 2012-06-13 15:27:35 +02:00
Grischa Brockhaus a8112cecac ESTRICT compatibility fixes 2012-06-13 15:27:13 +02:00
Garvin Hicking 6a3904b599 backport 2012-06-13 15:23:51 +02:00
Garvin Hicking f1b3e3b241 backport 2012-06-13 15:22:57 +02:00
Grischa Brockhaus e72c90a69d Merged branch 'master' into 2.0 (compatibility fixes) 2012-06-13 15:12:35 +02:00
Grischa Brockhaus 1f9630b394 Compatibility fixes. 2012-06-13 14:24:45 +02:00
Grischa Brockhaus 0407a731de Compatibility fixes 2012-06-13 12:47:16 +02:00
Garvin Hicking 3a3702f7a4 spartacus backport 2012-06-12 20:56:11 +02:00
Garvin Hicking 6899fa3026 spartacus error fix 2012-06-12 20:55:54 +02:00
Garvin Hicking f12f53aaab Damn, why does cherry picking not work? 2012-06-12 20:51:57 +02:00
Garvin Hicking 937454899c Reduce error reporting, else s9y will not run with PHP 5.4 2012-06-12 20:43:49 +02:00
Garvin Hicking 286a24b8cc once again, with feeling 2012-06-12 20:19:38 +02:00
Garvin Hicking 14885379da once again, with feeling 2012-06-12 20:19:29 +02:00
Garvin Hicking 20d50eb2b7 * Improved RSS sidebarplugin to support Atom 2012-06-12 20:16:10 +02:00
Garvin Hicking e6efd5eaf3 * Improved RSS sidebarplugin to support Atom 2012-06-12 20:15:47 +02:00
Garvin Hicking 56a96ecf6c bundle simplepie 2012-06-12 20:01:59 +02:00
Garvin Hicking c49f1c6597 bundled simplepie 2012-06-12 20:01:11 +02:00
Garvin Hicking 58e2cd8c37 porting stuff 2012-06-12 19:39:38 +02:00
Garvin Hicking d7ef7a7a04 port everything so that 2.0 and 1.7 have the same features 2012-06-12 19:39:11 +02:00
Ian dbc992f07e bugfix release Smarty 3.1.10 2012-06-09 18:24:23 +02:00
Ian 508caabbc5 bugfix release Smarty 3.1.10 2012-06-09 18:22:13 +02:00
Grischa Brockhaus d2e7153fdc event_mailer: fixed error in language file. 2012-06-09 15:12:53 +02:00
Ian f6ad1903b7 keep up with master 2012-06-09 11:02:53 +02:00
Ian 4ed69a6187 NEWS cleanup 2012-06-09 10:57:29 +02:00
Ian 65fae5d1b6 cleanup NEWS 2012-06-09 10:51:26 +02:00
Ian 612a7260fc Smarty update to 3.1.9 - see changeLog 2012-06-09 10:43:58 +02:00
Ian 708f4d6073 Smarty update to 3.1.9 - see changeLog 2012-06-09 10:40:49 +02:00
Ian 7294e9679c javascript loading quotes 2012-06-08 14:33:51 +02:00
Ian 7a51ea663e OUT_STACK now supports config_groups magic again 2012-06-08 14:19:04 +02:00
Ian 3ec4c55ec0 captured smartified example method 2012-06-08 10:43:22 +02:00
Ian ba2214598c outsourced backend header javascript 2012-06-07 17:54:33 +02:00
Ian 5f9d9d7690 small js fix and renaming 2012-06-05 19:11:46 +02:00
Ian c48e8d3860 bump version 2012-06-05 17:47:23 +03:00
Ian 14dfcca0ba removed br linebreak 2012-06-05 17:46:25 +03:00
Ian d47e948acf removed br linebreak 2012-06-05 17:44:26 +03:00
Ian 4a4d6a4279 outsourced some javascript and restrict multidelete images to adminModule == 'media' only 2012-06-04 15:30:32 +02:00
Ian 1ebbeeef36 fixed smartification pluggroup name 2012-06-03 11:51:31 +02:00
Ian a0269794c5 note to 2.0 2012-06-02 11:50:19 +02:00
Ian e0f5068190 fetch to display 2012-06-02 11:44:17 +02:00
Ian a1d77c4916 group.inc.tpl - fixed missing CONSTANT 2012-06-01 21:06:12 +02:00
Ian cccd3aca57 no need for assignment 2012-06-01 20:24:08 +02:00
Ian 4bc7f98285 removed tpl {continue} spaces 2012-06-01 17:45:15 +02:00
Ian 85690d6411 fixed entries.inc.tpl - select user smartification bug 2012-06-01 17:21:29 +02:00
Ian c45fc7181b groups.inc.tpl - some better use of booleans 2012-06-01 15:42:57 +02:00
Ian 064506d6f9 group.inc - fixed some possible typos 2012-06-01 15:29:06 +02:00
Ian d3e3ef3516 removed now obsolet internal function allowments 2012-06-01 14:57:56 +02:00
Ian d2d2470716 simplification, fixes, additions and changes to entries.inc.php/tpl 2012-06-01 14:22:54 +02:00
Ian be75b1fd9b Do not forget to update master RELEASE file in case of new releases!
Dashboard relies on this...
2012-05-31 13:44:03 +03:00
Ian 874014747a fixed lang typo of last commit 2012-05-29 20:54:40 +02:00
Ian a956471a44 added to MediaLB multidelete[] 2012-05-29 20:39:23 +02:00
onli 302bb8ee08 conflict resolution 2012-05-27 12:38:51 +02:00
onli 948d2f43c8 stable archive sort: included in fetchEntries, working with categories -> more native approach 2012-05-27 12:36:26 +02:00
Ian 326957d732 fixed typo in note 2012-05-25 11:05:37 +02:00
Garvin Hicking b0271a56d9 Merge branch 'master' of git@github.com:s9y/Serendipity 2012-05-25 10:23:31 +02:00
Garvin Hicking ba4b629816 ISO-8859-1 fallback patch so that my blog works ;) 2012-05-25 10:14:47 +02:00
Ian f6ee851773 added last img error class to BP admin css 2012-05-24 18:42:13 +02:00
Ian a811c8a5c3 fixed class naming issue and make use of new smarty auto literal 2012-05-23 20:02:29 +02:00
Ian a3f03a40af forward thinking - added error / success / notice classes and
removed their img inline styles to default/admin/style.css
2012-05-23 19:23:41 +02:00
Ian 7b585bfe64 some minor backend smartification changes 2012-05-23 18:48:33 +02:00
Garvin Hicking be0b6797ad temporarily revert to default to "false" until kinks are worked out (see board thread) 2012-05-23 15:14:11 +02:00
Ian a368694f24 smartified functions_plugins_admin.inc.php 2012-05-22 20:14:37 +02:00
onli bbfd3b1cee removed debug-echo 2012-05-22 17:15:28 +03:00
onli c571618689 restored sort-order on a single archive-page: from top to bottom = from newest to oldest 2012-05-22 16:10:07 +02:00
onli a0689ae1ac Merge branch 'master' of github.com:s9y/Serendipity 2012-05-22 15:41:45 +02:00
onli 52bdecf89d stable archive sort: genpage.inc.php with different order by was missing 2012-05-22 15:41:28 +02:00
Garvin Hicking d3b6906ffc add language constant for all languagues.
Please ALWAYS add language constants to all files (using addlang.sh i.e.)
2012-05-22 13:30:14 +02:00
onli 6f4658db9c sort archives in a stable way 2012-05-21 16:16:20 +02:00
Garvin Hicking 09e9322666 * Fix SQL injection for comment.php used in read-context.
(Thanks to High-Tech Bridge SA Security Release Lab, Advisory HTB23092)
2012-05-16 11:59:39 +02:00
Garvin Hicking 7b552d2df9 * Fix SQL injection for comment.php used in read-context.
(Thanks to High-Tech Bridge SA Security Release Lab, Advisory HTB23092)
2012-05-16 11:59:02 +02:00
Ian d6c527e422 Smarty3 compat - BP entries.tpl changed eval to assign 2012-05-15 18:18:39 +02:00
Ian 082c5c8c55 Smarty3 compat - BP entries.tpl changed eval to assign 2012-05-15 18:11:11 +02:00
Garvin Hicking 9832c2a95b Merge pull request #9 from mmatuska/master
Add Slovak translation
2012-05-13 06:25:17 -07:00
Martin Matuska 513f61399d Unify Copyright 2012-05-13 12:18:05 +02:00
Martin Matuska bc5c862ec5 Add Slovak translation 2012-05-13 11:49:35 +02:00
Garvin Hicking 863b31d423 port 2012-05-08 09:38:08 +02:00
Garvin Hicking 289d0a0965 backport 2012-05-08 09:37:30 +02:00
Matthias Mees 613355f481 Updated 2k11 to v1.1.7. 2012-05-07 13:54:02 +02:00
Matthias Mees 59a6da24d2 Updated 2k11 to v1.1.7. 2012-05-07 13:52:35 +02:00
Ian 55d45031a9 nl2br better config mismatch check 2012-05-04 09:43:07 +02:00
Ian e6596b3c5d nl2br better config mismatch check 2012-05-04 09:40:49 +02:00
Ian 6b8062d1ed check for config mismatch p_tags vs ISOBR 2012-05-03 19:31:16 +02:00
Ian 8522cc99a8 check for config mismatch p_tags vs ISOBR 2012-05-03 19:27:19 +02:00
Garvin Hicking a5e04542cb backend media 2012-04-22 20:29:55 +02:00
Garvin Hicking 622d6fa9d1 backend media 2012-04-22 20:29:47 +02:00
Garvin Hicking da886799aa Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-04-22 16:15:18 +02:00
Garvin Hicking 17ace68152 improved escaping, thanks to stefan schurtz 2012-04-22 16:14:14 +02:00
Garvin Hicking d8243ece6e improved escaping, thanks to stefan schurtz 2012-04-22 16:13:58 +02:00
Ian 0652e01780 if set, $isobr now hooks to global Serendipity var
to get also used by plugins, like staticpages
2012-04-21 16:20:15 +02:00
Ian 25312f6fdf if set, $isobr now hooks to global Serendipity var
to get also used by plugins, like staticpages
2012-04-21 16:15:13 +02:00
Ian 0b7c7983f7 templates.inc.tpl fixed typo 2012-04-21 12:24:12 +02:00
Matthias Mees 04218b42ad Updated 2k11 to v1.1.6. 2012-04-18 15:33:43 +02:00
Matthias Mees c667c62c11 Updated 2k11 to v1.1.6. 2012-04-18 15:32:32 +02:00
Ian 3dc450f624 Merge branch 'master' of https://github.com/s9y/Serendipity 2012-04-17 12:28:57 +02:00
Ian dc36965bb7 fixed Smarty const check 2012-04-17 12:06:04 +02:00
Ian cdcd77e39c Merge branch '2.0' of https://github.com/s9y/Serendipity into 2.0 2012-04-17 11:38:25 +02:00
Ian 54e310b1e4 fixed Smarty const check 2012-04-17 11:37:53 +02:00
Garvin Hicking 6096a4a1ed fix wrong parentheses 2012-04-12 13:40:20 +02:00
Garvin Hicking 66e86ba1cf fix wrong parentheses 2012-04-12 13:40:17 +02:00
Garvin Hicking 04792e998a port 2012-04-11 21:03:55 +02:00
Garvin Hicking 13287acd12 Try to fixup DOCUMENT_ROOT in vhost rewrite scenarios; this SHOULD leave shared installs working. 2012-04-11 21:02:24 +02:00
Ian d8bcff11a7 up-port 8d828e1 - check goodtoken while approving comments 2012-04-11 18:09:56 +02:00
Ian 3c7dfd935e upgrader.tpl - another small typo fix 2012-04-11 09:55:19 +02:00
Garvin Hicking e989cafe12 mysql, use myisam 2012-04-10 22:36:07 +02:00
Garvin Hicking b62c6072ed mysql, use myisam 2012-04-10 22:35:40 +02:00
Ian 92a19a968d fixed upgrader_return_here path message 2012-04-10 18:19:13 +02:00
Ian e32a5e7e46 upgrader.tpl purged another leftover 2012-04-10 17:21:16 +02:00
Ian c961f6b2cf upgrader another typo fix 2012-04-10 16:41:48 +02:00
Ian 1cf5309deb set correct version 2012-04-10 15:13:53 +02:00
Ian 278546d1c6 upgrader data['call_tasks'] fix 2012-04-10 14:48:50 +02:00
Ian bc8bab6100 upgrader fixed typo 2012-04-10 13:06:03 +02:00
Matthias Mees a2c1b1fe1f Updated 2k11 to v1.1.5. 2012-04-07 19:36:09 +02:00
Matthias Mees d3a6d2a50f Updated 2k11 to v1.1.5. 2012-04-07 19:33:40 +02:00
Ian 8eb13121a4 fixed defaultBaseURL in installer as follow-up commit c292bad 2012-04-07 11:03:04 +02:00
Ian 6bf43fa920 fixed defaultBaseURL in installer as follow-up commit c292bad 2012-04-07 10:55:23 +02:00
Ian a8c5418b2f fixed show installation errors 2012-04-04 11:20:34 +02:00
Ian f9d2eaade9 better OR 2012-03-27 13:33:00 +02:00
Ian 9065abdb98 smartify installer without fail ... :D 2012-03-27 13:00:37 +02:00
Ian 545b237894 hardcoded new markup serendipity_printConfigTemplate() & serendipity_printConfigJS() 2012-03-26 14:37:04 +02:00
Ian 92638f3426 installer and upgrader hardcoded markup notices (no fallback) 2012-03-26 14:28:49 +02:00
Matthias Mees b718e9714e Updated jQuery to 1.7.2. 2012-03-21 22:39:55 +01:00
Matthias Mees 73e8a9f928 Updated jQuery to 1.7.2. 2012-03-21 22:39:08 +01:00
Ian 8f7cfeebe0 ops :) 2012-03-21 19:22:01 +01:00
Ian 1fb5839047 installer.inc.tpl typo 2012-03-21 18:05:05 +01:00
Ian e04d5cba8d use already assigned get vars instead 2012-03-20 18:11:33 +01:00
Ian 1a007506d6 entries.inc fixed some more typos 2012-03-20 17:37:18 +01:00
Ian 50cec28c33 fixed entries 2012-03-20 16:18:13 +01:00
Ian cf3e9ee99e sorry, my fault - nested Smarty vars need double quotes - icons are back 2012-03-20 15:09:47 +01:00
Ian 7707c7762c avoid empty template display 2012-03-20 14:39:00 +01:00
onli e7dbdc28a7 installer.inc.php: fixed missing serendipity_smarty_init() 2012-03-17 15:33:58 +01:00
Matthias Mees b1ac65eaa4 Updated 2k11 to v1.1.3. 2012-03-15 13:20:44 +01:00
Matthias Mees f2a4a79663 Updated 2k11 to v1.1.3. 2012-03-15 13:17:26 +01:00
Ian 5e84e6a4d5 fixed smartification includement 2012-03-04 11:29:37 +01:00
Ian 8b1f3db442 installer needed smarty_framework 2012-03-04 08:52:52 +01:00
Ian c37f5bc357 wrong CVS header 2012-03-03 15:05:09 +01:00
onli 574a053e93 configuration.inc.tpl: fixed wrong foreach-syntax 2012-03-03 14:33:27 +01:00
onli a666e0d381 Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-03-03 13:23:04 +01:00
onli 52d954ca6d smartified configuration.inc.php 2012-03-03 13:22:40 +01:00
Ian 8fe4e41b5b Jón Gnarr fixed typo 2012-03-03 13:10:43 +01:00
Ian eb578a304f comments.inc, entries.inc, images.inc, upgrader.inc GET enhancements 2012-03-03 12:52:39 +01:00
Garvin Hicking e79176a622 Merge pull request #5 from jhamb/master
local dns cache for statistics plugin
2012-03-03 03:51:49 -08:00
Ian 5f6b48a9b5 comments.inc enhancements 2012-03-03 11:38:13 +01:00
Juri Hamburg 4ec6623ed2 declared resolvedHosts array and expand all TABs to spaces 2012-03-03 11:11:50 +01:00
Juri Hamburg df7366a453 cache resolved hosts locally 2012-03-02 22:45:39 +01:00
onli 8bf8b28885 plugins.inc.php: added missing setFormtoken() 2012-03-02 16:31:52 +01:00
onli 642e25aaed plugins.inc.php: added missing event-hook 2012-03-02 16:16:59 +01:00
onli 20d57a7f7d Merge branch '2.0' of github.com:s9y/Serendipity into 2.0 2012-03-02 15:40:23 +01:00
onli 38104f37e2 smartified plugins.nc.php 2012-03-02 15:39:58 +01:00
Ian 6bbcb9d964 Merge branch '2.0' of https://github.com/s9y/Serendipity into 2.0 2012-03-02 15:30:10 +01:00
Ian 35ce0408d9 smartified installer.inc 2012-03-02 15:29:41 +01:00
Ian 7689d4129f upgrader inc designer note 2012-03-02 15:27:22 +01:00
Grischa Brockhaus 8d828e1fc3 Ian's patch: check goodtoken instead of token while approving comments
via email link
2012-03-01 13:41:27 +01:00
Grischa Brockhaus 06f4ab7c3f comment approval was not working when done from email link 2012-03-01 03:37:17 +01:00
onli 12aad7b9d1 smartified import.inc.php 2012-02-29 14:33:23 +01:00
Ian 5986c9ce7e smartfied overview.inc 2012-02-29 11:37:08 +01:00
Ian 19fa553138 whitespace cleanup 2012-02-28 20:30:57 +01:00
Ian ea68e19044 tabs2spaces 2012-02-28 20:07:55 +01:00
Ian 40a3166472 smartified images.inc 2012-02-28 20:07:01 +01:00
Ian 3e192b0edd smartified upgrader.inc 2012-02-28 20:06:20 +01:00
Ian 60f2535597 smartified entries_overview.inc 2012-02-28 20:05:09 +01:00
onli 1e648e2bac smartified personal.inc.php 2012-02-26 13:41:11 +01:00
onli 4fb37b742d smartify user.inc.php 2012-02-21 16:49:18 +01:00
Matthias Mees 58607e1958 Oops. Forgot the new files in 2k11. 2012-02-21 08:51:48 +01:00
Matthias Mees 785d2c2712 Updated 2k11 to v1.1.2. 2012-02-21 08:46:17 +01:00
Ian 15368ef3b2 smarty 3.1.8 released - see changelog for details 2012-02-20 18:10:00 +01:00
Ian 6d6b286420 smarty 3.1.8 releases - see changelog 2012-02-20 18:06:30 +01:00
Ian 83ccfc55db entries.inc improvements 2012-02-20 12:15:03 +01:00
Ian 7e41ce666e (experimental) extended Smarty_Security's allowed php_functions array (backend entries.inc.tpl) 2012-02-20 10:31:38 +01:00
Ian 9163510905 entries tpl minor improvement and notes 2012-02-20 10:25:23 +01:00
Ian 4631e1728a smartified entries.inc
Well to be honest, I had to cheat a little bit and add two Serendipity API functions to the list of allowed php functions in smarty secure mode.
2012-02-19 20:55:46 +01:00
Ian 551863b640 fixed missing table 2012-02-19 20:46:26 +01:00
Ian 9293e0b333 smartified comments.inc and some minor fixes to other tpls 2012-02-19 15:35:05 +01:00
Ian 9a8a8f964b Revert "smartifying: template.inc.php, category.inc.php"
This reverts commit 55edda14bf.
2012-02-18 09:29:48 +01:00
Ian dd17a759c1 Revert "smartified export.inc.php"
This reverts commit e795e4b2ea.
2012-02-18 09:25:57 +01:00
Ian 1fc36abe56 Revert "smartified group.inc.php"
This reverts commit ff667b6617.
2012-02-18 09:25:10 +01:00
Vladimir Ajgl eb55f1c04d inebreaks converted from windows to unix style 2012-02-17 23:51:31 +01:00
Ian ba518b7864 use tpl dir and smarty3 short notation fetch() method 2012-02-17 18:33:10 +01:00
Ian 506652293e cleared whitespaces 2012-02-17 17:49:30 +01:00
onli ff667b6617 smartified group.inc.php 2012-02-17 16:40:23 +01:00
onli e795e4b2ea smartified export.inc.php 2012-02-17 13:27:06 +01:00
onli 55edda14bf smartifying: template.inc.php, category.inc.php 2012-02-16 20:00:08 +01:00
Ian 770f786720 en/de COMMENT_MODERATED lang changed 2012-02-15 12:41:36 +01:00
Ian 6d4bd49ac7 adding serendipity_db_bool to global emergency moderation 2012-02-13 11:46:26 +01:00
Ian bf3b1a05e8 spamblock 1.79 - killswitch check to verify_once 2012-02-13 11:12:10 +01:00
Matthias Mees 763d121b85 Updated 2k11 to v1.1.1. 2012-02-10 23:32:22 +01:00
Garvin Hicking 64d59d9b4c binary image 2012-02-08 15:15:58 +01:00
Garvin Hicking 356978af9a improved karma plugin 2012-02-08 15:15:58 +01:00
Garvin Hicking f16854859a improved karma plugin 2012-02-08 15:14:58 +01:00
onli a490e1e7a5 pdo was missing a global on db_begin/end_transaction() 2012-02-05 19:00:56 +01:00
Grischa Brockhaus 7db3f9ad19 plugin_comments: Added comment id to eventData for frontend display. 2012-02-03 14:10:31 +01:00
Ian 9c7f73a857 tab converting and parseTemplate() fix 2012-02-02 14:11:50 +01:00
Matthias Mees 9e4aba597b Updated 2k11 to v1.1. 2012-02-01 16:24:53 +01:00
Ian c9b1bfd5dd added this no_footer option to non-smartified backend too 2012-01-31 16:14:03 +01:00
Ian 162acc15ad added GET/POST noFooter option to backend
please allow this little tweak - it wont harm anybody ... ;-)
2012-01-31 16:09:31 +01:00
Matthias Mees e2c95b3904 Updated 2k11 to v1.0.9. 2012-01-30 01:39:04 +01:00
Ian 503c170ede update installer version need to PHP 5.2.6 2012-01-28 16:12:48 +01:00
Matthias Mees 40032c15e2 Updated 2k11 to 1.0.8. 2012-01-28 07:08:29 +01:00
Matthias Mees 5548e6531a Updated 2k11 to v1.0.7. 2012-01-27 17:40:32 +01:00
Grischa Brockhaus 92c4b0b4f6 Prevent adding trackbacks we already have, coming from the same URL and
pointing to the same article.
2012-01-25 13:39:27 +01:00
Matthias Mees a2404fb1b9 Updated 2k11 to 1.0.6. 2012-01-25 03:28:43 +01:00
Matthias Mees 695c1e7715 Updated 2k11 to v1.0.5. 2012-01-20 21:04:38 +01:00
Grischa Brockhaus f2c6b669ad Deny duplicate pingbacks and send message about new pingbacks found in
blog.
2012-01-17 12:55:09 +01:00
Ian 4822b3e7b8 added token to support the preview link in backend entries 2012-01-16 09:10:00 +01:00
Grischa Brockhaus 068837dce4 Update docs/NEWS 2012-01-09 12:58:16 +01:00
Grischa Brockhaus 54b5661f35 Update docs/NEWS 2012-01-09 12:57:52 +01:00
Vladimir Ajgl 7fc4979ff4 Update of czech translation and documentation 2012-01-08 21:00:49 +01:00
Matthias Mees ce92a306a2 Updated 2k11 to v1.0.4. 2012-01-06 18:38:00 +01:00
Garvin Hicking 38b3bb9c08 dutch translation update by eric 2012-01-06 10:49:11 +01:00
Grischa Brockhaus d3893904ed serendipity_fetchComments produced wrong SQL code, if $where and $limit
was set but $order don't
2012-01-04 00:12:12 +01:00
Grischa Brockhaus b14a75b28b Updated stable and beta version to 1.6 2012-01-03 22:24:32 +01:00
Ian 82481fc1cf added nl2br to smarty allowed php modifiers 2012-01-03 14:14:14 +01:00
Matthias Mees 2ca2410843 Updated 2k11 to v1.0.3. 2012-01-01 17:08:37 +01:00
Garvin Hicking 7641203b2e only a simple test commit 2012-01-01 16:55:35 +01:00
Garvin Hicking de6f589f96 The $goodtoken thing is important, as when this is used, the user is not logged in, and so the comment approval via token
would not work (at least this is how I read it, I didn't implement the token approval)
2011-12-31 15:10:00 +01:00
Grischa Brockhaus 5c062c4f0b serendipity_deleteComment: Check for adminEntriesMaintainOthers
Please check this patch if it is okay, Garvin. Else redo it.
Now only users owning the depending article or having
adminEntriesMaintainOthers are allowed to delete a comment.
2011-12-31 13:47:32 +01:00
Grischa Brockhaus 0fd5541e51 serendipity_approveComment:
Only allow the user to approve a comment, if
he owns the article or has adminEntriesMaintainOthers (or forced is
true). Please check this fix, if it is okay and redo if not.
2011-12-31 13:28:16 +01:00
Grischa Brockhaus b547d8d27e minifix (someone added a + in front of a comment) 2011-12-31 13:21:08 +01:00
Ian 09aace0ffe display back to fetch, as it was 2011-12-29 11:11:27 +01:00
Ian 4db3a08f19 corrected note typos and changed trigger_errors error LEVEL
back to Warning as before, which still is halted by the smarty error handler
2011-12-25 15:24:08 +01:00
Garvin Hicking 933c63c904 Allow plugins to use fetch() call without the need to do any weird security_settings[INCLUDE_ALL] redirections 2011-12-22 12:16:34 +01:00
Grischa Brockhaus 2f8601ee06 * bundled_libs, XML: Exchaned outdated PEAR version 1.4.0 with newest
version 1.5.5
* added some Eclipse related stuff as ignored
2011-12-22 01:01:23 +01:00
Garvin Hicking 59211ce36e Magic __set method to react to $serendipity['smarty']->security = false; which is the documented way in a template's config.inc.php to disable security in past s9y versions 2011-12-21 17:21:05 +01:00
Garvin Hicking bfea178fc4 Some plugins might needs this in the future 2011-12-21 09:16:37 +01:00
Ian d0889cbd3d upgrade to smarty 3.1.7 2011-12-20 12:11:58 +01:00
Matthias Mees 7e0d7a61d9 Some minor fixes for 2k11. 2011-12-16 21:27:53 +01:00
Garvin Hicking e25a70302d patch to handle files without extensions by Markus Brueckner 2011-12-14 11:49:06 +01:00
Garvin Hicking 5366865002 test 2011-12-14 09:25:59 +01:00
onli df7d1fcb73 bugfix: disappearing netries when title starting with a number and using no archive-prefix 2011-12-13 19:11:07 +01:00
Garvin Hicking 1bce14a668 github mirror 2011-12-13 13:56:46 +01:00
Garvin Hicking b52af01444 experimental github support (coming up, doesnt work yet) 2011-12-13 11:27:28 +01:00
Garvin Hicking 09370c78d0 german update by konrad bauckmeier 2011-12-12 14:44:20 +01:00
Garvin Hicking 6ad3797896 patch by hboeck for unique title of summary pages 2011-12-12 09:29:21 +01:00
Ian ee116ee460 some more tweaking to the errorToExceptionHandler 2011-12-08 19:21:24 +01:00
Matthias Mees e2f60038bb Even more last minute additions to 2k11. (You're welcome, Garvin.) 2011-12-07 16:49:57 +01:00
Ian c2afd4efc0 moved custom errorHandler to avoid XML Feed declaring and callback errors 2011-12-06 12:36:03 +01:00
Ian 637af26463 added PHP notice to NEWS
removed some very old tabs
2011-12-05 19:09:06 +01:00
Ian 75fafb6bd7 changed NEWS 2011-12-05 14:54:14 +01:00
Ian b56e45262a enhance error handler 2011-12-05 14:52:34 +01:00
Ian 7d9bf2e6c2 some doc cleanup in serendipity_smarty class 2011-12-05 13:12:17 +01:00
Matthias Mees 214018109d Updated 2k11 to latest snapshot. 2011-12-05 12:23:37 +01:00
Ian b5cefbedda populate NEWS with latest changes 2011-12-04 18:34:25 +01:00
Ian 4138bab0e8 set global errorToExceptionHandler 2011-12-04 17:57:25 +01:00
Ian fd0f634621 convert all $smarty->trigger_error() to native trigger_error()
with E_USER_ERROR set and
initialize the smarty object by instance
as always cleanup some tabs
2011-12-04 17:52:37 +01:00
Ian 0682560ad8 last modified and doc header for last commit 2011-12-04 17:38:29 +01:00
Ian 747f9b207a enhanced get smarty object by instance function 2011-12-04 17:25:59 +01:00
Ian b0377ef865 smarty compile dir - better exeption handler 2011-12-02 16:23:16 +01:00
Ian f890b4139a upgrade to Smarty-3.1.6 2011-12-01 17:04:13 +01:00
Ian 7e0cdf30af throw exeption instead of die() 2011-12-01 15:53:10 +01:00
Matthias Mees 2cc2b70f40 More last-minute updates to 2k11. 2011-12-01 13:28:07 +01:00
Ian b84a8ccb53 date & tabs to spaces 2011-12-01 11:09:09 +01:00
Matthias Mees 1743a7a18f Removed unnecessary assignment of constants to smarty variables. D'oh. 2011-12-01 10:13:26 +01:00
Matthias Mees 4cb2714995 Updated 2k11 to what I consider to be v1.0. Yay! 2011-11-30 22:35:16 +01:00
Ian dea13b461e some more caching docs in smarty class 2011-11-30 18:48:40 +01:00
Ian b2affab6b8 Merge remote-tracking branch 'origin/master'
Conflicts:
	include/serendipity_smarty_class.inc.php
2011-11-30 18:43:25 +01:00
Ian ebb8777932 some more caching docs in smarty clas 2011-11-30 18:40:28 +01:00
Ian 7fce1e47d8 S9y Smarty class: some more caching docs 2011-11-30 17:19:24 +01:00
Matthias Mees ce68df713b Updated 2k11 to latest development snapshot. 2011-11-30 07:55:11 +01:00
Ian 4bf5327c64 update spamblock wordfilter to function & updated NEWS 2011-11-29 16:19:12 +01:00
Ian 67af4b1f2b Merge remote-tracking branch 'origin/master' 2011-11-28 16:54:39 +01:00
Ian 465ff72ff2 updated NEWS 2011-11-28 16:51:48 +01:00
Matthias Mees 3ea71da4ba Lots of last-minute updates, fixes and feature requests ofr 2k11. 2011-11-28 15:59:35 +01:00
Ian 436cc20a0b comment todo added 2011-11-28 12:31:09 +01:00
Ian b7c43e5919 Merge remote-tracking branch 'origin/master' 2011-11-28 11:52:09 +01:00
Ian 83185e6f28 experimental smarty class - some cleanup and noting 2011-11-28 11:33:53 +01:00
Matthias Mees f57a5e5975 Added 2k11 to templates. 2011-11-28 07:44:46 +01:00
Ian 0f11ccc288 made backend comment (error) messages styleable
just as the others and added .serendipity_backend_msg_notice to add compat style modes to serendipityAdminMsgError
2011-11-25 16:42:02 +01:00
Ian 85610d925c nl2br - solved iso2br hook into serendipity_printEntryForm()
additional [NoBR] buttons added to templates/default/admin/entries.tpl
2011-11-25 10:51:15 +01:00
Garvin Hicking 000f77224c nl2br plugin by ophian 2011-11-24 12:21:40 +01:00
Garvin Hicking 2749dc54ad Smarty3 2011-11-24 12:16:02 +01:00
Garvin Hicking 23e5de77b7 merge Smarty3 by ophian 2011-11-24 12:14:03 +01:00
Matthias Mees ebe6d10848 Upgraded jQuery to 1.7.1. 2011-11-22 04:06:59 +01:00
Matthias Mees 3d4e3e92c0 Updated bundled jQuery to 1.7. 2011-11-04 01:46:33 +01:00
Garvin Hicking e8cacdcfdd (backport)
Fix a situation where globally stored template variables do not get preference over local (old) ones
	docs/NEWS
2011-11-03 17:06:14 +01:00
Garvin Hicking abed371df2 added some stuff to exclude list 2011-11-02 10:33:26 +01:00
Garvin Hicking f0b07cbf58 backport (there's gotta be an easier way than this) 2011-10-27 22:32:32 +02:00
Garvin Hicking 34f2b917e5 Merge branch 'master' of github.com:s9y/Serendipity 2011-10-27 22:27:21 +02:00
Garvin Hicking d8a1c47dd4 removed unneccessary line 2011-10-27 22:26:28 +02:00
Garvin Hicking 5eac2c50fa gitignore commit, test from a remote pc 2011-10-27 19:09:19 +02:00
Garvin Hicking db590df608 document 2011-10-27 13:29:14 +02:00
Garvin Hicking e67380e24d Merge branch 'master' of github.com:s9y/Serendipity
Conflicts:
	README.markdown
2011-10-24 18:29:54 +02:00
Matthias Mees 683c38d8ce Master branch test. 2011-10-05 20:11:36 +02:00
Matthias Mees aafc819851 Merge remote-tracking branch 'origin/master' 2011-10-05 20:01:25 +02:00
Garvin Hicking ada1351a03 Testing mail notify 2011-10-05 17:53:32 +02:00
Garvin Hicking 000a885b3c Testing mail notifiy 2011-10-05 17:52:10 +02:00
Matthias Mees 472acac202 Merge branch 'master' of github.com:s9y/Serendipity 2011-10-05 15:05:59 +02:00
Matthias Mees 385e832e22 Structuring, sir. 2011-10-05 15:05:00 +02:00
Garvin Hicking 23f5983a46 removed testfile 2011-10-05 15:03:56 +02:00
Garvin Hicking 2782731d49 added binary file for testing 2011-10-05 15:02:50 +02:00
Garvin Hicking bd3214a0f4 Master of disaster. 2011-10-05 15:01:51 +02:00
Matthias Mees 48334a378d Small README. 2011-10-05 14:38:19 +02:00
Matthias Mees 22889910ae Initial commit. 2011-10-05 14:37:07 +02:00
Garvin Hicking 58c1d4b39e update translation 2011-09-29 09:26:08 +00:00
Garvin Hicking c292badf30 * Added new serendipity['defaultBaseURL'] variable that makes sure
that the baseURL is not overriden when configuring serendipity
      with a possibly autodetected currentl URL. Patch by Manko10.
2011-09-28 12:03:28 +00:00
Garvin Hicking 56041459b6 backport 2011-09-28 11:39:09 +00:00
Garvin Hicking 7d7a1aadee nav amount fix 2011-09-28 10:29:15 +00:00
Garvin Hicking ebaa8afe04 patch by ian 2011-09-28 09:19:05 +00:00
Garvin Hicking 3eee3e4cd7 Do not add :443 to HTTPS connections 2011-09-26 09:14:21 +00:00
Garvin Hicking a7861fabd3 backport 2011-09-23 12:33:10 +00:00
Garvin Hicking 1f037b4627 remove html comment 2011-09-22 12:28:52 +00:00
Matthias Mees 44140cda6b Upgraded bundled jQuery to v1.6.4. 2011-09-13 18:13:59 +00:00
Garvin Hicking d405035d40 fix for autosave 2011-09-09 09:24:23 +00:00
Matthias Mees d83bb9fe16 Upgraded bundled jQuery library to 1.6.3 (trunk, 1.6 branch). 2011-09-01 19:13:17 +00:00
Garvin Hicking 7fa9ecde6d IE6 is dead 2011-08-13 09:55:33 +00:00
Matthias Mees 0b82cb6b67 Removed alt attribute from quicksearch input elements. It's pointless now and will be invalid in HTML5. 2011-07-23 04:42:02 +00:00
Matthias Mees 223ea07810 Ugraded jQuery to v1.6.2. 2011-07-21 20:10:20 +00:00
Garvin Hicking 2916a08510 patch by ian 2011-07-21 12:18:39 +00:00
Garvin Hicking 3030b3a491 1..7 prep 2011-07-19 19:14:58 +00:00
Garvin Hicking 22c6f6720b properly use windows replacements, by timbalu 2011-07-11 06:14:12 +00:00
Vladimir Ajgl 2f413e13c2 Added czech documentation 2011-07-10 15:18:09 +00:00
Garvin Hicking 99b8830a3c * Fixed Spartauc SF.Net download location (Thanks to christian_boltz) 2011-06-27 09:39:25 +00:00
Garvin Hicking 27fc503dac calarification about ports 2011-05-31 14:07:23 +00:00
Garvin Hicking 187941aac6 * Added new event hook 'backend_loginfail' to track failed logins
(serendipity_event_externalauth can make use of it for fail2ban)
2011-05-31 14:02:02 +00:00
Matthias Mees 272e55b943 Updated bundled jQuery to 1.6.1. 2011-05-17 10:18:09 +00:00
Garvin Hicking 139db16e5a better abstract 2011-05-16 07:45:57 +00:00
Garvin Hicking f59d157fc6 date zone 2011-05-10 12:51:30 +00:00
Garvin Hicking 18ff07d7ce allow to insert files with differing extension but same basename and mimetype 2011-04-21 15:07:33 +00:00
Matthias Mees 288c937f60 Fixed a minor bug in style_fallback.css. 1996 called and wanted it's font-size in pt back. 2011-04-20 08:55:43 +00:00
Vladimir Ajgl 94b6985f84 Update of czech translation files 2011-04-17 13:19:24 +00:00
Garvin Hicking cdb1a830c3 . 2011-04-11 12:45:26 +00:00
Garvin Hicking e1789fa02f . 2011-04-11 12:40:15 +00:00
Garvin Hicking defb3ff1fd * show subscription status of comments in frontend and backend 2011-04-11 12:35:40 +00:00
Garvin Hicking c4e35b58fa * Added ability to report spam/ham to akismet (Black Warthog) 2011-04-11 07:34:37 +00:00
Garvin Hicking d11eae57cd Made commentor URLs add http:// if missing 2011-03-31 11:49:11 +00:00
Garvin Hicking 741994a06b hide mails by default 2011-03-31 11:37:57 +00:00
Garvin Hicking d65692b9a1 document 2011-03-22 09:14:57 +00:00
Garvin Hicking af040ea24f * Added localization for {$WEBLOG} in trackbacks.tpl (LazyBadger) 2011-03-22 09:14:30 +00:00
Vladimir Ajgl 3e30f913ce Update of czech translation files for karma plugin 2011-03-09 21:10:32 +00:00
Garvin Hicking 40116e3802 karma plugin update 2011-03-09 11:11:14 +00:00
Garvin Hicking 21ff71abd2 smarty3 compat 2011-02-17 13:11:25 +00:00
Garvin Hicking eb47f799b7 adjust admin permalink, t hanks to lux 2011-01-26 09:26:36 +00:00
Tadashi Jokagi 5063ea1cab * translation updated. 2011-01-22 16:21:02 +00:00
Garvin Hicking 712b43de77 * serendipity_event_mailer now also allows to use commas instead of
spaces to seperate multiple mails. Use distinct email adresses
      (Thanks to evanslee)
2011-01-21 10:35:33 +00:00
Garvin Hicking 77b3d2cfa0 remove 2011-01-17 12:51:35 +00:00
Garvin Hicking a0f2b0b1fd new mod rewrite option 2011-01-15 13:32:59 +00:00
Vladimir Ajgl f50237dab4 Update of czech translation for bulletproof theme and system language file 2011-01-11 21:17:07 +00:00
Garvin Hicking 0bec630e0a we don't need no
need no bright hashs
i'm a rockstar.
2011-01-10 11:27:32 +00:00
Garvin Hicking 13ff56ad4a proper logic 2011-01-08 22:33:12 +00:00
Garvin Hicking 70b1288890 improve code docs 2011-01-08 22:31:20 +00:00
Garvin Hicking bf39c311a3 sqlite both/assoc/num fix 2011-01-07 10:41:06 +00:00
Garvin Hicking 334e7a9ba6 smarty3 prep 2011-01-07 10:21:02 +00:00
Garvin Hicking fd480a58d4 smarty3 compat 2011-01-06 17:46:43 +00:00
Garvin Hicking ada93a01c5 tpl fixes for smarty3, thanks to timbalu 2011-01-06 12:12:47 +00:00
Garvin Hicking bd0d0b7bc0 . 2011-01-03 15:11:30 +00:00
Garvin Hicking 8420699997 template and plugin option groups, experimental 2011-01-03 09:11:17 +00:00
Tadashi Jokagi 01bb87240e * translation updated. 2011-01-02 19:24:58 +00:00
Garvin Hicking 49bff3f7a7 better forwarc ompatibility, using an arrayk 2011-01-02 16:50:48 +00:00
Garvin Hicking b448739802 Add new parameter "empty" to {serendipity_showPlugin} 2010-12-31 18:00:43 +00:00
Garvin Hicking cbc46a31e1 bundle jquery 2010-12-31 17:29:51 +00:00
Garvin Hicking 429f9aff34 xinha security issue, temporarily disabled all PHP plugins 2010-12-21 19:46:29 +00:00
Garvin Hicking e46563693c missing commit 2010-12-21 19:41:19 +00:00
Garvin Hicking aca4ba7d60 allow to mass-moderate comments 2010-12-16 08:51:54 +00:00
Garvin Hicking afc4c997d3 Allow to pass 'template' variable to serendipity_showPlugin 2010-11-29 16:53:25 +00:00
Garvin Hicking 320276fcbc compatibility for 1&1 servers 2010-11-16 11:46:34 +00:00
Garvin Hicking 43681920a0 fix typo 2010-11-08 11:42:43 +00:00
Garvin Hicking 1a8f5b15c8 better check, thanks to timbalu 2010-10-19 10:18:59 +00:00
Vladimir Ajgl b7dff39d5d Update of czech language files, czech documentation added 2010-10-12 20:39:24 +00:00
Garvin Hicking b8bbc3c1ed patch by onli 2010-10-12 12:40:32 +00:00
Garvin Hicking aba04f43b4 * PDO-SQLite patches by nth 2010-10-12 12:38:13 +00:00
Garvin Hicking bf36e96f61 upstream 2010-10-12 12:17:13 +00:00
Garvin Hicking 58afae0cb0 fix xml newline 2010-10-07 08:43:53 +00:00
Garvin Hicking 4bc5286c75 upstream 2010-10-04 08:45:04 +00:00
Vladimir Ajgl d637079a4a Update of czech translation of main s9y language file 2010-09-28 08:50:36 +00:00
Garvin Hicking 51208e0f72 * Only do '*' parameter expansion on the first page of search
results: http://board.s9y.org/viewtopic.php?f=10&t=14810
      (onli, Timbalu)
2010-09-27 08:33:40 +00:00
Garvin Hicking b65b6e407c supersedes fix 2010-09-22 07:56:49 +00:00
Garvin Hicking f5e7c96822 date 2010-09-20 10:29:45 +00:00
Matthias Mees c4c2e95010 Removed redundant line in BP's entries.tpl. 2010-09-15 06:48:26 +00:00
Matthias Mees 190468dd53 Added fix for German umlauts in BP pagination. (Thanks to Timbalu.) 2010-09-15 06:46:04 +00:00
Garvin Hicking 4b590b202e * RSS feed timestamp properly calculates offset (abdussamad) 2010-08-30 09:01:00 +00:00
Garvin Hicking c32f99f68a . 2010-08-27 09:36:30 +00:00
Garvin Hicking 14d45150fb upcoming advisory, prepare 2010-08-26 16:03:16 +00:00
Garvin Hicking 47075eaf95 backport 2010-08-26 15:49:12 +00:00
Garvin Hicking ceecc3f256 html fix 2010-08-26 15:48:31 +00:00
Garvin Hicking ee580791bf proper IS NULL 2010-08-24 09:45:46 +00:00
Garvin Hicking f9fa8503f0 (experimental) global theme options 2010-08-24 08:45:09 +00:00
Garvin Hicking a7b27ff06a tweak to support multiple engine: in info.txt of templates 2010-08-23 19:06:17 +00:00
Don Chambers 1dcda4f0a7 BP: add colorset logic to conditionally emit colorset style sheet necessary for child themes. 2010-08-21 21:21:23 +00:00
Garvin Hicking c12f676940 just to be sure 2010-08-20 12:57:45 +00:00
Garvin Hicking 8ca7f04b8f * Implemented suggestion of removing boilerplate code in plugin API:
Change hack protection, introduce unified language loading, see
      http://board.s9y.org/viewtopic.php?f=11&t=16921
      Thanks to mt2!
2010-08-20 09:07:42 +00:00
Garvin Hicking 4914b3f708 . 2010-08-12 22:38:04 +00:00
Garvin Hicking 38e4f719fe Fix PHP 5.3.2 parse error in a file, thanks to fyremoon 2010-07-24 22:23:49 +00:00
Garvin Hicking 0eb2d01132 * Include license output in plugin listing (onli) 2010-06-27 17:51:48 +00:00
Garvin Hicking 1a1e92a86a * Fix karma rating plugin missing the text translation for a
specific point area
2010-05-26 13:46:48 +00:00
Garvin Hicking 779bccd819 multilingual titles 2010-05-26 13:37:27 +00:00
Garvin Hicking 302d67b224 patch by konus, include referer 2010-05-17 07:43:35 +00:00
Garvin Hicking 03efc3e842 bump 2010-05-10 10:31:28 +00:00
Garvin Hicking e6d6b43e88 xinha issue, by stefan esser 2010-05-10 06:37:54 +00:00
Garvin Hicking 6836ebbf28 improved patch 2010-05-10 06:36:21 +00:00
Garvin Hicking dadc2b6ee4 2010-05-10 05:59:37 +00:00
Garvin Hicking 0575e40742 2010-05-10 05:53:55 +00:00
Vladimir Ajgl db255b09b8 Update of czech translation of main s9y language file 2010-05-03 17:31:08 +00:00
Garvin Hicking d20ccc8b34 Revert accidental change 2010-05-03 08:58:35 +00:00
Matthias Mees 1d4db5c8f6 BP: Added CSS to not indent dd elements in new entries summary definition list. 2010-05-02 20:47:48 +00:00
Matthias Mees f65b4f34c6 BP: Edited entries_summary.tpl to generate a valid definition list in XHTML. 2010-05-02 08:53:59 +00:00
Garvin Hicking dc1da7b3d4 new lang constant SEARCH_FULLENTRY 2010-04-30 11:03:36 +00:00
Garvin Hicking 1e2fa250c3 * Added new 'fulltext' search option to sidebar plugin
http://board.s9y.org/viewtopic.php?f=4&t=16051
2010-04-30 08:13:30 +00:00
Garvin Hicking 76e8d73b27 * Fix SQL query statement for deleting a category, which on some
DB types (SQlite) might not return "true" and thus not really
      delete the category. (garvinhicking)
2010-04-27 07:57:04 +00:00
Garvin Hicking ed9bc8d88c apply also to trackurl 2010-03-30 11:24:12 +00:00
Garvin Hicking 9aff2df847 truncate to 255 2010-03-30 10:47:15 +00:00
Garvin Hicking 36f955285e fix ategory for pathnames startin gwith a number 2010-03-26 13:55:04 +00:00
Garvin Hicking 2ecf7fbba2 another bug bites the dust. hopefully. 2010-03-13 20:20:29 +00:00
Garvin Hicking eacc4622ff SQL fix for duplucate alias 2010-03-13 08:45:30 +00:00
Garvin Hicking 77bf3eae79 better patch 2010-03-11 09:14:42 +00:00
Garvin Hicking a39785766c * Fix SQLite substring search to use % instead of * for secondary
matches (SvOlli)
2010-03-10 12:37:19 +00:00
Garvin Hicking 3a2694461e disable youtube by default
http://board.s9y.org/posting.php?mode=quote&f=2&p=94277
2010-03-09 13:18:41 +00:00
Garvin Hicking 6b57d56d42 categoryid enhancement 2010-03-03 10:46:12 +00:00
Tadashi Jokagi 079eea41ae * updated. 2010-02-28 19:27:58 +00:00
Garvin Hicking c6b40493dc add padding 2010-02-17 10:33:48 +00:00
Garvin Hicking f043e8e8dd sqlite3 strict check 2010-02-16 13:06:44 +00:00
Vladimir Ajgl 74b92f1c88 Update of czech translation of main s9y language file 2010-02-14 12:30:12 +00:00
Garvin Hicking 958c4c87ea * Experimental: When sending quoted-printable notification mails,
auto-split after 75 characters.
      (Ref: http://board.s9y.org/viewtopic.php?f=3&t=16314)
2010-01-27 15:04:17 +00:00
Garvin Hicking 7d097ab317 Add RFC auto-submitted header
(http://www.iana.org/assignments/auto-submitted-keywords/auto-submitted-keywords.xhtml)
(http://board.s9y.org/posting.php?mode=quote&f=3&p=93402)
2010-01-27 13:33:34 +00:00
Garvin Hicking 47f15304ce for new installations, also make entryproperties a LONGTEXT.
If that goes out well, we'll put that into the upgrader.
2010-01-27 10:35:29 +00:00
Garvin Hicking 55e85b5f41 patch by onli to support plugin channel data 2010-01-21 09:20:41 +00:00
Garvin Hicking 757c557b6b * To support custom PHP sessions, s9y will only issue session_start,
if no session exists yet (garvinhicking)
2010-01-20 09:45:48 +00:00
Garvin Hicking d29998d65e * Fix escaping when using ImageMagick to create PDF-thumbnail images
(stm9x9)
2010-01-19 09:47:52 +00:00
Garvin Hicking 53159f390f * Use "Longtext" instead of "text" for new installations on blog entry
body and extended body inside database tables. (garvinhicking)
2010-01-14 09:21:07 +00:00
Garvin Hicking 316e86f3dc * Added ability to mark authorgroups as "hidden", so that members of such groups are excluded from common author listings. (Ref http://board.s9y.org/viewtopic.php?f=11&t=16237) (garvinhicking) 2010-01-13 12:28:55 +00:00
Garvin Hicking 456423e040 language string update 2010-01-13 12:25:58 +00:00
Garvin Hicking ef3271c26c SMF importer, uses tags now 2010-01-13 12:24:48 +00:00
Garvin Hicking cd73303500 fixed history plugin for " output 2009-12-23 14:30:57 +00:00
Garvin Hicking ed3b052af2 x 2009-12-23 14:01:11 +00:00
Garvin Hicking 8735d3cb46 fix bad sql upgrade 2009-12-23 13:57:59 +00:00
Garvin Hicking 4e9fcf7696 backport 2009-12-21 18:56:34 +00:00
Garvin Hicking 841c5646ba version 2009-12-21 06:34:21 +00:00
Garvin Hicking 6819335e1f . 2009-12-21 06:32:16 +00:00
Garvin Hicking 6bb6a39d25 new event hook 2009-12-20 17:51:22 +00:00
Garvin Hicking 5f9b465d46 * Upgraded to PEAR Cache_Lite 1.7.8 2009-12-10 12:42:18 +00:00
Garvin Hicking 414ce21c0f * Show backend comment pagination in footer and header 2009-12-08 14:03:57 +00:00
Garvin Hicking f6909f5aa1 ifmodule check 2009-12-08 13:48:29 +00:00
Garvin Hicking c1f7983a81 * Added experimental global variable $i18n_filename_utf8 that can
be set in a serendipity_config_local.inc.php or language include
      file, which will return Unicode-Permalinks.
      (http://board.s9y.org/viewtopic.php?f=11&t=15896)
2009-12-08 13:32:05 +00:00
Garvin Hicking a292a52c96 trunk update to 1.6 2009-12-08 13:19:25 +00:00
Garvin Hicking ba5bb5debc * Don't toggle the border of marked comments in the admin section
to 2px, to avoid padding. Thanks to hboeck!
2009-12-08 13:09:21 +00:00
Garvin Hicking c401b02abe * Added expermiantel PDO::SQLite transport, by nth 2009-11-28 12:27:42 +00:00
Garvin Hicking 405ac6baa2 missing varname 2009-11-25 20:41:43 +00:00
Jude Anthony ba8e0e346c Include serendipity_emit_htmlarea_code for HTML template options 2009-11-25 20:01:13 +00:00
Garvin Hicking 2796d24b34 * Disallow uploading any files with ".php." in the filename
+      (garvinhicking)
2009-11-16 12:30:30 +00:00
Matthias Mees 2512cc60b2 Fixed a tiny typo in serendipity_event_entryproperties -- a class was called entyproperties in the plugin options. 2009-11-01 23:19:24 +00:00
Garvin Hicking 0f118e91c3 fix pagination 2009-10-29 18:18:44 +00:00
Garvin Hicking 5e0f013e49 * Prevent password autocompletion for user passwords to prevent
possible mismatch. In media manager popup, fix bug that did
      not properly forward to image selection after upload (onli)
2009-10-27 09:08:48 +00:00
Don Chambers e46df53f8b bp: slight mod to css for images inserted via media manager now that editor.js no longer inserts styles. 2009-10-23 19:22:01 +00:00
Matthias Mees 904967fe59 Added some additional inline CSS to include/funtions_plugins_admin.inc.php to make sure images selected from the media db in theme option don't get tiled. 2009-10-12 11:14:20 +00:00
Matthias Mees e3366df7f4 Added no-repeat to background images set by change_preview in include/functions_plugins_admin.inc.php so images selected from the media database in theme options will no longer be tiled. 2009-10-12 10:58:30 +00:00
Garvin Hicking 89974bc7ae * Fix a bug in statistics output, when statistics for single-number
months is created. (Andreas Bilke)
2009-10-09 13:02:41 +00:00
Garvin Hicking 18e02a5452 * Alwys increase last_modified when an entry is saved to prevent
stale entries in RSS feeds. Thanks to Cenic
2009-10-06 09:27:55 +00:00
Garvin Hicking 0149a2dc64 * Allow comment sidebar plugin to only show coments for entries
that are allowed to be viewed by the current visitor.
2009-09-21 09:12:59 +00:00
Garvin Hicking 5630afb7c1 * Do not send mails, if the "To:" address is empty, might happen
if authors do not have a mail account entered in their profile.
      (nealk)
2009-09-21 08:11:35 +00:00
Garvin Hicking a9243aad3e * Also use htmlspecialchars() for the Recent Entries sidebar plugin
(Anson)
2009-09-21 08:09:50 +00:00
Garvin Hicking b266d3b3b4 * PostgreSQL compatibility for the printArchives() function to
gather only unique timestamps (cite)
2009-09-12 11:18:28 +00:00
Garvin Hicking 47aa8c2f72 ereg() replacement 2009-09-04 08:51:16 +00:00
Garvin Hicking 541254e85c credits 2009-08-27 13:32:12 +00:00
Garvin Hicking 5aa7eb721a * Fixed Spartacus download URLs for SF.Net mirror 2009-08-27 13:23:50 +00:00
Garvin Hicking 56f592a5cd disable temporary mirrors 2009-08-27 13:20:59 +00:00
Garvin Hicking ea610fc67b infrastruct 2009-08-26 13:13:46 +00:00
Garvin Hicking 275589423a * More PHP 5.3.0 compat (split()). 2009-08-25 19:39:17 +00:00
Vladimir Ajgl 6407727fe6 Update of czech translation of main s9y language file 2009-08-25 18:36:43 +00:00
Garvin Hicking db2ad9402a * Allow to define sort order for search-results (garvinhicking) 2009-08-24 08:24:19 +00:00
Garvin Hicking be6a1f7964 * Allow redirects when fetching remote images (garvinhicking) 2009-08-24 08:06:34 +00:00
Garvin Hicking 10cde4adeb beta2? might not be needed though. 2009-08-24 07:59:09 +00:00
Garvin Hicking ddf9448daf prepare beta 2009-08-24 07:18:41 +00:00
Garvin Hicking 589b92bd7c no short open tags req 2009-08-21 12:24:13 +00:00
Garvin Hicking 4e258686fb Remove eregi calls 2009-08-21 12:22:35 +00:00
Garvin Hicking 3a77f13428 * PHP 5.3.0 compatibility without E_WARNING triggers (garvinhicking) 2009-08-21 08:52:50 +00:00
Garvin Hicking 6e8f54f588 * Added 'orderby' parameter to plugin API hooks for the serendipity
fulltext search function (garvinhicking)
2009-08-21 08:09:52 +00:00
Vladimir Ajgl 36be598dc1 Fix of badly formated language files 2009-08-15 08:38:47 +00:00
Vladimir Ajgl 7d7cce9f37 Czech translations for "kubrick" template added. 2009-08-15 07:41:48 +00:00
Garvin Hicking 93802dbf95 Patch by paddyforan to allow overwrite of this arrey value 2009-08-14 11:06:36 +00:00
Vladimir Ajgl d1500a6c6b Update of czech translation files for plugins, bulletproof theme and system language file 2009-08-12 20:58:39 +00:00
Garvin Hicking 7d0547c0d4 * Added new event hook frontend_sidebar_plugins to iterate through
sidebar plugins and modify their output. $eventData is the array
      of their data. (garvinhicking)
2009-08-11 19:53:10 +00:00
Garvin Hicking 03825cab5f Add version pointer 2009-08-06 08:39:23 +00:00
Garvin Hicking 81f08a5cb0 Spelling error of the toolbar name 2009-07-28 12:04:07 +00:00
Garvin Hicking ab8324143f Proper plugin loading 2009-07-28 10:19:38 +00:00
Garvin Hicking ee102b4402 * Removed "static" db layer typelist to prevent accidental over-
writes of referenced return values (garvinhicking)
2009-07-27 09:52:13 +00:00
Garvin Hicking 6d90049416 Added possibility to customize the xinha editor through a my_custom.js
file. See http://board.s9y.org/viewtopic.php?f=4&t=15286
2009-07-27 08:47:47 +00:00
Don Chambers c6f02b6efc Corrected typo - span was closed before inline style declared for "unmet requirements". 2009-07-17 21:24:39 +00:00
Grischa Brockhaus b5793aeb06 2009-07-15 10:57:58 +00:00
Grischa Brockhaus 07c12ca516 * Commented out DEBUG logs of Akismet, that blow up the spamblocklog table
* Reporting of correct comment type for Akismet calls (pingback or trackback)
2009-07-15 10:57:42 +00:00
Grischa Brockhaus b538d65244 added input_type="password" for plugin string type configuration 2009-07-15 10:49:16 +00:00
Grischa Brockhaus c0f5343051 added input_type="password" for plugin string type configuration 2009-07-15 10:46:39 +00:00
Garvin Hicking 249580a5b9 PHP 5.3 compatibility 2009-07-14 11:48:10 +00:00
Garvin Hicking 677df54625 PHP 5.3 compatibility, upgrade Smarty to 2.6.26 2009-07-14 11:40:16 +00:00
Matthias Mees a1388d2f15 Saved a few bytes in templates/default/style_fallback.css :) 2009-07-14 10:22:03 +00:00
Garvin Hicking 7745c93488 Better identify scrollPos 2009-07-14 10:14:46 +00:00
Garvin Hicking baa78326d6 Also 'title' attribute is nice. 2009-07-14 09:40:11 +00:00
Garvin Hicking 97710fe021 * Removed inline styles of the s9y media insertion, they will now
properly utilize CSS classes (defined in the new file
      style_fallback.css). Also added support for entering "ALT"
      attributes to an <img> tag, can be used as a media property if
      you add "ALT" to the list of "Media properties" in the
      main configuration. (garvinhicking)
2009-07-14 09:22:06 +00:00
Garvin Hicking 796e7ff96a * Filter entries only by authors that have written at least
one article (garvinhicking)
2009-07-10 15:45:18 +00:00
Garvin Hicking 480be20fb6 * Fix PDF imagemagick thumbnail generation to be properly displayed
(http://board.s9y.org/viewtopic.php?f=3&t=15446)
2009-07-10 14:18:04 +00:00
Garvin Hicking 3faaa663db Add check for "plugins" directory writability 2009-07-10 13:50:13 +00:00
Grischa Brockhaus c589517516 Added "exclude urls" to ip validation functionality in spam block plugin. identi.ca is sending pingbacks but fails the ip validation!
(there were a bug in the prior commit.. :-/)
2009-07-05 15:15:10 +00:00
Grischa Brockhaus 49e4b26c7e Added new optional parameter for plugin config type "text": rows. 2009-07-05 14:59:30 +00:00
Grischa Brockhaus d9b0ccb3f4 Added new optional parameter for plugin config type "text": rows. 2009-07-05 14:58:31 +00:00
Grischa Brockhaus e853839403 pingbacks were not counted as entry trackbacks (also added to entries) 2009-07-04 01:38:28 +00:00
Grischa Brockhaus 388e5c3d21 pingbacks were not counted as entry trackbacks (also added to entries) 2009-07-04 01:37:47 +00:00
Grischa Brockhaus 45c300afd5 Added "exclude urls" to ip validation functionality in spam block plugin. identi.ca is sending pingbacks but fails the ip validation! 2009-07-04 00:16:18 +00:00
Garvin Hicking f2dee79592 fix parse error 2009-07-03 11:58:50 +00:00
Garvin Hicking 29601b1869 * no longer use htmlspecialchars() on the blog's title and sub-
title, to allow for custom HTML code to appear and unify
      only letting Smarty do the escaping (garvinhicking,falk)
2009-07-03 06:08:08 +00:00
Grischa Brockhaus 30c5d67934 plugin_comment displays trackbacks *and* pingbacks in trackback only mode now. 2009-07-01 11:50:51 +00:00
Matthias Mees 10f3cf17f7 BP: Tweaked plugin_calendar.tpl to use date format set in theme options for display of #today. 2009-06-30 12:59:41 +00:00
Matthias Mees 3281509798 BP: Removed unused variable from lang files. (Ooops.) 2009-06-29 14:29:53 +00:00
Garvin Hicking 79c98feb26 Proper variable referencing to make the 'entry_groupdata' hook work 2009-06-28 16:44:43 +00:00
Garvin Hicking c2fd64dcf0 proper parameter by stm9x9 2009-06-26 21:39:27 +00:00
Garvin Hicking d98bbf1c1e add config option 2009-06-23 13:51:26 +00:00
Garvin Hicking 77f9542ac9 temporary hack to log queries 2009-06-17 12:15:37 +00:00
Garvin Hicking c6e2ffe0a7 * Plugin drag/drop now can scroll up/down/left/right when touching
the borders. Thanks to onli!
2009-06-15 09:49:47 +00:00
Garvin Hicking 450ab08732 language update by konus 2009-06-15 09:26:05 +00:00
Garvin Hicking 1924221ef6 Language update by konus 2009-06-15 09:19:59 +00:00
Grischa Brockhaus e7bf4340a5 Fix urls with invalid cased protocol part while displaying entry comments. 2009-06-12 12:13:34 +00:00
Grischa Brockhaus 0c44ed6429 Fix urls with invalid cased protocol part while displaying entry comments. 2009-06-12 11:57:14 +00:00
Garvin Hicking 9675b30fa3 API improvement, prpoerly store entry reference in printentries, and
save cid for api hook
2009-06-11 15:38:22 +00:00
Garvin Hicking 1943a9b2bb Specific php session checks, if a session has already been issued. 2009-06-11 12:14:15 +00:00
Matthias Mees 6f434aa3c0 BP: Fix for display of unordered and ordered lists in entries together with ThickBox. Updated info.txt since Don keeps forgetting to do so ;-) 2009-06-05 14:33:07 +00:00
Grischa Brockhaus a66fd21893 Better error message for having problems while including files. (using language entry for it now) 2009-06-02 12:49:26 +00:00
Grischa Brockhaus 31c42d9704 Better error message for having problems while including files. 2009-06-02 12:36:39 +00:00
Grischa Brockhaus 3174dcf7d9 shoutbox plugin: Wrong description for dateformat fixed. 2009-06-01 03:31:13 +00:00
Grischa Brockhaus 712bcb5a29 Changed shoutbox plugin. Shoutbox input size is configurable now. 2009-06-01 02:36:52 +00:00
Garvin Hicking cd3cee1e1b * Change mail entry plugin to be able to send mails without
hyperlinks and images. (garvinhicking)
2009-05-29 13:23:31 +00:00
Garvin Hicking be0bdd9cf6 * Change uriArgument parsing routine to allow "!" in URLs.
Now we can have absolute serocracy.
2009-05-28 08:34:52 +00:00
Don Chambers 876a15980b BP: update entries.tpl to use latest version of AddThis script. 2009-05-27 19:03:23 +00:00
Garvin Hicking 8dd473ece2 forward to media pane, patch by onlin 2009-05-26 09:54:57 +00:00
Garvin Hicking 4940f9d0b5 Use proper path for bundled plugins to point to NEWS/ChangeLog 2009-05-25 07:37:57 +00:00
Ivan Cenov 56e69bd686 1) BG translation of new texts constants. 2009-05-24 07:42:36 +00:00
Garvin Hicking fc9048397e Patch by only to allow custom titles for the admin backend 2009-05-22 08:20:51 +00:00
Garvin Hicking 49811d0f25 typo fix by christian boltz 2009-05-20 11:51:37 +00:00
Garvin Hicking 24baf9237c fix parse error 2009-05-18 08:23:45 +00:00
Don Chambers 955dfbfc21 Default Template: Add doctype and <html> to preview_iframe.tpl so preview looks identical to published entry (just like BP). 2009-05-06 14:17:18 +00:00
Don Chambers b465b9a494 BP: Add doctype and <html> to preview_iframe.tpl so preview looks identical to published entry. 2009-05-05 14:48:11 +00:00
Garvin Hicking 851f2b2650 Allow to use UTC timezone offset ,by Abdussamad 2009-05-05 10:27:08 +00:00
Garvin Hicking dffee91667 Allow scrolling in bookmarklet-spawned window 2009-05-04 08:33:50 +00:00
Don Chambers 717f8d4163 BP: Change skiplink archive URL to {$serendipityArchiveURL} 2009-04-23 14:08:09 +00:00
Garvin Hicking 9fbe9f7b7c adjust session name, thanks to DrNI and kleinerChemiker 2009-04-23 13:40:47 +00:00
Garvin Hicking ba0f211ab6 * Livejournal importer update by Anson now supports importing
comments, see http://board.s9y.org/viewtopic.php?f=11&t=15141
2009-04-20 10:14:18 +00:00
Garvin Hicking e8eea2ca5d . 2009-04-16 16:47:51 +00:00
Matthias Mees 1318c6be6d BP: Added additional currpage2 variable to distinguish between absolute and full URL in navbar menu. 2009-04-16 14:15:25 +00:00
Garvin Hicking 0f1834f2aa * Enhance xhtml cleanup plugin to also work on <param value="..." />
tags.  (garvinhicking)
2009-04-16 08:02:53 +00:00
Garvin Hicking 39aa62b18e * Changed bookmarklet to work with Chrome, thanks to Oliver
Gassner & TextPattern :-) (garvinhicking)
2009-04-14 12:12:52 +00:00
Garvin Hicking a4284fdad2 change api to allow skipping smarty parsing 2009-04-06 13:33:18 +00:00
Matthias Mees 5d80d6e53d BP: Added template file for static pages with related category. 2009-04-01 16:10:39 +00:00
Matthias Mees 282b919af0 BP: Minimal fix for staticpage tpls (order of closing divs) 2009-04-01 16:07:59 +00:00
Garvin Hicking 86c4f46609 * Changed karma plugin to only track GET requests as visits, not
POSTs. Thanks to Marcus Friedman
2009-03-25 10:41:38 +00:00
Garvin Hicking c2e2fb0d48 added french translation by mchinfa 2009-03-24 13:20:44 +00:00
Garvin Hicking b6b3ee78bc enhance nl2br plugin to also use p tags 2009-03-24 10:41:50 +00:00
Garvin Hicking 742df8af16 better german wording, thanks to stm9x9 2009-03-24 10:33:32 +00:00
Garvin Hicking 50d08ff225 Added possibility for templates to register a central function
serendipity_plugin_api_event_hook() and
      serendipity_plugin_api_pre_event_hook()
2009-03-20 17:07:23 +00:00
Garvin Hicking ed67ddd917 improve patch 2009-03-18 09:44:00 +00:00
Garvin Hicking e13b025aed js insertion patch by online 2009-03-18 09:41:00 +00:00
Garvin Hicking 4963bfe3f5 german law-abiding citizens will like this new 'bmi' option 2009-03-17 12:09:39 +00:00
Garvin Hicking 4053c21ed2 try to fix entity translation, patch by bugrep 2009-03-16 09:22:59 +00:00
Jude Anthony 5874e18526 Allow * in quicksearch 2009-03-10 16:07:43 +00:00
Garvin Hicking 6628f392fd Patch by onli to improve quicksearch 2009-03-04 12:10:29 +00:00
Garvin Hicking daab40640e Better regexp for detecting quotes in 'entryprops' parameter 2009-02-26 10:30:20 +00:00
Garvin Hicking 830e79d87f add debug possibility 2009-02-26 10:26:35 +00:00
Garvin Hicking ed8542a164 grammar change 2009-02-26 09:42:11 +00:00
Garvin Hicking 1ff766f83e more changes by bugrep 2009-02-26 09:40:51 +00:00
Garvin Hicking d659406694 update czech translation by vlada ajgl 2009-02-25 09:06:29 +00:00
Garvin Hicking 5363460725 Updated czech translation by Vlada Ajgl 2009-02-25 09:05:39 +00:00
Garvin Hicking c113be7850 Properly inherit a readable color, patch by bugrep 2009-02-25 08:38:09 +00:00
Garvin Hicking d67d2c6985 Use space as seperator 2009-02-24 08:31:28 +00:00
Garvin Hicking 93eed7a946 Language update by Vlada Ajgl 2009-02-23 11:04:54 +00:00
Garvin Hicking c27d6719f4 * Added ability to use strftime variables in the spamblock.log
filename. (kleinerchemiker)
2009-02-20 12:36:46 +00:00
Jude Anthony 275049c5d0 Missed language constants 2009-02-19 19:58:34 +00:00
Garvin Hicking 5e27b37f84 Add some debugging to login routine 2009-02-18 12:57:18 +00:00
Garvin Hicking d9194ac95e * Added improved Blogger.com importer using the API, thanks to jaa 2009-02-17 09:11:23 +00:00
Garvin Hicking f541e5874d New experimental login hashing 2009-02-16 11:29:49 +00:00
Tadashi Jokagi da686463f3 * updated again. 2009-02-14 13:29:41 +00:00
Tadashi Jokagi 69ef76144a * update database entries. 2009-02-14 13:22:47 +00:00
Tadashi Jokagi 4466ce2bba * updated translation. 2009-02-14 13:20:16 +00:00
Garvin Hicking bc57aaa2b5 fix errors 2009-02-11 12:38:50 +00:00
Garvin Hicking 3fa6ab4d84 Allow approval of comments requiring confirmation 2009-02-11 12:35:44 +00:00
Matthias Mees 5bf4b7a81a Fixed minor bug in default-php template. Changed id archives_listing to class in entries_archives.tpl. 2009-02-11 10:38:08 +00:00
Matthias Mees 03137d939d Fixed minor bug in default template. Changed id archives_listing to class in entries_archives.tpl. 2009-02-11 10:36:41 +00:00
Garvin Hicking bc4e177a58 fix variable 2009-02-10 09:10:36 +00:00
Garvin Hicking 468600837c * Fix statistics sidebar plugin to properly count weekly visitors
(garvinhicking)
2009-02-06 11:54:56 +00:00
Garvin Hicking c2f805cffc forgot one 2009-02-05 10:33:37 +00:00
Garvin Hicking cb7b71020e * Changed spamblock plugin for text filtering to ignore trailing
or prepending spaces in blacklists (garvinhicking)
2009-02-05 10:30:51 +00:00
Garvin Hicking e471b0e372 Fix smarty variable 2009-02-03 12:08:20 +00:00
Matthias Mees 9f902f853c Editet history plugin to only admit serendipity_history_body if corresponding config option is actually true. 2009-02-02 11:44:38 +00:00
Matthias Mees 7b3b3d59f8 Fixed small bug in history plugin which emitted invalid HTML. 2009-02-02 11:37:41 +00:00
Ivan Cenov eee7a50c6e 1) Translated text constants to BG language. 2009-02-01 17:59:32 +00:00
Garvin Hicking cc056c3be2 Repatch file for .plainList 2009-01-30 14:06:20 +00:00
Garvin Hicking c28452ef4a * Change syndication plugin to also support new feeds2.feedburner.com
style URLs (garvinhicking)
2009-01-30 14:03:31 +00:00
Jude Anthony 364fa468dc Provide a way to manage karma votes. You can now display all votes in pages,
filtered by IP, user agent, or article.  The display has easy filters for 
article and IP.  You can either delete or approve votes.
2009-01-27 21:48:49 +00:00
Garvin Hicking 37b427b26d Allow javascript inside XINHA WYSIWYG textarea 2009-01-26 13:09:56 +00:00
Garvin Hicking e396fa157a move 2009-01-20 09:20:54 +00:00
Garvin Hicking 0017b30a87 * Fix bad link in Remote RSS sidebar plugin (#2521122)
(garvinhicking)
2009-01-20 09:19:23 +00:00
Matthias Mees 2cded9e602 Added plainList class to core templates. 2009-01-19 15:28:31 +00:00
Matthias Mees 5236c55926 Updated serendipity_authors_plugin to use new plainList class for uls. 2009-01-19 15:14:33 +00:00
Matthias Mees 3406274689 Updated serendipity_syndication_plugin to use new plainList class for uls. 2009-01-19 15:12:44 +00:00
Matthias Mees 23260a557e Updated serendipity_archives_plugin to use new plainList class for uls. 2009-01-19 15:11:13 +00:00
Matthias Mees c0df31f769 Updated serendipity_plugin_entrylinks to use new plainList class for uls. 2009-01-19 15:07:46 +00:00
Garvin Hicking 88ebbf8890 updated hungarian translation, by Roti 2009-01-19 13:39:40 +00:00
Garvin Hicking 90e6b3ac25 Document changes in spamblock plugin 2009-01-19 11:57:03 +00:00
Jude Anthony ed1bfd638a Default to the Open Source akismet server, but only if no key has been entered yet. 2009-01-19 02:14:32 +00:00
Jude Anthony 7c19dfb997 Added TypePad Antispam akismet server 2009-01-19 02:04:04 +00:00
Garvin Hicking f3746bb49c bump 2009-01-16 10:34:54 +00:00
Garvin Hicking 9702aa9efd patch by isotopp: proper index key creation 2009-01-15 15:31:53 +00:00
Jude Anthony 52d049fa8c Remove Windows-specific thumbnails (giving checksums a hiccup) 2009-01-14 15:24:58 +00:00
Garvin Hicking c31a8dd7b9 * Change "Allow duplicate content" in spamblock plugin to not
operate on (empty) pingbacks (garvinhicking)
2009-01-13 18:00:26 +00:00
Garvin Hicking 0498ba3327 patch by isotopp to prevent empty deny from .htaccess clause 2009-01-12 08:15:23 +00:00
Ivan Cenov 55d48f96d6 1) Translated several text constants into BG language. 2009-01-05 20:20:16 +00:00
Matthias Mees 71f748c09c Applied fix by gimmel to history plugin. Keeps plugin from emitting empty spans if display or author are disabled in plugin config. 2009-01-02 09:32:22 +00:00
Garvin Hicking c24d738068 Upgrade to Smarty 2.6.22 to fix a PCRE bug 2008-12-30 10:13:35 +00:00
Garvin Hicking 54b3a405f4 lax file checks 2008-12-29 13:08:31 +00:00
Garvin Hicking 76134b358c trunk version 2008-12-29 09:43:01 +00:00
Garvin Hicking 39746af0ce trunk adaption 2008-12-29 09:42:41 +00:00
Garvin Hicking 7292780094 1.4 release 2008-12-29 08:58:16 +00:00
Garvin Hicking c355d46cbb fix parse problem 2008-12-20 17:51:46 +00:00
Garvin Hicking a5bac0f36b Added serendipity_preview_spacer and pluginmanager_(sidebar|event) CSS ids 2008-12-20 17:00:22 +00:00
Garvin Hicking 9bc05914b5 Temporary patch, see http://trac.xinha.org/ticket/1360 2008-12-19 20:50:10 +00:00
Jude Anthony 0eb387d7b4 Custom WYSIWYG button interface, with HTMLArea/Xinha implementation. 2008-12-19 04:30:58 +00:00
Garvin Hicking 054dfb65c9 * Added ability to rename "feeds" in teh syndication plugin and
add a big image on top (onli)
2008-12-18 10:55:57 +00:00
Don Chambers 2ec6288154 functions_config.inc.php: add ID serendipity_preview_spacer to existing div emitted when previewing entries in backend. 2008-12-17 23:25:13 +00:00
Garvin Hicking 5175be92f3 get rid of error message when plugin has no config options 2008-12-16 15:12:35 +00:00
Don Chambers 72c1c542b7 BP: bump version to 1.4 (no beta). 2008-12-16 14:32:16 +00:00
Don Chambers 2ed4e521eb BP: also add often used classes of serendipity_msg_important and serendipity_msg_notice to those comment subscription messages. 2008-12-13 21:03:27 +00:00
Don Chambers ce1db9a7ec BP: added classes for double opt-in comment subscription success and error. 2008-12-13 20:48:14 +00:00
Garvin Hicking 66f94e7d1a add the same capability to trackbacks 2008-12-12 15:50:58 +00:00
Garvin Hicking 0a7a26b67d * Added more parameters to {serendipity_printComments} function:
"block" (smarty block variable name),
      "template" (smarty template file to render)
      [1.4-beta2]
2008-12-12 10:58:56 +00:00
Garvin Hicking d9a5d6a8c8 Make checksum code skippable 2008-12-09 10:41:48 +00:00
Garvin Hicking 63fe29e942 do not use count(distinct) for SQLite 2008-12-09 10:08:29 +00:00
Garvin Hicking 61be3385e3 try to prevent division by zero 2008-12-09 10:05:33 +00:00
Don Chambers ccdbcfce96 BP: removed conditional comment for pagination. Wrapped arrow in span and applied font-family in base.css. Replaced all &raquo; and &laquo; with &#187; and &#171; Added bottom padding in admincontent. 2008-12-07 22:54:09 +00:00
Garvin Hicking 2e450546c4 * Fixed not remembering entryproperties when re-editing an entry,
introduced with 1.4-beta1 [1.4-beta2]
2008-12-05 12:23:57 +00:00
Garvin Hicking 715422a78c Add SMF importer 2008-12-03 12:22:10 +00:00
Garvin Hicking a1e7462e8f upgrade bundled smarty 2008-12-03 09:29:44 +00:00
Don Chambers bfedee34f3 BP: Added conditional comments to pagination because ie <7 does not support solid arrow, only angle quotes. 2008-12-02 16:44:51 +00:00
Matthias Mees a8816078aa Fixing sidebar ul display for revamped core plugins (part 2). 2008-12-02 14:53:30 +00:00
Matthias Mees 9dbd82d2fa Fixing sidebar ul display for revamped core plugins (part 1). 2008-12-02 14:46:49 +00:00
Garvin Hicking 97fbaf3de3 Fix setting cookies 2008-12-02 12:07:46 +00:00
Garvin Hicking f8094202fe * Adjust getting the right URL for karmavoting and shoutbox
plugins [1.4-beta2]
    * Adjust getting the right URL for karmavoting and shoutbox
      plugins [1.4-beta2]
2008-12-01 09:07:07 +00:00
Garvin Hicking bc9728045a Make visibiel area for plugin drops more clear 2008-11-27 10:43:05 +00:00
Garvin Hicking b979267c4c Added new %parentname% category-permalink option 2008-11-26 12:33:29 +00:00
Jude Anthony 0dc95ae371 Move advanced template code to less intrusive location 2008-11-25 19:57:49 +00:00
Garvin Hicking cc99938f55 bump version 2008-11-25 09:56:55 +00:00
Garvin Hicking 8ea49739fb Fix resetting comment/tb counter when editing an entry 2008-11-25 09:56:04 +00:00
Garvin Hicking f8362ba40b Use autocomplete=off, thanks to sbauer 2008-11-24 15:40:48 +00:00
Garvin Hicking 257dc45c08 german lang update by konrad bauckmeier 2008-11-24 10:08:53 +00:00
Garvin Hicking 5abdfe384f Add more documentation references to plugin manager 2008-11-21 12:20:07 +00:00
Jude Anthony 9e379a5319 Fix typo 2008-11-19 19:45:25 +00:00
Garvin Hicking a05c944b3b Fix not properly counting trackbacks [1.4-beta1]
added more debug
2008-11-14 10:06:54 +00:00
Garvin Hicking 3421dc1a5f Fix bad linewrapping 2008-11-13 13:58:40 +00:00
Garvin Hicking d01b9d377b German translation update 2008-11-13 13:28:53 +00:00
Garvin Hicking c8cf1586e9 Added missing class 2008-11-13 12:38:04 +00:00
Garvin Hicking 591fe956f7 More words of advice. 2008-11-12 13:36:08 +00:00
Garvin Hicking 848433af37 added experimental serendipity importer 2008-11-12 13:32:24 +00:00
Garvin Hicking 74e36756d2 prepare beta4 release 2008-11-10 13:49:07 +00:00
Matthias Mees 041959ff3f BP: Small fix in entries.tpl to suppress emitting .byline if all contents are disabled in theme options. 2008-11-07 17:36:18 +00:00
Garvin Hicking 855e40346e fix parse error 2008-11-06 14:11:13 +00:00
Garvin Hicking 744db929d4 correctly place </ul> 2008-11-06 13:51:06 +00:00
Garvin Hicking c72734e963 * Also recreate custom permalinks without using URL rewriting
(garvinhicking)
2008-11-06 11:44:43 +00:00
Ivan Cenov da2083a046 1) Trasnalted several text contants into BG language. 2008-11-05 18:06:27 +00:00
Garvin Hicking 17a1e5534a * Fix WYSIWYG media insertion when being called on pages with
multiple HTML portions/nuggets, and also the staticpage plugin
      (garvinhicking)
2008-11-05 12:03:29 +00:00
Garvin Hicking 58117f3b77 Allow to override internal mail routine 2008-10-28 12:32:30 +00:00
Garvin Hicking 7300925ce7 * Prefix possibly missing http:// of commenting authors URLs
in recent comments sidebar plugin and admin interface.
2008-10-23 13:50:54 +00:00
Garvin Hicking bed9db637b rework comment counter 2008-10-21 09:30:23 +00:00
Grischa Brockhaus 76d073762b Less conflicting smarty entries for subscribing error / success 2008-10-20 09:53:59 +00:00
Grischa Brockhaus 8087b381c8 signal error and success to smarty in order to allow different style sheats. 2008-10-19 21:48:46 +00:00
Garvin Hicking 03a6868e9f Better output for comment approval and subsciription approval pages, rather than a location redirect. 2008-10-19 10:48:12 +00:00
Garvin Hicking 2f11c3e694 Better fix to use false values 2008-10-18 17:59:06 +00:00
Garvin Hicking 5a1b22f114 fix link 2008-10-18 17:47:22 +00:00
Garvin Hicking 6dd9516dd5 use url rewriting 2008-10-18 17:36:09 +00:00
Garvin Hicking 6179858b17 Support Opt-In for comment subscription mails 2008-10-18 11:17:40 +00:00
Garvin Hicking 7fe3fe3f6e Added missing string 2008-10-18 10:27:41 +00:00
Garvin Hicking ce33550b51 Add new language string 2008-10-18 10:27:07 +00:00
Garvin Hicking 2214abf835 mail-based comment authorisation for spamblock plugin 2008-10-13 11:02:12 +00:00
Garvin Hicking 29b46f0c53 Add more abstraction possibilites, gathered throughout the last weeks 2008-10-13 10:53:45 +00:00
Garvin Hicking 5e3201e7a8 Disable logging by default 2008-10-13 08:13:36 +00:00
Ivan Cenov 4c54bc631b 1) Translated new string in serendipity_plugin_comments in BG language. 2008-10-08 19:57:49 +00:00
Garvin Hicking f4ac3b6248 disable dev tool 2008-10-05 19:37:19 +00:00
Garvin Hicking ac4b2ccd2a Do not transform empty search queries 2008-10-05 18:02:56 +00:00
Grischa Brockhaus 1d5948995b ignore eclipse meta 2008-10-04 13:23:10 +00:00
Don Chambers 7680e37e5c BP: Pagination - page count must be greater than one to display. 2008-10-01 18:10:47 +00:00
Don Chambers 4ae0fcac3a BP: Page footer previous/next links - add option "none" so links can be suppressed. 2008-09-30 16:02:32 +00:00
Don Chambers db81a40403 BP: modified pagination in entries.tpl & added pagination styles to colorset stylesheets. 2008-09-29 20:37:45 +00:00
Garvin Hicking 189ff27f2f FLip wrong error message, thanks to greenwayg 2008-09-24 08:52:14 +00:00
Jude Anthony d4ce381d36 Don't preset entry author or id 2008-09-23 13:53:16 +00:00
Garvin Hicking d1c407121c pgsql bugfix, thanks to jtate 2008-09-19 08:12:26 +00:00
Garvin Hicking c186211614 This does break staticpages for custom permalinks. Use a different 404 fallback, in staticpages. hopefully soon to come. until then, query {$view == '404'} in your template to show 404 content 2008-09-11 11:19:03 +00:00
Jude Anthony 7fca875a7f Add entry data required by advanced templates to preview 2008-09-10 16:32:57 +00:00
Garvin Hicking db14b28472 fix wrong documentation, thanks to Sammy 2008-09-10 10:26:36 +00:00
Garvin Hicking 94fd5e4e8c (Experimental) Replace htmlarea with XINHA. Thanks to abdussamad! 2008-09-09 07:52:18 +00:00
Garvin Hicking 862abd0a90 * Add link to preview entries by an author into the usermanagement
(garvinhicking)
2008-09-09 07:23:19 +00:00
Don Chambers d5d9f78e08 BP: style newly added sidebar edit link for all bp colorsets. 2008-08-29 21:07:34 +00:00
Sebastian Bergmann 8717fb215c Do not ignore the SQLite layer. 2008-08-29 08:02:12 +00:00
Garvin Hicking 5ef47ebf5d * Add memory_limit output to s9y installation, 8MB for 32bit and
16MB for 64bit OSes
2008-08-29 07:54:02 +00:00
Garvin Hicking e6701ee288 fix for constant use 2008-08-29 07:10:31 +00:00
Garvin Hicking 9bfe2cec62 Add Status: 302 header for redirects, have fun, nitrox. :) 2008-08-27 19:20:23 +00:00
Garvin Hicking 80534cb91a Remove obsolete error msg 2008-08-27 11:32:29 +00:00
Garvin Hicking 1d2fe011f3 Show save button at top for 'Manage styles' 2008-08-26 13:56:53 +00:00
Garvin Hicking d3fd8ad8ec Fix parse error 2008-08-26 13:48:48 +00:00
Matthias Mees 4c2a6eb9f2 BP: Fixed truncation of extended entry link; now it truncates the article title first, then adds the lang constant for continue reading. 2008-08-26 13:40:46 +00:00
Garvin Hicking 44290653bb support postgresql ts_vector fulltextsearch, thanks to genesis 2008-08-26 13:19:54 +00:00
Garvin Hicking 87ffb16164 Support for randomized header image added to BP 2008-08-26 12:06:12 +00:00
Garvin Hicking c94805232a SQLite should use its own dir for shared installations 2008-08-25 08:49:56 +00:00
Don Chambers c2535af5f8 BP - added user stylesheet to preview_iframe.tpl 2008-08-24 18:45:13 +00:00
Ivan Cenov 85cffd6c38 1) serendipity_event_entryproperties: Translated new text constants into BG language. 2008-08-22 13:13:01 +00:00
Garvin Hicking aa77cb9b1f * Added header('Status:...') calls so that some CGI installations
of apache emit proper headers (garvinhicking)
2008-08-22 09:20:13 +00:00
Garvin Hicking cb8d4da7fa this is more appropriate, check if the user has plugin admin rights 2008-08-19 11:14:26 +00:00
Garvin Hicking a7aa0ad006 Show "Edit this plugin" link for every sidebar plugin 2008-08-19 11:12:52 +00:00
Garvin Hicking e3d04d76b0 Use sequencing widget for entryrproperties plugin to allow shuffling the order of displayed elements 2008-08-19 10:56:03 +00:00
Ivan Cenov e03847e179 1) Translated new string constant into BG language. 2008-08-12 17:09:03 +00:00
Garvin Hicking 2f248a374b Make bulletproof new default template 2008-08-10 11:32:21 +00:00
Don Chambers 6b43f8bbba BP - new default stylesheet emulating Carl Galloway's "serendipity 3.0". Admin template changed from fixed width to fluid/liquid width. 2008-08-09 03:13:07 +00:00
Garvin Hicking 4c3abd2dfc * Propagate a 'article_count' smarty variable for each category
in the category sidebar plugin, when article counting is
      enabled. (garvinhicking)
2008-08-05 07:40:51 +00:00
Garvin Hicking 62fb2d243a Show preview link for entries in the future 2008-08-04 08:04:37 +00:00
Garvin Hicking fdfcdeb56d Do not execute trackbacks for entries in the future 2008-08-03 11:40:51 +00:00
Garvin Hicking 6c112ff3d2 Allow sequencing widget to disable/enable each sequence entry. 2008-08-03 11:33:39 +00:00
Jude Anthony 4b09f17bca Add last_modified, loginname, and isdraft to entries in search reults. 2008-07-22 19:21:49 +00:00
Garvin Hicking fc70e4b6e7 different check 2008-07-22 13:48:16 +00:00
Garvin Hicking bcf3a1bf65 Fix by Anthem to not leak titles 2008-07-22 08:35:27 +00:00
Matthias Mees cf12fe3fa6 BP: Added new theme option to include optional pagination. Thanks again to Jude for helping me with the code :-) 2008-07-22 07:00:48 +00:00
Don Chambers 449bb30359 BP - strip tags from truncated static page search results 2008-07-19 15:02:46 +00:00
Jude Anthony 1df78fd6ce Update checksum code, move check to front page of installation 2008-07-17 21:23:35 +00:00
Garvin Hicking 0be6a9243c spelfix 2008-07-17 11:06:46 +00:00
Garvin Hicking 9dbf39fcc0 fix cookie removal to use proper host 2008-07-14 08:02:28 +00:00
Garvin Hicking cf755a01c9 New config option for comment tokens 2008-07-10 10:33:06 +00:00
Garvin Hicking 7f14f8b95f * Added optional token insertion for comment notification
(moderation) e-mails, which you can click without the need
      for authentication. This is a convenience feature, note that
      if someone can access your mails, he does not need to authenticate
      for deleting/approving a comment with the contained link.
2008-07-10 10:32:08 +00:00
Garvin Hicking 67dc544dd1 Fix showing metadata 2008-07-07 10:35:57 +00:00
Garvin Hicking 53389b3d70 RFE #2006182: Highlight s9y search terms 2008-06-30 10:35:08 +00:00
Garvin Hicking e4c5ce7e4a * Improved "Remote RSS" plugin's templating output to select
custom template files. Add demo "Nasa Image of the Day" plugin
      by Grigory F. (garvinhicking)
2008-06-30 10:10:10 +00:00
Garvin Hicking 95d242aa88 * Fix Generic RSS import to not always assume WPXRSS feed.
(garvinhicking)
2008-06-30 09:41:07 +00:00
Rodrigo Lazo 2dcd9e5500 Spanish translation updated 2008-06-29 16:09:30 +00:00
Garvin Hicking f8393caa02 expose hide_category parameter to fetchPrintEntires 2008-06-27 10:44:14 +00:00
Garvin Hicking de35302f62 rename db update files properly 2008-06-24 09:45:41 +00:00
Garvin Hicking 19332f2373 Swedish update by Kami Peterson 2008-06-18 11:52:12 +00:00
Garvin Hicking b661c528f4 Properly hide categories in sidebar plugin 2008-06-17 13:20:16 +00:00
Garvin Hicking 8ec332b3db Allow subscribers to comments to receive fulltext 2008-06-17 12:06:45 +00:00
Garvin Hicking af6c267354 Once again, with feeling. 2008-06-02 07:40:28 +00:00
Garvin Hicking 5a490a0546 * Default .htaccess now contains a conditional rewrite pattern
for fallback *.html generation. Thanks to absynth.
      (TODO: Regenerate .htaccess on update, maybe make this
       condition optional)
2008-06-02 07:37:48 +00:00
Garvin Hicking 29bc1520c6 check strict 2008-05-26 11:32:54 +00:00
Garvin Hicking dc94ab1567 Spartacus upgrade for mirrors 2008-05-26 11:24:46 +00:00
Jude Anthony 4fc67fd5f3 Update database version detection 2008-05-15 17:54:35 +00:00
Garvin Hicking db80a5c199 Added mor event hook SQL query parts 2008-05-15 11:40:32 +00:00
Ivan Cenov fdc4977430 1) Translated several text constants to bulgarian language. 2008-05-13 13:45:05 +00:00
Matthias Mees 1eefc2599e BP: Applied fix for the archives page. 2008-05-09 21:36:58 +00:00
Garvin Hicking e99ac00b48 Document, RewriteRule for admin 2008-05-06 08:23:16 +00:00
Jude Anthony 0e67b071dd Included missed language constant in checksum verification 2008-04-29 19:42:57 +00:00
Jude Anthony b97fe45e5b Added FTP-aware checksum generation and validation 2008-04-28 19:10:02 +00:00
Don Chambers b092304c48 Added classes for install/upgrade warning messages. Modified BP admin stylesheet to use these new classes to correct error of overriding green, yellow & red warning text. 2008-04-27 22:19:33 +00:00
Don Chambers ac8b20e8c6 BP - correct error in admin frontpage button path 2008-04-27 17:36:38 +00:00
Don Chambers b0f08e4a7b BP - modified admin page to use single image with different background positions instead of using 3 different images for each link state. Images load much faster, 10 files deleted, 30k disc space saved. 2008-04-27 15:52:01 +00:00
Jude Anthony f21de0e998 Don't try to put karma bars on pages that aren't entries!
Avoids problem with scalar used as array reported by Don
2008-04-22 19:59:08 +00:00
Jude Anthony 8f965fb5a1 Fix karma bars not appearing on summary pages:
Create a footer if none exists yet and add the bar to it.
2008-04-19 04:21:00 +00:00
Matthias Mees 8a6d925a79 Customized bulletproof for latest plugin changes. 2008-04-16 12:00:00 +00:00
Matthias Mees 7592293e62 Customized newspaper for latest plugin changes. 2008-04-16 11:50:38 +00:00
Matthias Mees 01c1746f7c Customized default-rtl for latest plugin changes. Almost made me a little dizzy (-: 2008-04-16 11:45:49 +00:00
Matthias Mees a40941d3f4 Customized default for latest plugin changes. 2008-04-16 11:43:19 +00:00
Garvin Hicking f75f1be51b Tokenize template configuration 2008-04-16 11:41:29 +00:00
Matthias Mees b735490d74 Customized mt3-squash for latest plugin changes. 2008-04-16 11:41:06 +00:00
Garvin Hicking 1bb46cab11 Remove gammeling template 2008-04-16 11:38:49 +00:00
Matthias Mees 47bf7c558b Customized mt3-independence for latest plugin changes. 2008-04-16 11:38:22 +00:00
Matthias Mees 93c98b11cd Customized mt3-gettysburg for latest plugin changes. 2008-04-16 11:37:07 +00:00
Matthias Mees 033975eb02 Customized mt3-chalkboard for latest plugin changes. 2008-04-16 11:35:51 +00:00
Matthias Mees 5ec2070fcb Customized mt-trendy for latest plugin changes. 2008-04-16 11:30:22 +00:00
Matthias Mees c6d4ea24a8 Customized mt-rusty for latest plugin changes. 2008-04-16 11:28:24 +00:00
Matthias Mees 86038afdb4 Customized mt-plainjane for latest plugin changes. 2008-04-16 11:27:06 +00:00
Matthias Mees 3abb5fa090 Customized mt-gettysburgh for latest plugin changes. 2008-04-16 11:26:05 +00:00
Matthias Mees 96b806fae0 Customized mt-georgiablue for latest plugin changes. 2008-04-16 11:24:53 +00:00
Matthias Mees 16e3dfe32a Customized mt-clean for latest plugin changes. 2008-04-16 11:23:32 +00:00
Matthias Mees 7b05401bf2 Customized moz-modern for latest plugin changes. 2008-04-16 11:22:20 +00:00
Matthias Mees 9f1ebe7bdf Customized kubrick for latest plugin changes. This one needs more tweaking later. 2008-04-16 11:20:30 +00:00
Matthias Mees a8d4e30609 Customized idea for latest plugin changes. 2008-04-16 11:14:21 +00:00
Matthias Mees b7b216b504 Customized contest for latest plugin changes. 2008-04-16 11:12:40 +00:00
Matthias Mees a012a6976d Customized competition for latest plugin changes. 2008-04-16 11:11:08 +00:00
Matthias Mees 7a8260a6af Customized blue for latest plugin changes. 2008-04-16 11:07:33 +00:00
Matthias Mees c1cef88fbe Customized carl_contest for latest plugin changes. 2008-04-16 11:01:36 +00:00
Matthias Mees 62013f5026 Modified serendipity_plugin_recententries to use one dl instead of one per recent entry. 2008-04-15 16:52:53 +00:00
Matthias Mees b001fc5ceb BP: Removed evil patch from config.inc.php. 2008-04-14 06:58:07 +00:00
Matthias Mees 0384abd70e Modified output code for serendipity_plugin_shoutbox. 2008-04-14 06:50:39 +00:00
Matthias Mees 2b84e0c08c Modified output code for serendipity_plugin_recententries, put serendipitySideBarDate class back in. 2008-04-14 06:29:01 +00:00
Matthias Mees cfe840bc5a Modified output code for serendipity_plugin_entrylinks. 2008-04-14 06:24:30 +00:00
Matthias Mees bb3ff71631 Modified output code for serendipity_plugin_recententries to use a dl. 2008-04-14 05:41:48 +00:00
Garvin Hicking 23b34ba3eb This Patch is EVIL and has SEVERLY security impacts, can lead to people easily putting XSS on your page or changing the config of your blog without requiring a login
Uncommented.
2008-04-14 05:26:26 +00:00
Matthias Mees 75a9ad7c2c BP: Edited config.inc.php again. Prettier formatting, nothing else :-) 2008-04-14 05:24:41 +00:00
Matthias Mees 2419e1dea4 BP: Applied patch by Abdussammad to config.inc.php which makes it obsolete to reload Manage Styles page after changing number of navbar links. 2008-04-14 05:23:23 +00:00
Matthias Mees 10fcd252be Modified output code for serendipity_plugin_history to put the body into an additional div. 2008-04-14 05:07:06 +00:00
Matthias Mees ca6484ba4c Modified output code for serendipity_plugin_history to not display outro if empty. 2008-04-14 05:00:09 +00:00
Matthias Mees 9ca3eb7a9b Modified output code for serendipity_plugin_history. 2008-04-14 04:45:39 +00:00
Garvin Hicking 67c3dc5c27 Try to fix the selection 2008-04-14 04:04:14 +00:00
Garvin Hicking 78f4dc4d2f less strict check 2008-04-14 03:48:48 +00:00
Ivan Cenov 510ec9a72a 1) Updated BG lang files (after new thumbnail functionality has been added). 2008-04-13 01:39:00 +00:00
Garvin Hicking 775253c2eb Stricter check 2008-04-10 09:01:05 +00:00
Garvin Hicking 6b49c3d1f1 Document 2008-04-10 08:00:12 +00:00
Jude Anthony e2f25e9bad Fix returning unset but existent array key in pickKey 2008-04-10 03:41:17 +00:00
Matthias Mees 56dc221539 Modified generated code for serendipity_plugin_comments. 2008-04-09 22:57:42 +00:00
Matthias Mees 7b37c06360 Modified generated code for serendipity_syndication_plugin to use an ul. 2008-04-09 12:13:16 +00:00
Matthias Mees e82ff21201 Modified generated code for serendipity_authors_plugin to use an ul. 2008-04-09 11:56:33 +00:00
Matthias Mees f0c74d0ea8 Modified generated code for serendipity_archives_plugin to use an ul. 2008-04-09 11:39:04 +00:00
Jude Anthony 84d9e8199f Correct thumbnail constraints. S9Y now supports width, height, largest,
and smallest constraints.  Backwards compatibility is maintained with the
imageselectorplus plugin (the only plugin to use the thumbnail or aspect
calculation code).  Language files are updated and a new option screen
is displayed after choosing "Rebuild Thumbs".
2008-04-09 01:57:10 +00:00
Garvin Hicking 834c8da677 Whoops. This had not been added. 2008-04-08 10:51:40 +00:00
Garvin Hicking 9586d5e2bb Suppress version in email 2008-03-28 11:20:39 +00:00
Garvin Hicking 1dbde90720 Hide version number in rss feeds 2008-03-26 11:31:52 +00:00
Garvin Hicking 5900d207bb Allow to override $serendipity['languages']; 2008-03-26 11:28:21 +00:00
Garvin Hicking c2b48eb7a3 update 2008-03-25 14:04:06 +00:00
Matthias Mees 73f2ac6f61 BP: Removed conditional xmlns again #-) 2008-03-25 13:59:55 +00:00
Garvin Hicking 6ea572211b Patch by hanno boeck 2008-03-25 12:39:55 +00:00
Matthias Mees 40a8c11d13 BP: Added conditional insertion of xml namespace and lang attributes to index.tpl 2008-03-25 10:02:52 +00:00
Ivan Cenov d29413b146 1) Updated BG lang files for serendipity_event_entryproperties. 2008-03-24 21:43:58 +00:00
Garvin Hicking 652ac0bb80 2008-03-20 09:15:07 +00:00
Jude Anthony 96ee4ced98 Use language constant NOT_FOUND 2008-03-19 11:33:28 +00:00
Jude Anthony efd63e33f6 Add function to allow Smarty to retrieve image dimensions 2008-03-19 11:32:13 +00:00
Garvin Hicking 256e41c9f0 document 2008-03-18 09:11:00 +00:00
Garvin Hicking 9d86e3e774 release 2008-03-18 09:09:59 +00:00
Grischa Brockhaus fb25837a85 Add feed_guid only, if not set externaly prior 2008-03-17 18:54:03 +00:00
Don Chambers e0a30f954c BP: minor correction to padding and margins for sitenav menu and archives 2008-03-17 15:38:52 +00:00
Garvin Hicking cebf4eef0e nospam@example.com 2008-03-17 14:34:16 +00:00
Garvin Hicking c9a7a90992 Better wording for CSRF protection 2008-03-17 13:29:37 +00:00
Garvin Hicking 94538a480b Only issue real mail adresses 2008-03-17 11:38:55 +00:00
Garvin Hicking 24a8548e3a add missing title 2008-03-15 15:15:01 +00:00
Matthias Mees 69794d6665 BP: Simplified config.inc.php using boolean instead of radio. 2008-03-14 09:34:20 +00:00
Garvin Hicking 2b679d2802 suppress warning for tigger 2008-03-14 08:11:19 +00:00
Garvin Hicking b33be42a88 Remove invalid dir added by last commit 2008-03-09 09:04:21 +00:00
Grischa Brockhaus 61223c16f0 Invalid HTML fixed 2008-03-09 05:47:54 +00:00
Grischa Brockhaus c36c7cb02c Initial import. 2008-03-09 05:09:18 +00:00
Garvin Hicking f832c7695c google reader patch by adam charnock 2008-03-08 10:31:33 +00:00
Garvin Hicking 4474be0df7 Add option to speed up joining when not needed 2008-03-08 10:27:17 +00:00
Ivan Cenov 73f9aaebe6 1) Updated BG translation of serendipity_event_statistics plugin. 2008-03-07 06:36:23 +00:00
Matthias Mees 02a849ca09 BP: Added a quick hack for the .author display issue to the ie stylesheets. 2008-03-05 11:55:06 +00:00
Garvin Hicking 34f769b892 Fix by roti 2008-03-04 09:44:11 +00:00
Jude Anthony 16dd1400d4 Remove default BSD attribution 2008-03-02 23:27:03 +00:00
Don Chambers 265cf9b51e Updated recent_entries plugin to show/hide on overview, detailed entry, or all pages 2008-03-02 15:23:32 +00:00
Matthias Mees 8dded2d811 BP: Increased version number and set date for latest changes in info.txt. Why do we keep forgetting this? ;-) 2008-03-01 23:24:22 +00:00
Matthias Mees e4b39c59b1 BP: Added fix for all ie versions to display new layouts correctly. 2008-02-29 11:43:41 +00:00
Garvin Hicking 743711e061 Added event hooks 2008-02-29 09:10:27 +00:00
Matthias Mees 75e51a4bcd BP: Updated Czech translations by Vladimir Ajgl. 2008-02-29 08:12:00 +00:00
Jude Anthony 18f745b1e9 Removed criterion colorset; will be submitted to s9y-bulletproof instead. 2008-02-28 15:38:46 +00:00
Jude Anthony 444299e22d Allow attribution for colorsets
Added criterion colorsets, in fixed and fluid variations
2008-02-28 03:26:03 +00:00
Garvin Hicking ca9e0413e9 * Allow to submit comments to future entries, when showing
future entries is enabled (garvinhicking)
2008-02-27 10:01:12 +00:00
Garvin Hicking 5b0d481071 Hungarian update by roti 2008-02-27 09:53:45 +00:00
Garvin Hicking 492be8911e Allow week/day visitors, patch by Roti 2008-02-26 13:22:44 +00:00
Garvin Hicking 533b69b9f0 Do not use draft entries 2008-02-25 10:18:21 +00:00
Garvin Hicking b53ba42e82 reflow 2008-02-25 09:52:24 +00:00
Garvin Hicking 22af86222d fix author counting without drafted articles 2008-02-24 11:06:32 +00:00
Jude Anthony 2dc27ac29d Added "sequence" type for admin plugins and template options 2008-02-23 22:43:09 +00:00
Garvin Hicking 0d875bb3f1 Suppress error 2008-02-21 14:39:08 +00:00
Garvin Hicking 9182557da7 Add 'template' option 2008-02-21 09:42:50 +00:00
Jude Anthony 056402151e Modify pickKey to examine parent array before nested arrays. 2008-02-19 19:48:53 +00:00
Garvin Hicking c7294b3054 Prepare release 2008-02-19 18:39:01 +00:00
Ivan Cenov 4875c2afcb 1) BP: Removed typing error in BG lang file. 2008-02-18 13:54:09 +00:00
Jude Anthony 31641e1de9 Fix to word-rating code 2008-02-15 17:53:54 +00:00
Grischa Brockhaus 558a321185 event_karma: German language files updated. 2008-02-15 12:17:54 +00:00
Garvin Hicking cc4c2b2431 Translation of some part 2008-02-15 11:56:31 +00:00
Garvin Hicking 903d9cc0eb Upgrade to new smarty 2008-02-15 11:38:53 +00:00
Jude Anthony f2c82b1cbb Fix mispelling karam -> karma 2008-02-14 18:22:56 +00:00
Garvin Hicking ac783f1f78 * Fixed bug #1893108: Missing 'xmlns' attribute in templates for
<html> tag. (garvinhicking)
2008-02-14 09:16:58 +00:00
Garvin Hicking a534807864 Use xhtmlns attribute to <html> 2008-02-14 09:15:18 +00:00
Garvin Hicking 270a01b543 bail out if thumbs are smaller than 1 px (0=off) 2008-02-11 17:52:47 +00:00
Ivan Cenov d0192e7223 1) BG translation of new strings in serendipity_event_karma plugin. 2008-02-11 12:25:31 +00:00
Ivan Cenov 3851423484 1) BG translation of several strings. 2008-02-11 12:24:13 +00:00
Jude Anthony fad5724dfc Graphical rating bars 2008-02-11 02:36:50 +00:00
Jude Anthony a96a3a5250 Use Grischa's translated German lang files 2008-02-11 02:15:10 +00:00
Jude Anthony b284341e28 Simplify and beautify code; allow admin config to override most text options;
graphical rating bars (at last!)
2008-02-11 02:12:07 +00:00
Grischa Brockhaus afba53edfe Changed used language entry for option "Show comment complete" 2008-02-10 10:01:32 +00:00
Jude Anthony 215f741aaa Most minor bugfix imaginable: add . to make plugin respect selected categories 2008-02-08 02:35:44 +00:00
Garvin Hicking 92a653cbad Add phpnuke importer 2008-02-06 14:50:31 +00:00
Garvin Hicking 63a6d81a8b Added CENTER constant 2008-02-06 09:02:11 +00:00
Ivan Cenov ce7fe6e031 BP: Added BG translations. 2008-02-03 08:26:54 +00:00
Garvin Hicking bacf8ff0f3 Missing commit 2008-02-02 11:05:35 +00:00
Jude Anthony 02b364f44f Add CENTER for alignments (required for karma plugin) 2008-02-01 15:37:00 +00:00
Garvin Hicking 21bc3bc142 Missed one commit file 2008-02-01 14:16:55 +00:00
Garvin Hicking d34bbd7181 * Add ability to plugins to check uploaded media files for invalid
file extensions. Added more escaping to user- and groupnames
      for untrusted author environments, thanks to Hanno Boeck.
      (garvinhicking)
2008-02-01 14:10:14 +00:00
Garvin Hicking 2aff6710c8 Patch by Vlada Ajgl, better IPTC keyword support 2008-01-30 11:47:36 +00:00
Garvin Hicking b8c0bc98eb Tighter check for multi category names 2008-01-29 19:11:04 +00:00
Matthias Mees e808f2dd73 BP: Added two 2column layout, both with additional sidebars below. 2008-01-24 14:30:21 +00:00
Matthias Mees 74971fab90 BP: Fixed teeny, tiny bug - a missing space - in base.css. 2008-01-23 23:39:07 +00:00
Garvin Hicking e317fd54ee Fix spelling :) 2008-01-20 14:16:06 +00:00
Garvin Hicking 8c8e9ad42c * Added czech translation to bulletproof templates and bundled
plugins, by Vlada Ajgl
2008-01-20 13:33:18 +00:00
Garvin Hicking 6d74579916 Update by Lars Strojny: Abstract URL 2008-01-18 12:50:00 +00:00
Garvin Hicking 3652788e31 improve fetchcomments hook 2008-01-17 15:00:13 +00:00
Garvin Hicking 992adc4f8b Only set $id when larger than 0, thanks to Alexander Hess 2008-01-16 13:54:32 +00:00
Garvin Hicking 47c25cc563 Commit change from Alexander Hess, use ordering of links 2008-01-15 15:36:21 +00:00
Ivan Cenov d9a2c94c37 1) BG translation of several strings. 2008-01-13 19:52:42 +00:00
Ivan Cenov cf66bd58a7 1) BG translation of several strings. 2008-01-13 19:51:12 +00:00
Grischa Brockhaus c71439041f trackback/pingback: Fixed legth configuration name, deleted Charset configuration, because it is not needed. 2008-01-13 11:30:22 +00:00
Grischa Brockhaus 3e491633b6 plugin_comments: URLs of writers may now be shown in the sitebar. This only worked for trackbacks formaly, now it works for trackbacks, pingbacks and human writers. You may configure, in what type of comment the URLs should be added. 2008-01-12 13:47:16 +00:00
Grischa Brockhaus 81506febd0 Enhanced pingback/trackback receiving 2008-01-12 13:06:37 +00:00
Garvin Hicking d95501665a Allow to re-convert &quot; to " again with a config option,
thanks to Lars
2008-01-08 10:07:11 +00:00
Garvin Hicking b99a7194f8 Allow to re-moderate comments 2008-01-03 15:02:22 +00:00
Garvin Hicking d5369da92e http://board.s9y.org/viewtopic.php?t=11985&highlight= 2008-01-03 13:43:51 +00:00
Garvin Hicking b839b47df5 * Fix displaying entry title in the backend section exactly like
in the frontend, thanks to Alex (garvinhicking)
2008-01-02 10:12:57 +00:00
Matthias Mees bf9efb01c4 BP: Added .published plus styles to base.css to rectify display of entry date which was altered by including microformats. 2008-01-01 21:04:13 +00:00
Grischa Brockhaus 4227ee1038 Added hooks to trackback listing in order to let plugins change it (the avatar plugin in example) 2007-12-22 18:49:03 +00:00
Garvin Hicking 1388926481 Portugues fix by David 2007-12-16 22:46:30 +00:00
Sebastian Bergmann 12d42f2918 Reorganize test suite.
- Split testLoginLogout() into testBadLogin() and testLoginLogout().
- Mark testCreateSimpleArticle() as incomplete until the popup
  window opened by clicking on VIEW is handled correctly.
- Disable mod_rewrite so that the test suite does not depend on it.
- Remove superfluous check for Testing_Selenium class.
- Migrate TestConfiguration.php.dist to config.xml.dist.
  - Configure whitelist for code coverage information.
    - Be conservative for now and only add include/ and plugins/
      directories for now.
    - Set addUncoveredFilesFromWhitelist="false" because not all
      files are loadable (yet).
- Add documentation for code coverage reporting.
2007-12-13 14:14:56 +00:00
Garvin Hicking 2b68440ff2 templating for rss sidebar 2007-12-13 13:05:23 +00:00
Garvin Hicking 098e569950 Tweak CSS output of rss sidebar plugin 2007-12-12 10:37:41 +00:00
Garvin Hicking 6822e4e287 browser compat not needed for IE7 2007-12-12 10:06:31 +00:00
Garvin Hicking c24d2b9b62 Remove unnecessary htmlspecialchars 2007-12-12 08:49:54 +00:00
Garvin Hicking 93187737fb fix empty check 2007-12-11 10:33:57 +00:00
Garvin Hicking 300a78d328 + * Add possibility to spartacus to upload files via FTP. This can
+      bypass Safe_mode restrictions on your server to make Spartacus
+      work for you. (VladaAjgl)
2007-12-11 10:07:55 +00:00
Matthias Mees c07c20e7c0 BP: Added checks for empty sidebars to index.tpl. 2007-12-07 08:30:09 +00:00
Don Chambers fe20d4fb94 BP: roll version to 1.2 2007-12-07 05:31:57 +00:00
Don Chambers 55afb4ffe2 BP: minor fix to 1 col layout 2007-12-07 05:27:09 +00:00
Garvin Hicking 3a62202c4d Shuffle NEWS, undo Don's last patch that removed 1.3 features 2007-12-06 11:10:36 +00:00
Garvin Hicking c70fe3c26c backport 2007-12-06 10:42:06 +00:00
Garvin Hicking b9d62e0b6c Property commit 2007-12-06 10:26:48 +00:00
Garvin Hicking b05cae4764 proper lifetype status 2007-12-06 10:24:48 +00:00
Garvin Hicking bc40b13c03 Ignore files in here 2007-12-06 10:14:21 +00:00
Garvin Hicking e18131c041 Ignore files in here. 2007-12-06 10:13:49 +00:00
Matthias Mees a85d8e308d BP: Added theme option to use user stylesheet to config.inc.php and index.tpl. Also added lang variables for it to German and English lang files, and prepared Bulgarian lang files. 2007-12-04 11:29:35 +00:00
Matthias Mees f7deca1328 BP: Removed obsolete link to override.css from index.tpl. 2007-12-04 11:17:38 +00:00
Matthias Mees 566dc39fda BP: Removed obsolete override.css. 2007-12-04 11:09:22 +00:00
Matthias Mees de2e9ae2c5 BP: Edited 1column layout to look like it was supposed to in the first place. 2007-12-04 10:34:57 +00:00
Garvin Hicking 1856be9aec Czech update by Vladimir Ajgl 2007-12-04 09:11:39 +00:00
Don Chambers 415c4dd944 category plugin: added <li> classes category_depth# (#= 0=parent, 1=first child, etc) and category_# (#=category id). 2007-12-03 20:54:55 +00:00
Garvin Hicking 3d34cfa548 * Fix proper encoding of '%' sign when used in post titles
(garvinhicking)
2007-12-02 15:06:09 +00:00
Ivan Cenov 879b4df578 1) BG translattion of new text constants in serendipity_event_mailer and serendipity_event_textile. 2007-12-01 08:46:08 +00:00
Garvin Hicking 83205fb019 Add new "joinown" and "entryprops" parameters to
{serendipity_fetchPrintEntries}
2007-11-29 12:27:50 +00:00
Garvin Hicking bb25db8d4c Add lifetype importer 2007-11-28 14:23:16 +00:00
Garvin Hicking 6be028246c * Encode RSS feed links, Patch by Hanno Boeck 2007-11-27 16:01:10 +00:00
Garvin Hicking a6600eb0b1 fix spartacus sidebar listing 2007-11-26 13:20:38 +00:00
Garvin Hicking 41b86a3afb textile patch 2007-11-26 10:47:35 +00:00
Garvin Hicking af5ca0ecea Add more CSS classes 2007-11-26 10:25:49 +00:00
Garvin Hicking fdef515149 Update textile 2007-11-25 11:36:57 +00:00
Garvin Hicking 93926f9635 backport 2007-11-25 01:10:25 +00:00
Garvin Hicking 4e16137e7e Fix dir creation issue 2007-11-23 15:04:03 +00:00
Garvin Hicking 5ec22993b9 bump 2007-11-23 14:57:08 +00:00
Garvin Hicking c30b9619ec Fix CSS issues (empty stylehseets) and bug with inserting images 2007-11-22 10:07:00 +00:00
Matthias Mees 40f775bc32 BP: Revised skiplinks - changed the CSS used for hiding skiplinks from visual browsers. 2007-11-20 21:53:59 +00:00
Matthias Mees 40513a9b66 BP: Revised skiplinks: Used existing anchors instead of extra anchors. Added lang attribute to list elements so screen readers can identify the language used for the skiplinks. 2007-11-20 21:48:42 +00:00
Garvin Hicking 5304923dd0 chinese language update by Demin Yin (work in progress) 2007-11-20 12:05:07 +00:00
Garvin Hicking 0be0f20c44 Add translations by VladaAjgl 2007-11-20 11:29:06 +00:00
Don Chambers f99b1fe456 BP: added classes and changed structure of entries_archives.tpl and entries_summary.tpl. Also changed serendipity_Entry_Date padding to margin. 2007-11-18 17:45:02 +00:00
Don Chambers 61948709f2 BP: Add container serendipitySideBarTitleEmpty for sidebar items without title. 2007-11-16 19:03:45 +00:00
Don Chambers 99c08a857b BP: Add livesearch support for navbar quicksearch. Note: all stylesheets changed from selector navbarsearchform to #sitenav #searchform {} 2007-11-15 15:49:33 +00:00
Ivan Cenov ebf76e30dc Karma plugin:Translated new strings in Bulgarian language. 2007-11-13 18:40:36 +00:00
Ivan Cenov 48e3a70592 BP:New strings translated in Bulgarian language. 2007-11-13 18:31:18 +00:00
Garvin Hicking b01cf73deb Support remove plugin management interface 2007-11-13 14:47:44 +00:00
Matthias Mees d0f2c81e98 BP: German translation for theme options related to addthis widget. 2007-11-13 08:15:53 +00:00
Don Chambers 6357b71a37 BP: AddThis widget option added. Language files other than english need translation for 2 added variables. 2007-11-12 23:46:58 +00:00
Don Chambers 4b37411142 BP: add override stylesheet for user customization 2007-11-11 20:28:03 +00:00
Don Chambers 0a8c737848 BP: Removed extra ">" after </dd> in plugin_staticpage_searchresults.tpl. 2007-11-04 19:00:14 +00:00
Garvin Hicking 7daa15dc50 Patch by Assen Tchorbadjiev: Better WYSIWYG component detection 2007-11-02 11:21:44 +00:00
Don Chambers 49739a52c2 BP: Relocated frontend_header hook after <title>; BP Admin - added selectors for fieldset and legend. 2007-10-30 21:26:14 +00:00
Matthias Mees ba20e5df7d BP: Also updated latest changes to plugin_dynamicform.tpl. 2007-10-29 09:08:24 +00:00
Don Chambers cea94442c4 BP: removed hyperlink from plugin_contactform.tpl legend as it served no real purpose. 2007-10-28 23:55:28 +00:00
Grischa Brockhaus c7f792ef96 event_karma: New option to disable visit tracking for logged in users. 2007-10-28 13:11:16 +00:00
Don Chambers 2122e36aeb BP: style.css: added rules for abbr, acronym and new class of .help 2007-10-25 17:53:21 +00:00
Garvin Hicking b7a69c91ba Small fixes 2007-10-23 13:56:12 +00:00
Garvin Hicking 5a1ed450fd WPXRSS importer added. 2007-10-23 13:30:39 +00:00
Garvin Hicking ff27e8578d Patch further 2007-10-19 14:26:12 +00:00
Garvin Hicking 68e9903be3 WP 2.3 importer, experimental 2007-10-19 09:36:27 +00:00
Garvin Hicking 523e403093 * Patch PEAR.php for better detection, if already included.
Thanks to Assen Tchorbadjiev.
2007-10-18 17:43:39 +00:00
Garvin Hicking 2be8f6d227 propper utf8 code 2007-10-18 11:42:35 +00:00
Garvin Hicking 6ddacc7f2a Clarify 2007-10-16 08:08:43 +00:00
Garvin Hicking 14e2bafb36 Clarify 2007-10-16 08:08:26 +00:00
Garvin Hicking b3b0440bfe Fix bad spelling 2007-10-15 11:33:39 +00:00
Garvin Hicking 935283f0f0 Fix comment rss feed timestap
(http://board.s9y.org/viewtopic.php?p=64011)
2007-10-15 10:16:51 +00:00
Don Chambers 8cbec2ccf8 BP: added class of archive_summary_details to entries_summary.tpl. 2007-10-14 23:11:44 +00:00
Don Chambers a2cd21604e BP: entries_summary.tpl now uses date format set in theme options. Also added styles for archive_summary and archive_summary_title to style.css for better visual separation between summary entries. 2007-10-14 23:02:21 +00:00
Garvin Hicking 4a295192a4 Fix typo 2007-10-12 09:15:58 +00:00
Garvin Hicking 988860f7e5 Add SQLRelay DB layer, by Dante Mason 2007-10-12 09:12:48 +00:00
Matthias Mees eabd9991a2 BP: Added .authors to base.css to overrule formatting applied by address tag. 2007-10-10 10:35:48 +00:00
Garvin Hicking 8c8b12a27e Allow recent entries plugin to fixat "current" category 2007-10-09 13:33:23 +00:00
Matthias Mees 6d37813fdc BP: Added some classes and tags to index.tpl and entries.tpl to add basic microformats support. 2007-10-09 11:52:33 +00:00
Matthias Mees f51da87467 Added send button for search form in include/plugin_internal.inc.php. This makes the search form more accessible. 2007-10-09 11:09:35 +00:00
Andrew Huang 6835bc61c7 updated trad Chinese language 2007-10-08 06:01:13 +00:00
Matthias Mees 9c49561c4c BP: entries.tpl now uses date format set in the theme options for sticky entries, too. 2007-10-01 08:06:46 +00:00
Garvin Hicking e9545daaf9 Use str_replace for matching searchwords, thanks to Dietrich Raisin 2007-09-28 07:46:34 +00:00
Don Chambers e8a2d18a11 BP: adding print.css as file did not commit in previous attempt. 2007-09-27 21:27:34 +00:00
Don Chambers 1c8b1724e7 BP: add print.css and modify index.tpl to use include it for print media 2007-09-27 20:10:20 +00:00
Matthias Mees 7bb2b69d14 BP: Moved skiplink anchors in front of the containers they're supposed to link to instead of being within said containers. 2007-09-27 13:07:52 +00:00
Matthias Mees 6c0c8b3f7a BP: Fixed typo in index.tpl. 2007-09-27 12:50:17 +00:00
Matthias Mees a4415378d9 BP: Added selective inserting of skiplinks. 2007-09-26 21:47:01 +00:00
Matthias Mees 93bb86453f BP: Added missing # to skiplink hrefs so they now actually work :-) 2007-09-25 15:26:43 +00:00
Ivan Cenov 0348d5f90b 1) Removed spelling error in serendipity_lang_bg.inc.php. 2007-09-23 20:35:29 +00:00
Ivan Cenov 46e2730a6b BP: Translated new text in Bulgarian language. 2007-09-23 20:34:20 +00:00
Don Chambers f33f8bf935 BP: contain sidebar navigation within .serendipitySideBarContent. Templates created on bulletproof prior to now may require revisions to accomodate this change. 2007-09-20 02:22:57 +00:00
Matthias Mees e680b5f3c7 BP: Applied better fix for 2col s-b layout in IE. Also added a fix for 1col layout to IE stylesheets. 2007-09-20 01:02:52 +00:00
Matthias Mees 9730caf674 BP: Fix for 2col s-b layout in IE (any version). 2007-09-19 10:33:04 +00:00
Matthias Mees 73c7d16ddd BP: Added default style for pre to style.css. 2007-09-19 10:01:20 +00:00
Don Chambers c20c7d6388 BP: removed inline styles for colorset calendar arrow dimensions (blank/default still retains inline styles). 2007-09-18 21:58:15 +00:00
Don Chambers 4b2575819e comments.inc.php - truncate author, email and url like referrer on admin comments page; add new class for pending comments header, BP admin now shows yellow background with red border for pending comments header matching Grischa's previous contribution of a red border for comment content below the header. 2007-09-18 16:06:04 +00:00
Don Chambers cce490abb3 BP: New classes for various combinations of sidebars and content; removed sidebar classes of LeftSideBarLeft, LeftSideBarRight, RightSideBarLeft and RightSideBarRight; new navigation classes for first and last link; new div containers at top and bottom of wrapper. 2007-09-18 01:37:09 +00:00
Garvin Hicking f1415b1afe upport 2007-09-17 09:06:08 +00:00
Don Chambers acb94a4245 BP: Fix error in plugin_calendar.tpl 2007-09-16 21:21:37 +00:00
Ivan Cenov a7122ebf66 1) Changed BG (UTF-8) lang file in bulletproof (s9y trunk) 2007-09-16 18:34:42 +00:00
Matthias Mees 97166b1cb3 BP: Added IE 5 fix for horizontal navbar. 2007-09-15 16:46:15 +00:00
Matthias Mees cdb8682d28 BP: Added basic IE5 fixes via additional stylesheet ie5.css. 2007-09-14 10:15:45 +00:00
Matthias Mees 3f98afa34c BP: Added basic IE5 fixes via additional stylesheet ie5.css. 2007-09-14 10:14:26 +00:00
Matthias Mees 5e0959d79f Bulletproof: Removed deficons from lang files. 2007-09-13 07:43:22 +00:00
Matthias Mees afdfd95f12 Bulletproof: Removed deficons theme option. 2007-09-13 07:40:23 +00:00
Don Chambers 7b169969d6 BP: overflow:auto changed to overflow:hidden for .serendipity_Entry_Date and.serendipity_commentBody due to firefox horizontal line bug. 2007-09-13 01:11:41 +00:00
Matthias Mees 538800e469 Bulletproof: Added theme option for alternate display of number of comments and trackbacks in the entry footer. 2007-09-12 09:13:59 +00:00
Matthias Mees b36bd432c0 Bulletproof: Added .serendipity_freeTag_related to style.css. 2007-09-12 08:28:50 +00:00
Matthias Mees 1c7877b574 Removed Bulletproof colorset lang variables. We don't need them anymore. 2007-09-12 08:13:47 +00:00
Don Chambers 5e3f9bac85 Fix admin entry list when no entries exist or meet filter criteria. 2007-09-11 12:48:15 +00:00
Grischa Brockhaus 9e16c0b1a4 Removed http://www.cexten.com link in language files 2007-09-10 10:42:31 +00:00
Grischa Brockhaus cfeb0b79fb Removed http://www.cexten.com link in language files 2007-09-10 10:39:05 +00:00
Garvin Hicking 7c2d400e49 Fix s9y link 2007-09-10 10:29:05 +00:00
Matthias Mees 7be9f9e0c9 Updated Bulletproof and it's lang files. Added theme options to use default icons regardless of colorset chosen as a fallback option in case a colorset stylesheet doesn't have these icons. 2007-09-10 09:55:31 +00:00
Don Chambers 1ec882c1e6 BP: style.css: Catetories sidebar margin added, add row classes to plugin_calendar.tpl, comment out favicon link 2007-09-09 23:23:09 +00:00
Don Chambers 977d9ffbf5 BP: convert files to unix/utf-8 2007-09-07 20:08:16 +00:00
Matthias Mees 6d24d51684 Updated German lang files for bulletproof template to fit latest additions. 2007-09-07 08:59:56 +00:00
Ivan Cenov 5d048cda82 1) Updated BG translation of bulletproof configuration. 2007-09-06 19:45:53 +00:00
Don Chambers d216d73923 BP - relocated rule for pending comments, added rule to fluid stylesheet. 2007-09-06 16:19:33 +00:00
Don Chambers 867ccf7394 Bulletproof additions/modifications:
Added new class of serendipity_Sticky_Entry in entries.tpl.
Added template option to suppress entry footer for sticky posts.
Added template option to suppress entry heading for sticky posts.
Added template option to include or exclude icons in previous/next page links.
Added default rules for class counter_code to style.css.
2007-09-06 15:16:46 +00:00
Matthias Mees e69bbc7dbb Some updates for the bulletproof template. 2007-09-04 13:14:02 +00:00
Garvin Hicking da8ff0d06d Try to suppress notice 2007-09-04 10:12:10 +00:00
Grischa Brockhaus a8a15cddff BP Template: Added red border around pending comments 2007-09-02 13:57:11 +00:00
Grischa Brockhaus dea579ee85 * Pingbacks are named "pingback" in the admins comment list (instead of "trackback")
* Added new css class for pending comments in order to mark them optical via css
2007-09-02 13:53:18 +00:00
Grischa Brockhaus 60a0320eb6 Added pingback filter option for comments in admin area 2007-09-02 01:23:21 +00:00
Grischa Brockhaus de7b11e91b Added changes sugested by yellowled and Don Chambers in http://board.s9y.org/viewtopic.php?t=10928&postdays=0&postorder=asc&start=0 2007-09-01 13:47:00 +00:00
Garvin Hicking a27dc54fea * New plugin API method "parseTemplate($filename)" to allow a
sidebar- or event-plugin to fetch+display a smarty template.
      (garvinhicking)
2007-08-31 10:39:55 +00:00
Garvin Hicking ae6d56830b Version 1.2.1 ()
------------------------------------------------------------------------

    * Bulletproof template can now include custom user stylesheets
      (*_style.css) in the dropdown of a colorset. (garvinhicking)
2007-08-29 19:54:36 +00:00
Ivan Cenov 9048d79123 1) Added Id keyword. 2007-08-28 19:44:19 +00:00
Ivan Cenov c0a78f6dd5 1) Added BG translation of admin panel of bulletproof theme. 2007-08-28 19:32:32 +00:00
Garvin Hicking 282ea3f648 Allow ?p=X and ?serendipity[id]=X URLs 2007-08-28 07:56:36 +00:00
Garvin Hicking 6be9dab44d Dons update 2007-08-26 16:23:02 +00:00
Garvin Hicking e194dbfb0d document 2007-08-25 12:06:35 +00:00
Garvin Hicking ce33a55c5d Add bulletproof 2007-08-25 12:05:30 +00:00
Grischa Brockhaus 5fef79c858 event_creativecommons:
* Changed default cc version to 3.0, respecting old configuration while updating.
* BY only version is only valid since 3.0. 2.5 doesn't support this.
* Japanese users get a wrong link to the creative common license
* Mouseover image title supports Mozilla, too (title attribute)
2007-08-22 18:06:51 +00:00
Grischa Brockhaus 3894f4b673 event_creativecommons:
* Changed default cc version to 3.0, respecting old configuration while updating.
* BY only version is only valid since 3.0. 2.5 doesn't support this.
* Japanese users get a wrong link to the creative common license
* Mouseover image title supports Mozilla, too (title attribute)
2007-08-22 18:05:56 +00:00
Grischa Brockhaus bfb29a697b pingback fetchData: Retreive content from first <p> tag, if found in order to have the article content instead of menu structure as content. If no <p> tag is found, the <body> tag is the starting point to fetch content. 2007-08-22 17:57:57 +00:00
Grischa Brockhaus 6189defb6f Made pingback fetchData switched on by $serendipity['pingbackFetchPage'] set in serendipity_config_local i.e. 2007-08-22 17:46:32 +00:00
Garvin Hicking 57b51e738b nofollow for superuser plugin, thanks to kallussed 2007-08-21 16:49:31 +00:00
Garvin Hicking 1770f28dee array check, thanks to phellmes 2007-08-21 15:54:25 +00:00
Garvin Hicking cb75ef15ce Allow variying template 'okey' 2007-08-21 10:25:57 +00:00
Grischa Brockhaus 2528c7cc7d Made pingback receiving better working with WordPress Pingbacks 2007-08-20 21:00:01 +00:00
Grischa Brockhaus 2d03d5a0dc Made pingback receiving better working with WordPress Pingbacks 2007-08-20 20:56:06 +00:00
Garvin Hicking 300525e7b5 Temporarily suspended pingback fetching until it's implemented with a config option to prevent abuse 2007-08-17 12:28:21 +00:00
Garvin Hicking f1d61d5822 Use proper "<locale>.<charset>" instead of "<locale>-<charset>" locales. Thanks to Boris! 2007-08-16 13:07:43 +00:00
Jude Anthony e42aef3fa2 Fix typo preventing 'media' type from supplying a default preview div height 2007-08-15 17:05:35 +00:00
Grischa Brockhaus c7d3b1ede3 Extended spam blocking plugin to handle pingbacks like trackbacks. 2007-08-14 18:43:00 +00:00
Grischa Brockhaus 3bdd7a796c Try to autodetect articles id if no entry id was giving reveiving a pingback 2007-08-14 18:03:35 +00:00
Grischa Brockhaus 9977663788 Smarty loads trackback and pingback comments when displaying trackbacks. This is most compatible with existing templates. 2007-08-14 17:45:09 +00:00
Grischa Brockhaus aafa8f9ca1 Smarty loads trackback and pingback comments when displaying trackbacks. This is most compatible with existing templates. 2007-08-14 17:42:51 +00:00
Grischa Brockhaus 71ba81dc43 Pingback receiving is working now with internal functionality in comment.php 2007-08-14 17:38:50 +00:00
Grischa Brockhaus b2871fbcfd :-| was not replaced, only :| 2007-08-14 11:53:37 +00:00
Garvin Hicking 95639e58e3 Descriptive Akismet spam return 2007-08-13 08:03:40 +00:00
Garvin Hicking f2eee4d33c Fix table generation for spamblock, thanks to boris 2007-08-13 08:00:01 +00:00
Garvin Hicking f749bb59f4 fix for don 2007-08-10 09:59:09 +00:00
Garvin Hicking 817fbba02e Reduce file size 2007-08-10 09:07:04 +00:00
Grischa Brockhaus 634594b2de A ">" too much 2007-08-10 00:51:40 +00:00
Garvin Hicking 0971639dee Upport 2007-08-09 09:31:29 +00:00
Garvin Hicking a78b5338f0 Fix entryproperties value setting 2007-08-08 08:53:26 +00:00
Grischa Brockhaus 78cedc04f8 NEWS typo.. 2007-08-07 15:13:28 +00:00
Grischa Brockhaus 81c1abd186 Added mp4 as video/x-quicktime guess 2007-08-07 15:08:35 +00:00
Grischa Brockhaus 58b083ca2b Added allowed type parameter to isImage function. This removes the need of seperate isMedia, isVideo and isAudio functions. 2007-08-07 14:45:34 +00:00
Grischa Brockhaus 1519621795 Debug message was not printed 2007-08-07 14:34:13 +00:00
Grischa Brockhaus a7dfea38ab On the fly update of the media databas: Not only images are added but video and audio, too. 2007-08-07 14:17:49 +00:00
Garvin Hicking 426ff6109f classname 2007-08-07 13:59:07 +00:00
Garvin Hicking 1f40fcc283 German language change 2007-08-07 08:17:21 +00:00
Grischa Brockhaus 2f8a08fcd8 Removed TinyMCE patch as it is not neccessary anymore. 2007-08-06 13:52:46 +00:00
Garvin Hicking 2c9038774f bad png 2007-08-06 11:29:31 +00:00
Garvin Hicking a0d950b320 HTML and images by Don 2007-08-06 10:18:26 +00:00
Grischa Brockhaus 5671308a02 Made pasting to TinyMCE work 2007-08-05 18:16:33 +00:00
Garvin Hicking e9eeac61df Better shared mode integration, thanks to stm9x9 2007-08-04 13:28:21 +00:00
Garvin Hicking 559b1b2f01 lang update 2007-08-04 13:04:14 +00:00
Garvin Hicking a3b1307c07 Use better path detection, compatible with shared mode 2007-08-04 12:51:05 +00:00
Grischa Brockhaus fc1e6a049f New spam blocking method for trackbacks: ip validation. The senders ip is compared with the ip of the host, the trackback is set to. If they don't match, the trackback is rejected/moderated. This should reject most of the trackback spam bots. 2007-07-31 15:19:16 +00:00
Grischa Brockhaus bde584609d Reverted last patch for making Atom Feed working with parameterized URLs. 2007-07-29 10:11:53 +00:00
Grischa Brockhaus 79fb859060 Atom feeds became invalid, if entry has href or src attributes containing char represented by XML Entities normaly (like href="test.de?a=1&b=2") 2007-07-27 14:17:34 +00:00
Grischa Brockhaus f5f013c3c7 GuessMime: JAR became octet-stream always, added ico extension 2007-07-27 11:29:34 +00:00
Grischa Brockhaus c1c5cec488 plugin_comments: Hand over author to other plugins, too. 2007-07-27 10:49:30 +00:00
Garvin Hicking c193fa9406 use php4 2007-07-26 10:10:26 +00:00
Garvin Hicking 299d26ab92 fix bug #1759990 - japanese lang 2007-07-25 07:27:04 +00:00
Garvin Hicking dca2494e58 UTF-8 fix 2007-07-24 12:59:00 +00:00
Garvin Hicking c5685b8023 Patch by kalkin: Improve statistics plugin for better bot detection and graph creation 2007-07-24 12:57:48 +00:00
Garvin Hicking c7912f091b Use max compression as suggested by kink 2007-07-21 18:38:48 +00:00
Garvin Hicking ee32db52ee Don's patches 2007-07-20 09:20:31 +00:00
Garvin Hicking 814b55de08 improved plugin 2007-07-20 09:14:43 +00:00
Ivan Cenov e2912e60a0 1) Several strings translated to BG. 2007-07-19 06:16:09 +00:00
Grischa Brockhaus e4a6038fa7 The recent entries sidebar plugin shiped with s9y listed entries not accessable by the current user because of right restrictions. 2007-07-17 14:29:09 +00:00
Garvin Hicking a8f57711a9 Small code cleanup by Falk Doering:
- PHP6 forward compatibility on accessing strings
- Better indenting, other cleanups on the plugin API file
2007-07-17 11:31:20 +00:00
Garvin Hicking 1364313382 Require category joins in some cases, add smarty params for new fetchentry features 2007-07-17 08:43:06 +00:00
Grischa Brockhaus 398287ea06 serendipity_parseFileName didn't evaluate the correct name/ext structure for files without extension 2007-07-17 03:46:04 +00:00
Garvin Hicking a05d7146cc document 2007-07-16 08:52:56 +00:00
Garvin Hicking f73ae1012e Wrong used hook 2007-07-16 07:34:42 +00:00
Garvin Hicking 9214efe896 Fix comment rss feeds 2007-07-15 15:13:50 +00:00
Grischa Brockhaus 03af3b154a ignorelist 2007-07-13 20:01:24 +00:00
Garvin Hicking 5839530e08 Add language constant for grischa, and fix up indending *g* 2007-07-13 12:24:18 +00:00
Grischa Brockhaus 2f3f8de21a The archive sidebar plugin shiped with s9y now displays numbers of articles correctly for month, catergories and so on, even if multicategory articles are used. (brockhaus) 2007-07-13 12:05:22 +00:00
Grischa Brockhaus 96f537447e At last: Trackbacks/pingbacks for URLs will only be sent once, no matter what link name they have or how often the URL is referenced in the article. (Phew!) ;-) 2007-07-12 15:52:58 +00:00
Grischa Brockhaus 3d61e9815a Garvins Änderung auch für (z.B.) Images funktionierend gemacht 2007-07-12 14:35:37 +00:00
Garvin Hicking 6c207fe028 Grischa and Garvin proudly present: The REAL(tm) solution. :) 2007-07-12 13:55:23 +00:00
Garvin Hicking 9f7db8d121 Revert, for the time being 2007-07-12 13:02:46 +00:00
Garvin Hicking 0c41b7b558 Admin interface security improved, thanks to Stefan Esser. 2007-07-12 11:23:05 +00:00
Garvin Hicking 472432b1b9 Merge patch from Don Chambers for better input classes in admin 2007-07-12 09:40:04 +00:00
Garvin Hicking 0eb5e4ba7a Show ID 2007-07-10 13:24:33 +00:00
Garvin Hicking 194db6a2e0 Change link to point to startpage by default 2007-07-10 08:36:11 +00:00
Grischa Brockhaus 4d4e8f2699 Made trackback/pingback functionality independend from link text.
Only the link url is relevant now. Now dupe links in entries are
not trackbacked/pingbacked twice and images w/o ALT attribute or
links with changed text won't be trackbacked again after resaving
the article.
2007-07-09 18:00:46 +00:00
Garvin Hicking 6e91373a0d brockhaus: Changed to use SPACES instead of TABs. :-) 2007-07-09 07:53:13 +00:00
Grischa Brockhaus 21d4bfd487 Changed NEWS file: plugin_comments now also supports Favatars instead of Gravatars only 2007-07-09 00:31:00 +00:00
Garvin Hicking 7f7afb21a2 For the future: Always indicate source of where frontend_display is called. Thanks to Karotte. 2007-07-08 20:07:41 +00:00
Garvin Hicking d419461f16 Textile fix by Bman 2007-07-08 18:45:46 +00:00
Garvin Hicking 584d836fb8 Favatar patch by brockhaus 2007-07-08 18:33:18 +00:00
Garvin Hicking 8be9f5438d Correct patch from brockhaus, thanks a lot 2007-07-08 18:10:33 +00:00
Garvin Hicking c341f85b09 Full pingback support, fallback trackback method for WordPress
blogs. Thanks to brockha.us!
2007-07-06 10:17:47 +00:00
Garvin Hicking 822c908f99 fix #1748918 - trnaslation mistake 2007-07-06 09:52:31 +00:00
Garvin Hicking ad110e2551 beta3 because of this publish-bug 2007-07-06 09:09:06 +00:00
Garvin Hicking 3ce5aac8f0 Use md5 for superlong uris 2007-07-05 11:10:51 +00:00
Garvin Hicking 27c3a5c8c0 Clarify 2007-07-03 18:36:04 +00:00
Garvin Hicking 967da1ca15 Fix pingback XML, thanks to Slim 2007-07-03 08:19:07 +00:00
Garvin Hicking ffbf5519db Wrong config option 2007-07-02 14:08:01 +00:00
Garvin Hicking af6168f26f Remove debug out 2007-07-02 11:59:27 +00:00
Garvin Hicking deb2124037 SQLite compatibvility 2007-07-02 10:26:03 +00:00
Garvin Hicking 33395410b4 Encody title 2007-06-30 11:31:15 +00:00
Garvin Hicking 81f2053d32 Event calendar 2007-06-28 14:24:39 +00:00
Garvin Hicking dba7ce4187 german translation 2007-06-28 13:28:01 +00:00
Ivan Cenov b6e6126d48 1) BG translation for new texts constants. 2007-06-28 06:20:44 +00:00
Garvin Hicking 20ed238aaf Fix default setting for fetching plugins via spartacus 2007-06-27 14:33:19 +00:00
Garvin Hicking bb17758b5a Also allow 'comment by author' views without author name 2007-06-26 11:40:07 +00:00
Garvin Hicking 45d6ff6698 * (beta2) Fix when saving personal configuration the userlevel and
"no_create" flags where not properly saved, thanks to PHPaws!
2007-06-24 10:49:43 +00:00
Garvin Hicking 657facf7d7 fix parse error 2007-06-22 12:51:55 +00:00
Garvin Hicking 09fa64e230 Update new bots 2007-06-21 10:49:49 +00:00
Garvin Hicking acf269611c Also allow tu submit dupliate URLs AND duplicate linktexts. Thanks to Evil Azreal. 2007-06-20 11:51:15 +00:00
Garvin Hicking cac816382a Patch reference handling function so that it can deal with multiple identical URLs 2007-06-20 11:31:52 +00:00
Garvin Hicking f82e869799 Fix wrong timestamp generation when invalid archive dates are submitted, thanks to Deminy 2007-06-18 11:57:15 +00:00
Garvin Hicking 0447681d2d fix bug 1738762 2007-06-18 10:47:59 +00:00
Garvin Hicking 9e6bf834f0 Fix SQL injection reported by Dr. Neal Krawetz 2007-06-17 10:45:24 +00:00
Garvin Hicking 7747c8203d allow to configure icon url, patch by sapphirecat on the forums 2007-06-14 09:34:28 +00:00
Garvin Hicking b85f59c80c Rever rlazo patch which broke UTF-8 spanish lang :)
Remember to encode the files differently. ;)
2007-06-14 09:30:08 +00:00
Garvin Hicking 0947729d16 Use HTTP 404 where needed 2007-06-14 09:14:15 +00:00
Rodrigo Lazo 97410ba98d Updated spanish translation 2007-06-13 15:50:38 +00:00
Garvin Hicking 5feb8559ba Try to solve a cookie problem when using s9y with domains like 'localhost' 2007-06-13 09:36:26 +00:00
Garvin Hicking 734afacb50 Fix bad admin query, thanks to Urs Enke 2007-06-12 12:43:17 +00:00
Garvin Hicking fbb11af1b5 Fix comment editing panel being able to set circular reference on "in reply to" option. Thanks to Urs Enke! 2007-06-12 10:00:26 +00:00
Garvin Hicking 22c02491e6 Fix bugs in the new backend templates 2007-06-11 14:32:32 +00:00
Garvin Hicking 21ff681015 Add hooks for approving and deleting a comment 2007-06-11 12:20:31 +00:00
Garvin Hicking fc815b25eb fix parse error 2007-06-11 10:15:01 +00:00
Garvin Hicking d5a1fad4b0 Fix pgsql bug with empty value 2007-06-08 11:41:15 +00:00
Garvin Hicking 4dd754b42e Array check 2007-06-08 09:21:37 +00:00
Garvin Hicking 91d3c1feea Support random ordering, patch by chrisbra 2007-06-08 08:52:02 +00:00
Ivan Cenov 36bab9a51e 1) Changed string constant in BG lang files. 2007-06-06 13:20:51 +00:00
Garvin Hicking f43ec9ec20 Leave margin-bottom as it is, because people alway have issues with their missing margins of <p> elements 2007-06-06 09:37:36 +00:00
Garvin Hicking 487f8beae0 Fix URL permalink lookup in some cases 2007-06-06 09:11:00 +00:00
Tadashi Jokagi b91764fca1 * translation updated. 2007-06-06 04:23:06 +00:00
Garvin Hicking 494c19ce4a Ensure not using 'online_repository' as pluginPath 2007-06-05 11:44:34 +00:00
Garvin Hicking c8572b58f7 fix back to blog variable 2007-06-05 08:50:33 +00:00
Garvin Hicking 2eeec7f1db Prepare release the beta 2007-06-05 08:17:53 +00:00
Garvin Hicking 9e73c330c8 Beautify, add missing code comments 2007-06-05 07:58:47 +00:00
Garvin Hicking ed5a65320d Add smaty modifier that can pass referenced variables to a smarty plugin api. Hurts to see that, but seems to be the only way 2007-06-01 15:31:54 +00:00
Garvin Hicking 049336103e Allow plugins to set different entry templates for the editing form.
This can allow a plugin to offer dedicated entry templates depending on the selected category, based on the user or other cool stuff.
2007-05-30 20:18:33 +00:00
Garvin Hicking 9fdc5ac9e9 Add JS selector 2007-05-30 11:59:56 +00:00
Garvin Hicking cff33ccb4d Allow possibility to style the backend (surrounding layout + entry editor so far) 2007-05-30 11:20:53 +00:00
Ivan Cenov f3a346d533 1) Updated BG lang files. 2007-05-28 20:35:08 +00:00
Tadashi Jokagi 58c95d2f97 * translation updated. 2007-05-27 20:41:48 +00:00
Jude Anthony 7a7d70fa7c Added media selector type 2007-05-25 03:27:24 +00:00
Garvin Hicking eb52237de0 Also support renaming folder (hopefully ;) ) 2007-05-23 10:09:48 +00:00
Garvin Hicking 09c2583745 . 2007-05-21 14:47:54 +00:00
Garvin Hicking b657a94cf4 Better plugin hooks 2007-05-21 13:37:31 +00:00
Ivan Cenov 0beb001229 1) Corrected $i18n_filename_to array in serendipity_lang_bg.inc.php. 2007-05-20 19:13:53 +00:00
Garvin Hicking 90e26a8c70 Add sqlite3 support, by geekmug 2007-05-18 07:59:14 +00:00
Garvin Hicking 07788cf528 Fix pgsql bug for getting all links to an entry 2007-05-16 14:12:45 +00:00
Garvin Hicking 3a50d73d9c Patch HTTP-host cookies and basepath detection, by Rob 2007-05-16 13:29:28 +00:00
Garvin Hicking 78cc09f15f Future compatibility 2007-05-16 10:12:47 +00:00
Garvin Hicking 8f84c5f619 fix bug #1719484 - wrong swedish locale 2007-05-15 18:32:17 +00:00
Garvin Hicking 78c469ef72 Add permalink URL substitution, patterns by robi-bobi 2007-05-15 07:31:35 +00:00
Ivan Cenov 7c66c102af 1) Changed one string in BG translation. 2007-05-14 16:11:29 +00:00
Garvin Hicking e760ccfabd Fix pgsql IS NULL issue, thanks to Evil Azrael from the forums 2007-05-10 10:06:40 +00:00
Garvin Hicking 3e92cb82e4 support IPv6 lengths 2007-05-02 08:56:17 +00:00
Garvin Hicking c367fbf6ab document 2007-04-25 10:01:19 +00:00
Garvin Hicking d4a4dd9f81 Only use 255/200 characters of HTTP user agent/referer strings, more don't fit into tables 2007-04-25 10:00:36 +00:00
Garvin Hicking c0e1e600d6 lang update, patch #1704483 by thijs kinkhorst 2007-04-24 10:16:52 +00:00
Garvin Hicking 5478e4358c remove error msg 2007-04-24 08:20:18 +00:00
Garvin Hicking 3ce208fdf6 Use int11, as it's pgsql compatible 2007-04-20 09:17:56 +00:00
Garvin Hicking 786629850a Revert this file to ISO format 2007-04-18 07:52:35 +00:00
Garvin Hicking 6c64a25d3f * Fix bug in conjunction with PHP 5.2.1 changed variable-by-reference
handling that could result in no groups being listed for author
      accounts (garvinhicking)
2007-04-17 11:12:05 +00:00
Garvin Hicking 5cb3be35fe Check for proper array 2007-04-17 10:26:08 +00:00
Garvin Hicking 12af228d66 not yet implemented issue, reported on the forums 2007-04-17 08:23:50 +00:00
Garvin Hicking ed6bf03d63 Proper ' vs. " usage 2007-04-16 10:14:23 +00:00
Garvin Hicking 8c0c46eeae * Fix redundant space when inserting links through the non-WYSIWYG
editor panel. Fix "null" insertion. Thanks to Alp Uckan.
2007-04-16 10:09:44 +00:00
Garvin Hicking 7b5370c5ac Remove not-so-well working memusage 2007-04-15 13:27:54 +00:00
Garvin Hicking a90530e230 Add russian translation by SADtg 2007-04-12 09:41:15 +00:00
Garvin Hicking 4cdbb7ccf1 fix typo that made rss-fullfeed things to not properly work as intended 2007-04-12 09:34:12 +00:00
Garvin Hicking 15288daadd CSS charset header must be emitted, thanks to SADtg 2007-04-12 09:22:44 +00:00
Garvin Hicking c580fa35d3 Strip tags from comments also in RSS-Feeds for comments, thanks to
tmix from the forums (garvinhicking)
2007-04-11 10:17:10 +00:00
Garvin Hicking a26b41cfd2 Fix tracbkacks. Once again. Hopefully now all cases are handled ;) 2007-04-10 13:45:54 +00:00
Garvin Hicking bc46b71a94 * Patch #1697590: Proper directory name of SQLite DB-error messages,
thanks to Thijs Kinkhorst
2007-04-10 13:23:34 +00:00
Garvin Hicking f7e6f3d9c7 Session-init, redone 2007-04-10 13:10:33 +00:00
Garvin Hicking d58a8c5b6e Enabled CacheControl by default 2007-04-10 09:20:21 +00:00
Garvin Hicking e4a93ebfdc Use readTimeout HTTP::Request option to reduce timeout issues,
by isotopp (http://blog.koehntopp.de/archives/1651-Trackback-spam-swamping-my-apache....html)
2007-04-10 07:16:27 +00:00
Garvin Hicking 86c65016bc Fix bad prev/next permalinks when using wrapper.php embedding 2007-04-05 09:33:48 +00:00
Garvin Hicking e44a22cf06 Display theme's preview_fullsize.jpg image when existing. 2007-04-03 08:21:34 +00:00
Garvin Hicking fc3f385986 Add large preview files by williamts99 2007-04-03 08:13:13 +00:00
Garvin Hicking a557a58979 Upgrade Smarty to 2.6.18 2007-04-02 08:06:52 +00:00
Garvin Hicking 30ccea2f96 Make plugins be able to emit custom RSS feeds, see http://board.s9y.org/viewtopic.php?p=53320#53320 2007-04-01 11:55:46 +00:00
Garvin Hicking 44953ecea7 * Fix missing %username% permalink pattern in single entry view.
Patch by cress_cc
2007-04-01 11:16:23 +00:00
Garvin Hicking e33b0b27af Allow non-standard port specification 2007-03-30 10:02:05 +00:00
Garvin Hicking 85e3e5b483 Show current captcha look in the plugin configuration menu 2007-03-26 09:37:41 +00:00
Ivan Cenov d8038f5a8e 1) Updated BG language files. 2007-03-24 08:24:37 +00:00
Garvin Hicking 3317e6ef49 Add new category property to hide blog postings made into sub-categories from the frontend view, per category. Thanks to netmorix from the forums! 2007-03-22 11:43:59 +00:00
Garvin Hicking 85158ff752 Language additions 2007-03-22 11:41:57 +00:00
Garvin Hicking 32823fbd56 Improve usability by removing possibly dangerous options from personal configuration and moving them to the user management. Also rename the description options for those options.
Thanks to lendulado from the forums for these suggestions.
2007-03-22 10:27:18 +00:00
Garvin Hicking 66a0ae83ca Make RSS plugin support to display multiple RSS field elements by separating with ",". 2007-03-22 09:59:49 +00:00
Garvin Hicking 99c02a090c Fix track exit ids off by one when being used in conjunction with caching plugin 2007-03-21 10:53:46 +00:00
Garvin Hicking 46aff63080 fix comma, thanks to jez 2007-03-20 09:00:40 +00:00
Garvin Hicking 8704a7a743 Allow to bypass second loadThemeOptions() call 2007-03-19 13:48:31 +00:00
Garvin Hicking 57ad449f32 Revert permalink change, breaks too much.
Instead, freetag plugin was patched
2007-03-19 08:36:38 +00:00
Tadashi Jokagi 8102fd2de6 * translation updated. 2007-03-18 13:07:29 +00:00
Garvin Hicking 813b275786 Fix dot character problem in permalinks like the freetag plugin not giving proper pagination 2007-03-15 10:05:04 +00:00
Garvin Hicking 1dbdbf1f51 Add missing constant 2007-03-11 13:34:15 +00:00
Garvin Hicking 88188ee8e3 * Fix permalink patterns for some cases to properly detect pagination variables instead of interpreting search words as those (garvinhicking) 2007-03-11 12:50:42 +00:00
Garvin Hicking 9d6e2b8a97 Use old default setting 2007-03-11 12:35:50 +00:00
Garvin Hicking 544360dad3 Remove optimization, was causing trouble... 2007-03-09 09:25:51 +00:00
Garvin Hicking f3148062ae Add 'serendipity_xml_icon' CSS class to links for XML icons to authors and syndication plugin 2007-03-09 09:04:40 +00:00
Ivan Cenov 2cfb1d6f0a 1) Added forgotten $Id keyword. 2007-03-08 18:09:58 +00:00
Ivan Cenov 723098609e 1) Translated serendipity_event_weblogping into BG.
2) Removed typing error.
2007-03-08 18:06:13 +00:00
Garvin Hicking 90b8af7cd5 Fix SQL error message display when invalid categories selected 2007-03-01 19:54:27 +00:00
Garvin Hicking f8ba3a8a0c Fix is_array() check 2007-03-01 11:06:56 +00:00
Garvin Hicking b4bfc40ae1 Allow for some more benchmarkiness 2007-02-27 12:15:00 +00:00
Garvin Hicking cb416979a3 Optimize to avoid duplicate fetch 2007-02-27 12:14:20 +00:00
Garvin Hicking 5911f9e54e Improve SQL query for fetching archive overview, from $year*$month queries to 1. :-) 2007-02-27 11:20:47 +00:00
Garvin Hicking 400b761623 Improve installation on hosts where fsockopen() is disabled 2007-02-26 14:42:04 +00:00
Garvin Hicking 96a1de7ce5 Fix CSS class spacing, thanks to Own Stubbs 2007-02-26 07:51:04 +00:00
Garvin Hicking ff150a6f4d EXPERIMENTAL: Shuffled language, required for future authentication themes like OpenID. By Rob Richards 2007-02-23 13:57:39 +00:00
Garvin Hicking 5067eaf054 Better checks to see if the local PEAR inclusion is required 2007-02-22 11:56:26 +00:00
Garvin Hicking 35bcbda057 Remove not yet supported filter call 2007-02-22 09:40:01 +00:00
Garvin Hicking 0c51294707 Unneeded 2007-02-22 09:21:09 +00:00
Garvin Hicking e3813e51b0 Restore old version 2007-02-22 09:07:13 +00:00
Garvin Hicking 791fbb7b0c Downgrade to previous version, keep file count low. See mailinglist 2007-02-22 09:01:43 +00:00
Garvin Hicking 991d8c4438 Fix spelling, thanks to YellowLED 2007-02-21 09:22:12 +00:00
Garvin Hicking bf7cc7e266 No longer accept trackbacks to draft entries.Thanks to j_b_poquelin 2007-02-15 08:46:23 +00:00
Garvin Hicking bf196aa3ea * Do not store an unnecessary config value for check_password
and password user properties. Thanks to jenzo from the forums!
      (garvinhicking)
2007-02-14 14:06:41 +00:00
Garvin Hicking 50401a7d02 Fix showing proper plugin permissionship plugin 2007-02-13 08:35:53 +00:00
Garvin Hicking 075e9ea1d5 * Patch pingback receiving function to use proper Regexp, thanks to
dhaun from the forums
2007-02-12 12:12:31 +00:00
Sebastian Nohn ad19f1fd34 * upgrade to latest net_dnsbl (incl. dependencies) 2007-02-11 16:47:44 +00:00
Garvin Hicking 70adf0857b Update spamblock plugin to update a .htaccess file with DENY rules based on recent spammer IPs. EXPERIMENTAL. 2007-02-09 10:42:03 +00:00
Garvin Hicking 742fd47078 Shared http/https sessions by rob richards from the forums 2007-02-08 12:08:43 +00:00
João Palhoto Matos a6c06ba22a pt_PT updates 2007-02-08 11:36:48 +00:00
Garvin Hicking 6a9adfbe2a Support freetag plugin 2007-02-08 10:40:01 +00:00
Garvin Hicking 5c255ef5dc Polish update by Costa 2007-02-06 08:35:09 +00:00
Garvin Hicking 8c68e837e4 Added PDO::Postgres DB-layer support by Theo Schlossnagle 2007-02-06 08:27:29 +00:00
Garvin Hicking ecad5cd095 fix typo, thanks to muhaha from the forums 2007-02-01 11:36:16 +00:00
Ivan Cenov f12dea82a0 1) Updated BG labguage files. 2007-01-29 17:21:49 +00:00
Garvin Hicking 58b9711569 Remove utf8 bom 2007-01-29 13:49:03 +00:00
Garvin Hicking ecad6767b5 Update by Sam for nl lang 2007-01-29 08:44:12 +00:00
Garvin Hicking 9cb36cbf1c Strict check fix from judas iscariote 2007-01-29 08:26:18 +00:00
Garvin Hicking 5c06285413 Allow to transfer smilies at word beginning 2007-01-26 10:01:30 +00:00
Garvin Hicking 0c7cc82bc8 Dutch translation update with many fixes by Sam Geeraerts 2007-01-26 09:26:10 +00:00
Garvin Hicking 10613f61d6 Patch by Lars to improve quicksearch usability 2007-01-26 08:27:36 +00:00
Garvin Hicking 5b291b012f Another bbcode quote fix by jtb 2007-01-23 09:17:28 +00:00
Garvin Hicking b3266d6c91 Statistics plugin update by Blase16, see http://board.s9y.org/viewtopic.php?t=8561 2007-01-23 08:46:48 +00:00
Garvin Hicking 4883107797 Add missing message part, thanks to samgee 2007-01-22 12:36:05 +00:00
Garvin Hicking 264b804182 Moved drag+drop and YahooUI library into templates/default/ to be used in shared installation environments 2007-01-22 12:11:49 +00:00
Garvin Hicking 0fb606a927 Allow some WP import tweaks by jtb 2007-01-22 10:45:39 +00:00
Garvin Hicking 1d08aa4633 TB 2007-01-18 16:07:34 +00:00
Garvin Hicking f5597d0d6f More verbosity to the serotonics around the world 2007-01-18 14:44:59 +00:00
Garvin Hicking 2e8060ffd2 Remove debug code 2007-01-17 07:52:30 +00:00
Ivan Cenov 4bb4b3fcf0 1) Updated BG translation after changes in EN files. 2007-01-16 09:09:34 +00:00
Garvin Hicking 9e45da4cac Usability tweak, move next/prev navigation to top and bottom 2007-01-14 16:51:06 +00:00
Garvin Hicking e718ea5a5d Lang fixes by Davy for netherland language 2007-01-14 16:27:32 +00:00
Garvin Hicking 771ed87414 Show category name before deleting 2007-01-14 16:25:14 +00:00
Garvin Hicking 1fa8e41198 Allow spartacus plugin to configure which repositories to connect to 2007-01-14 16:21:08 +00:00
Garvin Hicking 773fab8ab5 Remove 'View' option for drafted entries in the 'Edit entries' section and replace with a 'Preview' option. 2007-01-14 16:06:03 +00:00
Garvin Hicking 87e7e92402 Make spamblock plugin be more verbose in moderation-queue emails. RFE #1626712 2007-01-14 15:33:48 +00:00
Garvin Hicking e3126439aa Language fixes by Manuel Charisius 2007-01-14 15:27:09 +00:00
Garvin Hicking 7206ae2a19 BBcode improvements by jez hancock 2007-01-14 15:21:36 +00:00
Garvin Hicking e23a9dd640 Patch categories plugin 2007-01-14 14:56:47 +00:00
Garvin Hicking 855f94e11b * Change order of trackback execution flow (again) to preserve
references for plugins like Track Exits, when used in conjunction
      with the entryproperties cache (garvinhicking)
2007-01-14 14:49:28 +00:00
Garvin Hicking e1589d45f9 Prepare DB structure upgrade 2007-01-14 14:47:52 +00:00
Garvin Hicking 5e8f711f77 Upgrade spartacus to perform stricter content-filtering checks 2007-01-14 13:57:20 +00:00
Garvin Hicking fa724f71c7 mbstring check by mila 2007-01-14 12:55:58 +00:00
Garvin Hicking 693f92156d Fix more problems of SSL-cookie error on IIS 2007-01-12 08:33:43 +00:00
Garvin Hicking f22bc257b6 Fix a bug that prevented some entryproperty-plugins to execute on the entry detail pane. Thanks to dragonblast from the forums 2007-01-12 08:23:00 +00:00
Garvin Hicking 5b55ba0939 allow longer author names, db update. 2007-01-12 08:13:36 +00:00
Garvin Hicking 3847f10cd5 Dutch translation by Jeffrey Lankamp 2007-01-10 09:31:34 +00:00
Garvin Hicking 2b0f791e8e Fix Windows IIS server cookie login problem, thanks to Shadowin 2007-01-04 19:57:11 +00:00
Garvin Hicking a73031b05c proper german utf-8 translation 2007-01-02 10:37:47 +00:00
Garvin Hicking bffc773cdf Allow to make shared installs have their own config file, patch by stm9x9 2007-01-02 10:15:53 +00:00
Garvin Hicking eaf92da865 document 2006-12-29 22:36:54 +00:00
Garvin Hicking a78fc9ba32 Remove / patch because it creates more problems than it solves. Real fix should be to properly set the serendipityHTTPPath in the configuration on blogs that run on the root 2006-12-28 20:25:23 +00:00
Garvin Hicking 5f92fbf8bb Shorten experimental theme names 2006-12-28 19:48:39 +00:00
Omid Mottaghi b3ef361117 new admin images 2006-12-27 10:44:59 +00:00
Omid Mottaghi 07cd3719c4 captcha updated. 2006-12-27 10:42:02 +00:00
Omid Mottaghi f3ac97c9d8 added a class to captcha-image-div. captcha MUST be LTR in all languages. 2006-12-27 10:39:06 +00:00
Andrew Huang 0b45fc7517 update on traditional Chinese 2006-12-26 07:21:10 +00:00
Garvin Hicking 48870c3682 Commit polish update by costa 2006-12-20 18:26:17 +00:00
Jude Anthony 15bc906357 Made text different from background, per forum thread 2006-12-18 16:29:07 +00:00
Jude Anthony 08b8be6e15 Implemented slash fix suggested in forums by Timbalu 2006-12-18 16:04:20 +00:00
Garvin Hicking 740a740092 Fix showing the entry owner in preview, not the currently logged in author 2006-12-11 11:52:18 +00:00
Garvin Hicking f24dd3f3e4 Color code spartacus messages 2006-12-11 10:19:44 +00:00
Garvin Hicking d5d1bf942d German translation 2006-12-11 08:59:52 +00:00
Garvin Hicking 4f3bc51427 Fix installer path detection by wagwag 2006-12-11 08:37:10 +00:00
Jude Anthony f42a99e694 Check for firewalls, using Google as the dipstick.
Attempt CURL download if HTTP_Request fails.
Report IP so repository for site admins to open outgoing connections .
Language constants for new checks and firewall notice.
2006-12-08 19:35:57 +00:00
Garvin Hicking c5743298d5 fix parse error 2006-12-07 12:04:28 +00:00
Garvin Hicking 55cbd7885a One more permalink patch 2006-12-06 14:59:11 +00:00
Garvin Hicking 41e94b2d5f Let's go 1.2 2006-12-06 14:57:17 +00:00
Garvin Hicking 13ca05585a Czech update by SuE from the forums 2006-12-04 09:20:14 +00:00
João Palhoto Matos 9fc8fd002b pt_PT corrections 2006-12-03 13:28:18 +00:00
Garvin Hicking 7136f4e7ef proper definition 2006-12-01 18:46:55 +00:00
Garvin Hicking 9b67bdd517 Make plugins bail out if called directly 2006-12-01 08:58:47 +00:00
Garvin Hicking 1c71f7032d version increment 2006-12-01 08:01:17 +00:00
Garvin Hicking 2a6f0fb006 Adjust release 2006-12-01 07:49:13 +00:00
Garvin Hicking fe8b6853fc Disable helper 2006-11-30 21:42:01 +00:00
Garvin Hicking f03841587a Ensure to not be able to call s9y files under circumstances where .htaccess does not deny request AND register_globals is turned on 2006-11-30 21:34:29 +00:00
Garvin Hicking e5014b2b78 remove debug 2006-11-28 14:48:59 +00:00
Garvin Hicking aa49ca211c fix typo for proper 2006-11-28 14:40:42 +00:00
Garvin Hicking 1ac6f4a2d4 Small bugfix for category sorting and HTTP-Auth 2006-11-23 11:27:07 +00:00
Garvin Hicking d96d9a4df0 Use 'html' instead of 'htmlall' modifier 2006-11-23 11:20:43 +00:00
Garvin Hicking abae07741c Bundle bookmarklet 2006-11-22 10:30:13 +00:00
Omid Mottaghi e0de07417a Persian Language updated for version 1.1 2006-11-17 20:57:15 +00:00
Garvin Hicking 8c39e98eef Fix pgsql lowercase plugin problem 2006-11-17 15:20:04 +00:00
Garvin Hicking ced49d9cb9 remove unstrict check 2006-11-17 15:19:07 +00:00
Ivan Cenov 0e88f488ce 1) BG translation of new strings in serendipity_event_nl2br plugin. 2006-11-16 17:39:33 +00:00
Garvin Hicking abb5f4e7f7 Fix UTF-8 BOM 2006-11-16 09:31:52 +00:00
Garvin Hicking 43b8b1a3a3 Fix content of entry sending trackback to/from 2006-11-16 08:33:32 +00:00
Garvin Hicking e2632879ec Properly disable markup when previewing 2006-11-16 08:21:25 +00:00
Garvin Hicking eb3e171f6e Restore english UTF-8 language file :) 2006-11-15 12:52:20 +00:00
Rodrigo Lazo 138ffff1b3 spanish translatation update 2006-11-15 12:34:59 +00:00
Garvin Hicking 7e234bd7b6 More Obscurity and less PR makes Absynth a glad boy 2006-11-15 10:21:14 +00:00
Garvin Hicking 3e708320bb Awesome MySQL tuning for our central query by Matthew Groeninger 2006-11-15 10:18:43 +00:00
Garvin Hicking d9d2317f23 Remove errenous commit 2006-11-14 10:02:28 +00:00
Garvin Hicking 233195680f Proper placing 2006-11-14 09:23:16 +00:00
Sebastian Nohn 4ab2a93be8 * add test for create user function 2006-11-12 09:49:21 +00:00
Garvin Hicking 460d8ad352 More swedish translations by crapmaster frmo the forums 2006-11-09 08:38:56 +00:00
Garvin Hicking 890f09b716 Prepare a patch for 1.2, as we have no branch for that yet 2006-11-08 20:20:49 +00:00
Sebastian Nohn 7661964383 * add filter for php 5.2.0 2006-11-05 11:25:03 +00:00
Garvin Hicking d8b6f64833 We don't need no education 2006-11-05 11:20:15 +00:00
Garvin Hicking 9e4a7fb8ba document backports 2006-11-05 11:16:29 +00:00
Garvin Hicking dec57bdf82 * Fix a problem where spartacus did not properly assign configured
permissions to downloaded directories, thanks to danilo from
      the forums!
2006-11-03 20:04:12 +00:00
Garvin Hicking b16733cf40 Shuffle trackback logic to the end of entry-save process. Thanks to isotopp. 2006-11-03 16:41:52 +00:00
Sebastian Nohn 75483ee2fe * revert 2006-11-03 16:10:02 +00:00
Ivan Cenov 9ff48dba7a 1) Updated BG translation of s9y_event_karma. 2006-11-02 20:04:07 +00:00
Sebastian Nohn 6e63f3ed13 * hotfix to ensure compatibility php 5.2.0 2006-11-02 19:41:54 +00:00
Garvin Hicking 466b067287 Fix a pgsql update routine error, thanks to ads from the forums 2006-11-02 11:34:15 +00:00
Garvin Hicking e6500e8285 Use ?frontpage url 2006-11-02 11:31:17 +00:00
Garvin Hicking 4bf4baa47e Danish translations by Henrick Schack 2006-11-02 11:26:10 +00:00
Garvin Hicking 1b1991a697 Add feedburner recognittion for "bad" caching.
RFE #1588802
2006-11-02 11:20:35 +00:00
Joseph Tate b196058eb3 Merge from 1.0 2006-10-31 15:55:26 +00:00
Garvin Hicking 06c5105c91 More dutch fixes 2006-10-31 08:53:51 +00:00
Garvin Hicking 6b02e66e03 also set VIEW when calling directly 2006-10-31 08:34:19 +00:00
Garvin Hicking c52694f31c Portuguese update by Angel 2006-10-30 21:02:28 +00:00
Garvin Hicking d7f12ea274 fix bug #1586289, strict array check 2006-10-30 14:21:36 +00:00
Sebastian Nohn a710ef0ee0 * add simple comment testcase 2006-10-29 10:06:09 +00:00
Sebastian Nohn b80c0731b6 * add create simple article testcase, make tests language-independent 2006-10-29 09:17:13 +00:00
Sebastian Nohn 77b0377557 * be more idiot-proof with the tests 2006-10-28 16:16:59 +00:00
Sebastian Nohn 5e524fbca1 * introduce basic tests 2006-10-28 16:13:20 +00:00
Garvin Hicking 60618ff95c Of course not everything deservers committing ;-) 2006-10-27 09:20:03 +00:00
Garvin Hicking 992524f9b3 Fix import UTF-8 bug, thanks to jan 2006-10-27 09:18:19 +00:00
Ivan Cenov f47667794f 1) BG translation of new text constants. 2006-10-26 20:36:04 +00:00
Garvin Hicking dc63c4637c Make authors plugin not show authors with less than X articles 2006-10-26 20:05:04 +00:00
Garvin Hicking 208da39475 dutch fix by oeli 2006-10-26 10:02:44 +00:00
Garvin Hicking 4c823b9d47 Preview correction 2006-10-26 09:46:53 +00:00
Garvin Hicking 41dd356d45 Admin-based comment response, CSRF-protection for comment form in antispam plugin 2006-10-26 09:41:10 +00:00
Garvin Hicking 5ae78da826 Checkbox-based multi-entry deletion, fix admin entry pagination to not show empty paginated pages on the last page 2006-10-25 08:27:16 +00:00
Garvin Hicking 03886b49bc Add new variable to make serendipity be deaf, mute and blind. Have fun, absynth :) 2006-10-24 22:03:19 +00:00
Garvin Hicking 7962992a26 Fix problem with %username% permalinks 2006-10-24 19:46:20 +00:00
Garvin Hicking a88887e4c5 reset proper draft privileges for published entries and authors without having the permission to save published entries 2006-10-23 09:46:19 +00:00
Garvin Hicking 8df915bcf5 Fix gazillion comment count bug 2006-10-23 07:32:37 +00:00
Ivan Cenov 291028d985 1) Added UTF-8 variant for serendipity_event_contentrewrite/lang_bg.inc.php 2006-10-21 18:28:23 +00:00
Ivan Cenov 12778efd53 1) Added BG translation of serendipity_event_contentrewrite plugin. 2006-10-21 18:20:53 +00:00
Matthew Groening 7b44611f37 Do not display the directory change option for hotlinks. 2006-10-19 14:31:18 +00:00
Garvin Hicking a1502914bc Beta5 2006-10-18 12:40:25 +00:00
Garvin Hicking e5f078a540 Add danish treanslations by Henrik Schack 2006-10-16 12:33:00 +00:00
Garvin Hicking 99f7e0d9a7 indicate size to opera, by stm9x9 2006-10-13 13:53:25 +00:00
Sebastian Bergmann 9ea0af10fb Allow configuration of title for archives plugin. 2006-10-13 12:25:09 +00:00
Garvin Hicking 0674c0256f Add google ping
safer check for "filter" extension
2006-10-11 18:59:31 +00:00
Garvin Hicking f5f0a66acc Make title configurable 2006-10-11 08:02:40 +00:00
Garvin Hicking 64b8c865f7 Highlight sticky entries in admin interface 2006-10-09 11:20:07 +00:00
Garvin Hicking 7545df9d1a Set the 'view' variable to 'plugin' when event plugins take on a full entry page 2006-10-09 11:00:17 +00:00
Garvin Hicking 35542d1274 Update filesize when resizing image, thanks to deminy 2006-10-09 10:44:41 +00:00
Garvin Hicking 9c85c0349f Show mis-assigned plugins when a template supports custom sidebars 2006-10-09 09:19:39 +00:00
Garvin Hicking 20dce86770 Proper unescape. Thanks to Stefan Esser 2006-10-05 14:05:35 +00:00
Garvin Hicking 68f51cd5af Escape JS specific characters 2006-10-05 11:45:34 +00:00
Matthew Groening 8191755ec8 Fix faulty header output in bundled XML-RPC Server.php. (Originally found in serendipity_event_xmlrpc) 2006-10-04 21:50:18 +00:00
Garvin Hicking a8562c5783 Add new hooks 2006-10-04 08:16:42 +00:00
Garvin Hicking 8acffb2eaa fix french problem 2006-10-03 15:52:17 +00:00
Jude Anthony d4c2ec72e3 Use correct server offset; found by JohnnyPark of forums. 2006-09-29 02:00:02 +00:00
Jude Anthony e1a2834d91 Add search term highlighting, in the form of <span> tags with
both foundterm and foundtermN class.
2006-09-27 02:36:37 +00:00
Garvin Hicking 8eea0968e0 Upgrade remoteRSS plugin 2006-09-14 08:45:13 +00:00
Garvin Hicking dcdf147af1 Allow to use Cache-Control 2006-08-30 09:51:59 +00:00
Garvin Hicking 509a065caf Use secure HTTPS cookies 2006-08-30 09:13:50 +00:00
Garvin Hicking 9041bda1a0 MAke it work for pgsql. thanks to xzilla! 2006-08-29 17:36:11 +00:00
Garvin Hicking 1ef15032dd Fix typo 2006-08-29 16:18:19 +00:00
Jude Anthony 6b1eec3f70 Use ?frontpage for category_link_all 2006-08-29 11:38:14 +00:00
Jude Anthony 3047691a3c Change all_categories link to include ?frontpage 2006-08-29 11:36:33 +00:00
Jude Anthony 14390399da Touch thumbnail file before saving to allow safe_mode thumbnailing 2006-08-29 11:32:32 +00:00
Ivan Cenov 19821f6cc1 1) Removed ?> <LF> at the end that prevented RSS feeds. 2006-08-29 10:25:22 +00:00
Ivan Cenov db4ffe1f27 1) BG translation of new text constant. 2006-08-28 16:57:01 +00:00
Ivan Cenov 586835d1f0 1) BG translation of several text constants. 2006-08-28 16:54:00 +00:00
Garvin Hicking a6c89547c9 New 'sidebar' template configuration option. EXPERIMENTAL 2006-08-27 20:44:55 +00:00
Garvin Hicking 45c6d01eeb Fix regular expression bug 2006-08-27 17:33:49 +00:00
Garvin Hicking 196a797255 Add spaces, helps textile 2006-08-27 17:24:28 +00:00
Garvin Hicking 0fa785d1a6 Fix orphaned categories, textile plugin, smarty commentform function 2006-08-27 11:29:00 +00:00
Garvin Hicking de2f7fe707 Fix gmdate function for proper parameters 2006-08-25 13:20:34 +00:00
Garvin Hicking dce6033d60 Fix ) issue 2006-08-25 12:14:42 +00:00
Garvin Hicking 197197131a Make 'target' attribute configurable 2006-08-24 09:33:19 +00:00
Garvin Hicking ae10cad21c Major new feature: Allow to restrict plugin hooks and plugins to only specific usergroups 2006-08-23 13:51:56 +00:00
Garvin Hicking bfaa79709f Lang update 2006-08-23 13:47:50 +00:00
Ivan Cenov 3af4ac8749 1) Translated new string constant to BG language. 2006-08-22 11:03:16 +00:00
Matthew Groening 72388a349b Patched serendipity_displayImageList() to only sync images when $limit_path is NULL and $manage is false.
Bumped version to beta3 for better version management on plugins.
2006-08-21 18:09:20 +00:00
Garvin Hicking 89f459855c Fix a stupid parse error :) 2006-08-21 17:53:43 +00:00
Garvin Hicking 2f3b22e9b1 Fix some permalink situations 2006-08-21 14:34:24 +00:00
Garvin Hicking 43fbe46fd5 French translation update by thalix 2006-08-21 12:19:14 +00:00
Garvin Hicking abfd233f26 include entry title when deleting 2006-08-21 10:25:25 +00:00
Tadashi Jokagi 6c3ca1951b * fixed typo. 2006-08-19 14:39:29 +00:00
Garvin Hicking 823ff56cac Improve function to move/rename images 2006-08-18 13:15:07 +00:00
Garvin Hicking cc9329fa11 Patch by Matthew Groeninger to support applying child permissions 2006-08-18 12:01:25 +00:00
Garvin Hicking 299736566d Add nl translation by revin 2006-08-18 11:05:03 +00:00
Ivan Cenov 85aacdd434 1) Removed '\n' after '?>' at the end of files. 2006-08-18 07:36:54 +00:00
Tadashi Jokagi 20b2f8c700 * database updated. 2006-08-17 16:40:12 +00:00
Tadashi Jokagi 86d9f5f457 * translation updated. 2006-08-17 16:39:44 +00:00
Garvin Hicking b52707a821 Refresh media frame tree when directory was deleted 2006-08-17 13:20:01 +00:00
Garvin Hicking eb3c39406c Fix matching "." character for comments 2006-08-17 08:44:41 +00:00
Garvin Hicking 055aa32d6a Fix bad encoding 2006-08-17 08:32:26 +00:00
Garvin Hicking 00e76d05e7 Change directoryACL function so that Matthew can work with it properly in external plugins :) 2006-08-17 07:26:41 +00:00
Tadashi Jokagi e2d8152715 * translation updated. 2006-08-17 07:13:21 +00:00
Garvin Hicking 0ede6e9cdd Patch by Matthew: Allow strict dirs 2006-08-16 10:39:06 +00:00
Garvin Hicking 1ce4265402 Fi conditional get caching when server-timezone offset is != 0 2006-08-16 08:56:26 +00:00
Garvin Hicking 58a683eb00 Lang update, by Manuel Charisius 2006-08-16 08:45:26 +00:00
Garvin Hicking bb7fb4e5a8 Support HTTP-Authentication (especially for RSS feeds) 2006-08-16 08:28:32 +00:00
Garvin Hicking e0042430f5 Update by Manuel Charisius 2006-08-15 13:02:13 +00:00
Garvin Hicking fdf124e709 Translations by Manuel Charisius 2006-08-15 12:32:21 +00:00
Garvin Hicking 8a2b2bde46 Fix array check 2006-08-15 12:20:09 +00:00
Tadashi Jokagi 628ad67156 * propset. 2006-08-15 10:14:56 +00:00
Tadashi Jokagi cc1fd306d8 * change props.
* translation updated.
2006-08-15 09:11:27 +00:00
Garvin Hicking b603c9ebe3 Try to fix comments_by_author problem 2006-08-15 08:13:28 +00:00
Garvin Hicking 06534fd6cf properly rename media files 2006-08-15 07:54:09 +00:00
Garvin Hicking 1c88633caf Prepare release 2006-08-14 08:55:30 +00:00
Garvin Hicking d4612c80af rename image button to "media" 2006-08-14 08:53:19 +00:00
Sebastian Nohn bde6953635 * various fixes to german language and one constant error in installer 2006-08-11 13:50:16 +00:00
Garvin Hicking 529dca90d4 Fix wrong usage of serendipity_smarty_init() when being used multiple times 2006-08-11 12:24:32 +00:00
Garvin Hicking d55733636a fix propper order 2006-08-11 08:11:58 +00:00
Garvin Hicking 572c7244c6 Fix romanian time format 2006-08-11 07:24:26 +00:00
Tadashi Jokagi de64c3b0ba * translation updated. 2006-08-09 08:10:18 +00:00
Tadashi Jokagi c4c4a7cfe6 * split line. 2006-08-09 08:09:22 +00:00
Tadashi Jokagi 83691905dd * split line. 2006-08-09 07:35:18 +00:00
555 changed files with 58807 additions and 27863 deletions
+16
View File
@@ -0,0 +1,16 @@
uploads/*
templates_c/*
serendipity_config_local.inc.php
.cvsignore
.htaccess*
*.db
private/*
archives/*
*~
DEADJOE
plugins/additional_plugins*
/.settings
/.buildpath
/.project
.DS_Store
.editorconfig
+3 -3
View File
@@ -594,7 +594,7 @@ class HTTP_Request {
*/
function sendRequest($saveBody = true)
{
if (!is_a($this->_url, 'Net_URL')) {
if (!($this->_url instanceof Net_URL)) {
return PEAR::raiseError('No URL given.');
}
@@ -885,7 +885,7 @@ class HTTP_Request {
*/
function attach(&$listener)
{
if (!is_a($listener, 'HTTP_Request_Listener')) {
if (!($listener instanceof HTTP_Request_Listener)) {
return false;
}
$this->_listeners[$listener->getId()] =& $listener;
@@ -902,7 +902,7 @@ class HTTP_Request {
*/
function detach(&$listener)
{
if (!is_a($listener, 'HTTP_Request_Listener') ||
if (!($listener instanceof HTTP_Request_Listener) ||
!isset($this->_listeners[$listener->getId()])) {
return false;
}
-10
View File
@@ -98,16 +98,6 @@ class Net_URL
*/
var $useBrackets;
/**
* PHP4 Constructor
*
* @see __construct()
*/
function Net_URL($url = null, $useBrackets = true)
{
$this->__construct($url, $useBrackets);
}
/**
* PHP5 Constructor
*
+1 -6
View File
@@ -51,11 +51,6 @@ class ONYX_RSS
* private $type;
*/
function ONYX_RSS($charset = 'UTF-8')
{
$this->__construct($charset);
}
// Forward compatibility with PHP v.5
// http://www.phpvolcano.com/eide/php5.php?page=start
function __construct($charset = 'UTF-8')
@@ -171,7 +166,7 @@ class ONYX_RSS
clearstatcache();
if (!($fp = @fopen($file, 'r')))
{
$this->raiseError((__LINE__-2), 'Could not read contents of cache file (<em>'.$cache_file.'</em>).');
$this->raiseError((__LINE__-2), 'Could not read contents of cache file (<em>'.$file.'</em>).');
return false;
}
$this->data = unserialize(fread($fp, filesize($file)));
+8 -8
View File
@@ -253,9 +253,9 @@ class PEAR
* @access public
* @return bool true if parameter is an error
*/
function isError($data, $code = null)
static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (($data instanceof PEAR_Error)) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
@@ -311,7 +311,7 @@ class PEAR
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
@@ -498,7 +498,7 @@ class PEAR
* @see PEAR::setErrorHandling
* @since PHP 4.0.5
*/
function raiseError($message = null,
static function raiseError($message = null,
$code = null,
$mode = null,
$options = null,
@@ -563,7 +563,7 @@ class PEAR
$code = null,
$userinfo = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
return $this->raiseError($message, $code, null, null, $userinfo);
} else {
return PEAR::raiseError($message, $code, null, null, $userinfo);
@@ -659,7 +659,7 @@ class PEAR
function pushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
} else {
@@ -668,7 +668,7 @@ class PEAR
}
$stack[] = array($def_mode, $def_options);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
@@ -693,7 +693,7 @@ class PEAR
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && ($this instanceof PEAR)) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
-7
View File
@@ -1,7 +0,0 @@
Smarty is supported only in PHP 4.0.6 or later.
Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include
the path to the PEAR libraries in your php include_path. Config_file.class.php
uses the PEAR library for its error handling routines. PEAR comes with the PHP
distribution. Unix users check /usr/local/lib/php, windows users check
C:/php/pear.
+126 -419
View File
@@ -1,458 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
0. Additional Definitions.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
1. Exception to Section 3 of the GNU GPL.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
2. Conveying Modified Versions.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3. Object Code Incorporating Material from Library Header Files.
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
b) Accompany the object code with a copy of the GNU GPL and this license
document.
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
4. Combined Works.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
a) The modified work must itself be a software library.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) Do one of the following:
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
5. Combined Libraries.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
6. Revised Versions of the GNU Lesser General Public License.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
File diff suppressed because it is too large Load Diff
-284
View File
@@ -1,284 +0,0 @@
QUESTION INDEX
--------------
GENERAL
Q: What is Smarty?
Q: What's the difference between Smarty and other template engines?
Q: What do you mean "Compiled PHP Scripts" ?
Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
Q: Why does smarty have a built in cache? Wouldn't it be better to handle this
in a separate class?
Q: Is Smarty faster than <insert other PHP template engine>?
Q: How can I be sure to get the best performance from Smarty?
Q: Do you have a mailing list?
Q: Can you change the mailing list so reply-to sends to the list and not the
user?
TROUBLESHOOTING
Q: Smarty doesn't work.
Q: I get the following error when running Smarty:
Warning: Smarty error: problem creating directory "templates_c/239/239105369"
in /path/to/Smarty.class.php on line 542
Q: I get the following error when running Smarty:
Warning: Wrong parameter count for preg_replace() in
Smarty.class.php on line 371
Q: I get this error when passing variables to {include}:
Fatal error: Call to undefined function: get_defined_vars() in
/path/to/Smarty/templates_c/index.tpl.php on line 8
Q: I get PHP errors in my {if} tag logic.
Q: I'm changing my php code and/or templates, and my results are not getting
updated.
Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
also zero length.
Q: The template goes into an infinite loop when I include included templates
that pass local variables
Q: Javascript is causing Smarty errors in my templates.
Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
MISC
Q: Can I use Macromedia's Dreamweaver to edit my templates?
Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
HREF link. How do I get around this?
HOWTO
Q: How do I generate different cache files per template based on arguments
passed to the page?
Q: How do I pass a template variable as a parameter? {function param={$varname}}
does not work.
Q: How do I include cached template(s) within a non-cached template?
GENERAL
-------
Q: What is Smarty?
A: Smarty is a template engine for PHP... but be aware this isn't just another
PHP template engine. It's much more than that.
Q: What's the difference between Smarty and other template engines?
A: Most other template engines for PHP provide basic variable substitution and
dynamic block functionality. Smarty takes a step further to be a "smart"
template engine, adding features such as configuration files, template
functions, variable modifiers (see the docs!) and making all of this
functionality as easy as possible to use for both programmers and template
designers. Smarty also compiles the templates into PHP scripts, eliminating
the need to parse the templates on every invocation, making Smarty extremely
scalable and manageable for large application needs.
Q: What do you mean "Compiled PHP Scripts" ?
A: Smarty reads the template files and creates PHP scripts from them. Once
these PHP scripts are created, Smarty executes these, never having to parse
the template files again. If you change a template file, Smarty will
recreate the PHP script for it. All this is done automatically by Smarty.
Template designers never need to mess with the generated PHP scripts or even
know of their existance. (NOTE: you can turn off this compile checking step
in Smarty for increased performance.)
Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
A: You certainly can, and we highly recommend it! What PHPA does is caches
compiled bytecode of your PHP scripts in shared memory or in a file. This
speeds up server response and saves the compilation step. Smarty creates PHP
scripts, which PHPA will cache nicely. Now, Smarty's built-in cache is
something completely different. It caches the _output_ of the template
contents. For example, if you have a template that requires several database
queries, Smarty can cache this output, saving the need to call the database
every time. Smarty and PHPA (or Zend Cache) complement each other nicely. If
performance is of the utmost importance, we would recommend using one of
these with any PHP application, using Smarty or not. As you can see in the
benchmarks, Smartys performance _really_ excels in combination with a PHP
accelerator.
Q: Why does Smarty have a built in cache? Wouldn't it be better to handle this
in a separate class?
A: Smarty's caching functionality is tightly integrated with the template
engine, making it quite a bit more flexible than a simple caching wrapper.
For instance, you can cache select portions of a template page. Let's say
you have a polling box on your site. With Smarty, you can leave the poll
dynamic and cache the rest of the page. You can also pass templates
multiple cache ids, meaning that a template can have several caches
depending on URL, cookies, etc.
Q: Is Smarty faster than <insert other PHP template engine>?
A: See the benchmark page for some performance comparisons. Smarty's approach
to templates is a bit different from some languages: it compiles templates
into PHP scripts instead of parsing them on each invocation. This usually
results in great performance gains, especially with complex templates.
Coupled with the built-in caching of Smarty templates, the performance is
outstanding.
Q: How can I be sure to get the best performance from Smarty?
A: Be sure you set $compile_check=false once your templates are initially
compiled. This will skip the unneeded step of testing if the template has
changed since it was last compiled. If you have complex pages that don't
change too often, turn on the caching engine and adjust your application so
it doesn't do unnecessary work (like db calls) if a cached page is
available. See the documentation for examples.
Q: Do you have a mailing list?
A: We have a few mailing lists. "general" for you to share your ideas or ask
questions, "dev" for those interested in the development efforts of Smarty,
and "cvs" for those that would like to track the updates made in the cvs
repository.
send a blank e-mail message to:
smarty-general-subscribe@lists.php.net (subscribe to the general list)
smarty-general-unsubscribe@lists.php.net (unsubscribe from the general list)
smarty-general-digest-subscribe@lists.php.net (subscribe to digest)
smarty-general-digest-unsubscribe@lists.php.net (unsubscribe from digest)
smarty-dev-subscribe@lists.php.net (subscribe to the dev list)
smarty-dev-unsubscribe@lists.php.net (unsubscribe from the dev list)
smarty-cvs-subscribe@lists.php.net (subscribe to the cvs list)
smarty-cvs-unsubscribe@lists.php.net (unsubscribe from the cvs list)
You can also browse the mailing list archives at
http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
Q: Can you change the mailing list so Reply-To sends to the list and not the
user?
A: Yes we could, but no we won't. Use "Reply-All" in your e-mail client to send
to the list. http://www.unicom.com/pw/reply-to-harmful.html
TROUBLESHOOTING
---------------
Q: Smarty doesn't work.
A: You must be using PHP 4.0.6 or later if you use any version of Smarty
past 2.0.1. Read the BUGS file for more info.
Q: I get the following error when running Smarty:
Warning: Smarty error: problem creating directory "templates_c/239/239105369"
in /path/to/Smarty.class.php on line 542
A: Your web server user does not have permission to write to the templates_c
directory, or is unable to create the templates_c directory. Be sure the
templates_c directory exists in the location defined in Smarty.class.php,
and the web server user can write to it. If you do not know the web server
user, chmod 777 the templates_c directory, reload the page, then check the
file ownership of the files created in templates_c. Or, you can check the
httpd.conf (usually in /usr/local/apache/conf) file for this setting:
User nobody
Group nobody
Q: I get the following error when running Smarty: Warning: Wrong parameter
count for preg_replace() in Smarty.class.php on line 371
A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
requires. Upgrade to at least 4.0.6 to fix all known PHP issues with
Smarty.
Q: I get this error when passing variables to {include}:
Fatal error: Call to undefined function: get_defined_vars() in
/path/to/Smarty/templates_c/index.tpl.php on line 8
A: get_defined_vars() was added to PHP 4.0.4. If you plan on passing
variables to included templates, you will need PHP 4.0.6 or later.
Q: I get PHP errors in my {if} tag logic.
A: All conditional qualifiers must be separated by spaces. This syntax will not
work: {if $name=="Wilma"} You must instead do this: {if $name == "Wilma"}.
The reason for this is syntax ambiguity. Both "==" and "eq" are equivalent
in the template parser, so something like {if $nameeq"Wilma"} wouldn't be
parsable by the tokenizer.
Q: I'm changing my php code and/or templates, and my results are not getting
updated.
A: This may be the result of your compile or cache settings. If you are
changing your php code, your templates will not necessarily get recompiled
to reflect the changes. Use $force_compile during develpment to avoid these
situations. Also turn off caching during development when you aren't
specifically testing it. You can also remove everything from your
compile_dir and cache_dir and reload the page to be sure everything gets
regenerated.
Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
also zero length.
A: There seems to be a problem with some W2k machines and exclusive file
locking. Comment out the flock() call in _write_file to get around this,
although be aware this could possibly cause a problem with simultaneous
writes to a file, especially with caching turned on. NOTE: As of Smarty
1.4.0, a workaround was put in place that should solve this.
Q: The template goes into an infinite loop when I include included templates
that pass local variables
A: This was fixed in 1.3.2 (new global attribute)
Q: Javascript is causing Smarty errors in my templates.
A: Surround your javascript with {literal}{/literal} tags. See the docs.
Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
A: Use $smarty->use_sub_dirs = false when running php in safe mode.
MISC
----
Q: Can I use Macromedia's Dreamweaver to edit my templates?
A: Certainly. You might want to change your tag delimiters from {} to something
that resembles valid HTML, like <!--{ }--> or <{ }> or something similar.
This way the editor won't view the template tags as errors.
Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
HREF link. How do I get around this?
A: In Edit - Properties - Rewrite HTML you can specify if Dreamweaver should
change special letters to %-equivalent or not. The default is on which
produces this error.
HOWTO
-----
Q: How do I generate different cache files per template based on arguments
passed to the page?
A: Use your $REQUEST_URI as the cache_id when fetching the page:
global $REQUEST_URI; // if not already present
$smarty->display('index.tpl',$REQUEST_URI);
This will create a separate cache file for each unique URL when you call
index.tpl. See the documentation for display() and fetch()
Q: How do I pass a template variable as a parameter? {function param={$varname}}
does not work.
A: {function param=$varname} (You cannot nest template delimiters.)
Q: How do I include cached template(s) within a non-cached template?
A: One way to do it:
$smarty->caching = true;
$tpl1 = $smarty->fetch("internal1.tpl");
$tpl2 = $smarty->fetch("internal2.tpl");
$tpl3 = $smarty->fetch("internal3.tpl");
$smarty->assign("tpl1_contents",$tpl1);
$smarty->assign("tpl2_contents",$tpl2);
$smarty->assign("tpl3_contents",$tpl3);
$smarty->caching = false;
$smarty->display('index.tpl');
index.tpl
---------
<table>
<tr>
<td>{$tpl1_contents}</td>
<td>{$tpl2_contents}</td>
<td>{$tpl3_contents}</td>
</tr>
</table>
Another approach:
You could write a custom insert function to fetch your internal
templates:
<table>
<tr>
<td>{insert name=fetch_tpl tpl="internal1.tpl"}</td>
<td>{insert name=fetch_tpl tpl="internal2.tpl"}</td>
<td>{insert name=fetch_tpl tpl="internal3.tpl"}</td>
</tr>
</table>
-29
View File
@@ -1,29 +0,0 @@
REQUIREMENTS:
Smarty requires PHP 4.0.6 or later.
See the on-line documentation for complete install instructions.
INSTALLATION (quick):
* copy the files under the libs/ directory to a directory that is in your PHP
include_path, or set the SMARTY_DIR constant and put them in this directory.
(if you upgrade from versions before 2.5.0 be aware that up to Smarty 2.4.2
all necessary files where in the distribution's root directory, but are now
in libs/.)
* for each application using Smarty, create a "templates", "configs", and a
"templates_c" directory, be sure to set the appropriate directory settings in
Smarty for them. If they are located in the same directory as your
application, they shouldn't need to be modified. Be sure the "templates_c"
directory is writable by your web server user (usually nobody). chown
nobody:nobody templates_c; chmod 700 templates_c You can also chmod 777 this
directory, but be aware of security issues for multi-user systems. If you are
using Smarty's built-in caching, create a "cache" directory and also chown
nobody:nobody.
* setup your php and template files. A good working example is in the on-line
documentation.
* TECHNICAL NOTE: If you do not have access to the php.ini file, you can change
non-server settings (such as your include_path) with the ini_set() command.
example: ini_set("include_path",".:/usr/local/lib/php");
File diff suppressed because it is too large Load Diff
+553 -65
View File
@@ -1,86 +1,574 @@
Smarty 3.1.14
NAME:
Author: Monte Ohrt <monte at ohrt dot com >
Author: Uwe Tews
Smarty - the PHP compiling template engine
AN INTRODUCTION TO SMARTY 3
VERSION: 2.6.26
NOTICE FOR 3.1 release:
AUTHORS:
Monte Ohrt <monte at ohrt dot com>
Andrei Zmievski <andrei@php.net>
Please see the SMARTY_3.1_NOTES.txt file that comes with the distribution.
MAILING LISTS:
NOTICE for 3.0.5 release:
We have a few mailing lists. "discussion" for you to share your ideas or ask
questions, "developers" for those interested in the development efforts of Smarty,
and "svn" for those that would like to track the updates made in the svn
repository.
Smarty now follows the PHP error_reporting level by default. If PHP does not mask E_NOTICE and you try to access an unset template variable, you will now get an E_NOTICE warning. To revert to the old behavior:
send a blank e-mail message to:
smarty-discussion-subscribe@googlecode.com(subscribe to the general discussion list)
smarty-discussion-unsubscribe@googlecode.com (unsubscribe from the general discussion list)
smarty-discussion-digest-subscribe@googlecode.com (subscribe to digest)
smarty-discussion-digest-unsubscribe@googlecode.com (unsubscribe from digest)
smarty-developers-subscribe@googlecode.com (subscribe to the dev list)
smarty-developers-unsubscribe@googlecode.com (unsubscribe from the dev list)
smarty-svn-subscribe@googlecode.com (subscribe to the svn list)
smarty-svn-unsubscribe@googlecode.com (unsubscribe from the svn list)
$smarty->error_reporting = E_ALL & ~E_NOTICE;
You can also browse the mailing list archives at
http://groups.google.com/group/smarty-discussion
http://groups.google.com/group/smarty-developers
NOTICE for 3.0 release:
and the OLD list archives at
http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
IMPORTANT: Some API adjustments have been made between the RC4 and 3.0 release.
We felt it is better to make these now instead of after a 3.0 release, then have to
immediately deprecate APIs in 3.1. Online documentation has been updated
to reflect these changes. Specifically:
SYNOPSIS:
---- API CHANGES RC4 -> 3.0 ----
require("Smarty.class.php");
$smarty->register->*
$smarty->unregister->*
$smarty->utility->*
$samrty->cache->*
$smarty = new Smarty;
Have all been changed to local method calls such as:
$smarty->assign("Title","My Homepage");
$smarty->assign("Names",array("John","Gary","Gregg","James"));
$smarty->clearAllCache()
$smarty->registerFoo()
$smarty->unregisterFoo()
$smarty->testInstall()
etc.
$smarty->display("index.tpl");
Registration of function, block, compiler, and modifier plugins have been
consolidated under two API calls:
$smarty->registerPlugin(...)
$smarty->unregisterPlugin(...)
Registration of pre, post, output and variable filters have been
consolidated under two API calls:
$smarty->registerFilter(...)
$smarty->unregisterFilter(...)
Please refer to the online documentation for all specific changes:
http://www.smarty.net/documentation
----
The Smarty 3 API has been refactored to a syntax geared
for consistency and modularity. The Smarty 2 API syntax is still supported, but
will throw a deprecation notice. You can disable the notices, but it is highly
recommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run
through an extra rerouting wrapper.
Basically, all Smarty methods now follow the "fooBarBaz" camel case syntax. Also,
all Smarty properties now have getters and setters. So for example, the property
$smarty->cache_dir can be set with $smarty->setCacheDir('foo/') and can be
retrieved with $smarty->getCacheDir().
Some of the Smarty 3 APIs have been revoked such as the "is*" methods that were
just duplicate functions of the now available "get*" methods.
Here is a rundown of the Smarty 3 API:
$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null)
$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null)
$smarty->isCached($template, $cache_id = null, $compile_id = null)
$smarty->createData($parent = null)
$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
$smarty->enableSecurity()
$smarty->disableSecurity()
$smarty->setTemplateDir($template_dir)
$smarty->addTemplateDir($template_dir)
$smarty->templateExists($resource_name)
$smarty->loadPlugin($plugin_name, $check = true)
$smarty->loadFilter($type, $name)
$smarty->setExceptionHandler($handler)
$smarty->addPluginsDir($plugins_dir)
$smarty->getGlobal($varname = null)
$smarty->getRegisteredObject($name)
$smarty->getDebugTemplate()
$smarty->setDebugTemplate($tpl_name)
$smarty->assign($tpl_var, $value = null, $nocache = false)
$smarty->assignGlobal($varname, $value = null, $nocache = false)
$smarty->assignByRef($tpl_var, &$value, $nocache = false)
$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false)
$smarty->appendByRef($tpl_var, &$value, $merge = false)
$smarty->clearAssign($tpl_var)
$smarty->clearAllAssign()
$smarty->configLoad($config_file, $sections = null)
$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
$smarty->getConfigVariable($variable)
$smarty->getStreamVariable($variable)
$smarty->getConfigVars($varname = null)
$smarty->clearConfig($varname = null)
$smarty->getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
$smarty->clearAllCache($exp_time = null, $type = null)
$smarty->clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
$smarty->registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = array())
$smarty->registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
$smarty->registerFilter($type, $function_name)
$smarty->registerResource($resource_type, $function_names)
$smarty->registerDefaultPluginHandler($function_name)
$smarty->registerDefaultTemplateHandler($function_name)
$smarty->unregisterPlugin($type, $tag)
$smarty->unregisterObject($object_name)
$smarty->unregisterFilter($type, $function_name)
$smarty->unregisterResource($resource_type)
$smarty->compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
$smarty->testInstall()
// then all the getters/setters, available for all properties. Here are a few:
$caching = $smarty->getCaching(); // get $smarty->caching
$smarty->setCaching(true); // set $smarty->caching
$smarty->setDeprecationNotices(false); // set $smarty->deprecation_notices
$smarty->setCacheId($id); // set $smarty->cache_id
$debugging = $smarty->getDebugging(); // get $smarty->debugging
DESCRIPTION:
FILE STRUCTURE
What is Smarty?
The Smarty 3 file structure is similar to Smarty 2:
Smarty is a template engine for PHP. Many other template engines for PHP
provide basic variable substitution and dynamic block functionality.
Smarty takes a step further to be a "smart" template engine, adding
features such as configuration files, template functions, and variable
modifiers, and making all of this functionality as easy as possible to
use for both programmers and template designers. Smarty also converts
the templates into PHP scripts, eliminating the need to parse the
templates on every invocation. This makes Smarty extremely scalable and
manageable for large application needs.
/libs/
Smarty.class.php
/libs/sysplugins/
internal.*
/libs/plugins/
function.mailto.php
modifier.escape.php
...
Some of Smarty's features:
A lot of Smarty 3 core functionality lies in the sysplugins directory; you do
not need to change any files here. The /libs/plugins/ folder is where Smarty
plugins are located. You can add your own here, or create a separate plugin
directory, just the same as Smarty 2. You will still need to create your own
/cache/, /templates/, /templates_c/, /configs/ folders. Be sure /cache/ and
/templates_c/ are writable.
* it is extremely fast
* no template parsing overhead, only compiles once.
* it is smart about recompiling only the template files that have
changed.
* the template language is remarkably extensible via the plugin
architecture.
* configurable template delimiter tag syntax, so you can use
{}, {{}}, <!--{}-->, or whatever you like.
* built-in caching of template output.
* arbitrary template sources (filesystem, databases, etc.)
* template if/elseif/else/endif constructs are passed to the PHP parser,
so the if syntax can be as simple or as complex as you like.
* unlimited nesting of sections, conditionals, etc. allowed
* it is possible to embed PHP code right in your template files,
although not recommended and doubtfully needed since the engine
is so customizable.
* and many more.
The typical way to use Smarty 3 should also look familiar:
COPYRIGHT:
Copyright (c) 2001-2005 New Digital Group, Inc. All rights reserved.
This software is released under the GNU Lesser General Public License.
Please read the disclaimer at the top of the Smarty.class.php file.
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('foo','bar');
$smarty->display('index.tpl');
However, Smarty 3 works completely different on the inside. Smarty 3 is mostly
backward compatible with Smarty 2, except for the following items:
*) Smarty 3 is PHP 5 only. It will not work with PHP 4.
*) The {php} tag is disabled by default. Enable with $smarty->allow_php_tag=true.
*) Delimiters surrounded by whitespace are no longer treated as Smarty tags.
Therefore, { foo } will not compile as a tag, you must use {foo}. This change
Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
This can be disabled by setting $smarty->auto_literal = false;
*) The Smarty 3 API is a bit different. Many Smarty 2 API calls are deprecated
but still work. You will want to update your calls to Smarty 3 for maximum
efficiency.
There are many things that are new to Smarty 3. Here are the notable items:
LEXER/PARSER
============
Smarty 3 now uses a lexing tokenizer for its parser/compiler. Basically, this
means Smarty has some syntax additions that make life easier such as in-template
math, shorter/intuitive function parameter options, infinite function recursion,
more accurate error handling, etc.
WHAT IS NEW IN SMARTY TEMPLATE SYNTAX
=====================================
Smarty 3 allows expressions almost anywhere. Expressions can include PHP
functions as long as they are not disabled by the security policy, object
methods and properties, etc. The {math} plugin is no longer necessary but
is still supported for BC.
Examples:
{$x+$y} will output the sum of x and y.
{$foo = strlen($bar)} function in assignment
{assign var=foo value= $x+$y} in attributes
{$foo = myfunct( ($x+$y)*3 )} as function parameter
{$foo[$x+3]} as array index
Smarty tags can be used as values within other tags.
Example: {$foo={counter}+3}
Smarty tags can also be used inside double quoted strings.
Example: {$foo="this is message {counter}"}
You can define arrays within templates.
Examples:
{assign var=foo value=[1,2,3]}
{assign var=foo value=['y'=>'yellow','b'=>'blue']}
Arrays can be nested.
{assign var=foo value=[1,[9,8],3]}
There is a new short syntax supported for assigning variables.
Example: {$foo=$bar+2}
You can assign a value to a specific array element. If the variable exists but
is not an array, it is converted to an array before the new values are assigned.
Examples:
{$foo['bar']=1}
{$foo['bar']['blar']=1}
You can append values to an array. If the variable exists but is not an array,
it is converted to an array before the new values are assigned.
Example: {$foo[]=1}
You can use a PHP-like syntax for accessing array elements, as well as the
original "dot" notation.
Examples:
{$foo[1]} normal access
{$foo['bar']}
{$foo['bar'][1]}
{$foo[$x+$x]} index may contain any expression
{$foo[$bar[1]]} nested index
{$foo[section_name]} smarty section access, not array access!
The original "dot" notation stays, and with improvements.
Examples:
{$foo.a.b.c} => $foo['a']['b']['c']
{$foo.a.$b.c} => $foo['a'][$b]['c'] with variable index
{$foo.a.{$b+4}.c} => $foo['a'][$b+4]['c'] with expression as index
{$foo.a.{$b.c}} => $foo['a'][$b['c']] with nested index
note that { and } are used to address ambiguties when nesting the dot syntax.
Variable names themselves can be variable and contain expressions.
Examples:
$foo normal variable
$foo_{$bar} variable name containing other variable
$foo_{$x+$y} variable name containing expressions
$foo_{$bar}_buh_{$blar} variable name with multiple segments
{$foo_{$x}} will output the variable $foo_1 if $x has a value of 1.
Object method chaining is implemented.
Example: {$object->method1($x)->method2($y)}
{for} tag added for looping (replacement for {section} tag):
{for $x=0, $y=count($foo); $x<$y; $x++} .... {/for}
Any number of statements can be used separated by comma as the first
inital expression at {for}.
{for $x = $start to $end step $step} ... {/for}is in the SVN now .
You can use also
{for $x = $start to $end} ... {/for}
In this case the step value will be automaticall 1 or -1 depending on the start and end values.
Instead of $start and $end you can use any valid expression.
Inside the loop the following special vars can be accessed:
$x@iteration = number of iteration
$x@total = total number of iterations
$x@first = true on first iteration
$x@last = true on last iteration
The Smarty 2 {section} syntax is still supported.
New shorter {foreach} syntax to loop over an array.
Example: {foreach $myarray as $var}...{/foreach}
Within the foreach loop, properties are access via:
$var@key foreach $var array key
$var@iteration foreach current iteration count (1,2,3...)
$var@index foreach current index count (0,1,2...)
$var@total foreach $var array total
$var@first true on first iteration
$var@last true on last iteration
The Smarty 2 {foreach} tag syntax is still supported.
NOTE: {$bar[foo]} still indicates a variable inside of a {section} named foo.
If you want to access an array element with index foo, you must use quotes
such as {$bar['foo']}, or use the dot syntax {$bar.foo}.
while block tag is now implemented:
{while $foo}...{/while}
{while $x lt 10}...{/while}
Direct access to PHP functions:
Just as you can use PHP functions as modifiers directly, you can now access
PHP functions directly, provided they are permitted by security settings:
{time()}
There is a new {function}...{/function} block tag to implement a template function.
This enables reuse of code sequences like a plugin function. It can call itself recursively.
Template function must be called with the new {call name=foo...} tag.
Example:
Template file:
{function name=menu level=0}
<ul class="level{$level}">
{foreach $data as $entry}
{if is_array($entry)}
<li>{$entry@key}</li>
{call name=menu data=$entry level=$level+1}
{else}
<li>{$entry}</li>
{/if}
{/foreach}
</ul>
{/function}
{$menu = ['item1','item2','item3' => ['item3-1','item3-2','item3-3' =>
['item3-3-1','item3-3-2']],'item4']}
{call name=menu data=$menu}
Generated output:
* item1
* item2
* item3
o item3-1
o item3-2
o item3-3
+ item3-3-1
+ item3-3-2
* item4
The function tag itself must have the "name" attribute. This name is the tag
name when calling the function. The function tag may have any number of
additional attributes. These will be default settings for local variables.
New {nocache} block function:
{nocache}...{/nocache} will declare a section of the template to be non-cached
when template caching is enabled.
New nocache attribute:
You can declare variable/function output as non-cached with the nocache attribute.
Examples:
{$foo nocache=true}
{$foo nocache} /* same */
{foo bar="baz" nocache=true}
{foo bar="baz" nocache} /* same */
{time() nocache=true}
{time() nocache} /* same */
Or you can also assign the variable in your script as nocache:
$smarty->assign('foo',$something,true); // third param is nocache setting
{$foo} /* non-cached */
$smarty.current_dir returns the directory name of the current template.
You can use strings directly as templates with the "string" resource type.
Examples:
$smarty->display('string:This is my template, {$foo}!'); // php
{include file="string:This is my template, {$foo}!"} // template
VARIABLE SCOPE / VARIABLE STORAGE
=================================
In Smarty 2, all assigned variables were stored within the Smarty object.
Therefore, all variables assigned in PHP were accessible by all subsequent
fetch and display template calls.
In Smarty 3, we have the choice to assign variables to the main Smarty object,
to user-created data objects, and to user-created template objects.
These objects can be chained. The object at the end of a chain can access all
variables belonging to that template and all variables within the parent objects.
The Smarty object can only be the root of a chain, but a chain can be isolated
from the Smarty object.
All known Smarty assignment interfaces will work on the data and template objects.
Besides the above mentioned objects, there is also a special storage area for
global variables.
A Smarty data object can be created as follows:
$data = $smarty->createData(); // create root data object
$data->assign('foo','bar'); // assign variables as usual
$data->config_load('my.conf'); // load config file
$data= $smarty->createData($smarty); // create data object having a parent link to
the Smarty object
$data2= $smarty->createData($data); // create data object having a parent link to
the $data data object
A template object can be created by using the createTemplate method. It has the
same parameter assignments as the fetch() or display() method.
Function definition:
function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
The first parameter can be a template name, a smarty object or a data object.
Examples:
$tpl = $smarty->createTemplate('mytpl.tpl'); // create template object not linked to any parent
$tpl->assign('foo','bar'); // directly assign variables
$tpl->config_load('my.conf'); // load config file
$tpl = $smarty->createTemplate('mytpl.tpl',$smarty); // create template having a parent link to the Smarty object
$tpl = $smarty->createTemplate('mytpl.tpl',$data); // create template having a parent link to the $data object
The standard fetch() and display() methods will implicitly create a template object.
If the $parent parameter is not specified in these method calls, the template object
is will link back to the Smarty object as it's parent.
If a template is called by an {include...} tag from another template, the
subtemplate links back to the calling template as it's parent.
All variables assigned locally or from a parent template are accessible. If the
template creates or modifies a variable by using the {assign var=foo...} or
{$foo=...} tags, these new values are only known locally (local scope). When the
template exits, none of the new variables or modifications can be seen in the
parent template(s). This is same behavior as in Smarty 2.
With Smarty 3, we can assign variables with a scope attribute which allows the
availablility of these new variables or modifications globally (ie in the parent
templates.)
Possible scopes are local, parent, root and global.
Examples:
{assign var=foo value='bar'} // no scope is specified, the default 'local'
{$foo='bar'} // same, local scope
{assign var=foo value='bar' scope='local'} // same, local scope
{assign var=foo value='bar' scope='parent'} // Values will be available to the parent object
{$foo='bar' scope='parent'} // (normally the calling template)
{assign var=foo value='bar' scope='root'} // Values will be exported up to the root object, so they can
{$foo='bar' scope='root'} // be seen from all templates using the same root.
{assign var=foo value='bar' scope='global'} // Values will be exported to global variable storage,
{$foo='bar' scope='global'} // they are available to any and all templates.
The scope attribute can also be attached to the {include...} tag. In this case,
the specified scope will be the default scope for all assignments within the
included template.
PLUGINS
=======
Smarty3 are following the same coding rules as in Smarty2.
The only difference is that the template object is passed as additional third parameter.
smarty_plugintype_name (array $params, object $smarty, object $template)
The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty2 internals.
TEMPLATE INHERITANCE:
=====================
With template inheritance you can define blocks, which are areas that can be
overriden by child templates, so your templates could look like this:
parent.tpl:
<html>
<head>
<title>{block name='title'}My site name{/block}</title>
</head>
<body>
<h1>{block name='page-title'}Default page title{/block}</h1>
<div id="content">
{block name='content'}
Default content
{/block}
</div>
</body>
</html>
child.tpl:
{extends file='parent.tpl'}
{block name='title'}
Child title
{/block}
grandchild.tpl:
{extends file='child.tpl'}
{block name='title'}Home - {$smarty.block.parent}{/block}
{block name='page-title'}My home{/block}
{block name='content'}
{foreach $images as $img}
<img src="{$img.url}" alt="{$img.description}" />
{/foreach}
{/block}
We redefined all the blocks here, however in the title block we used {$smarty.block.parent},
which tells Smarty to insert the default content from the parent template in its place.
The content block was overriden to display the image files, and page-title has also be
overriden to display a completely different title.
If we render grandchild.tpl we will get this:
<html>
<head>
<title>Home - Child title</title>
</head>
<body>
<h1>My home</h1>
<div id="content">
<img src="/example.jpg" alt="image" />
<img src="/example2.jpg" alt="image" />
<img src="/example3.jpg" alt="image" />
</div>
</body>
</html>
NOTE: In the child templates everything outside the {extends} or {block} tag sections
is ignored.
The inheritance tree can be as big as you want (meaning you can extend a file that
extends another one that extends another one and so on..), but be aware that all files
have to be checked for modifications at runtime so the more inheritance the more overhead you add.
Instead of defining the parent/child relationships with the {extends} tag in the child template you
can use the resource as follow:
$smarty->display('extends:parent.tpl|child.tpl|grandchild.tpl');
Child {block} tags may optionally have a append or prepend attribute. In this case the parent block content
is appended or prepended to the child block content.
{block name='title' append} My title {/block}
PHP STREAMS:
============
(see online documentation)
VARIBLE FILTERS:
================
(see online documentation)
STATIC CLASS ACCESS AND NAMESPACE SUPPORT
=========================================
You can register a class with optional namespace for the use in the template like:
$smarty->register->templateClass('foo','name\name2\myclass');
In the template you can use it like this:
{foo::method()} etc.
=======================
Please look through it and send any questions/suggestions/etc to the forums.
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=14168
Monte and Uwe
-428
View File
@@ -1,428 +0,0 @@
2.6.7
-----
Those using Smarty with security enabled: a hole was found that allowed PHP code to be executed from within a template file. This has been fixed and you are engouraged to upgrade immediately. Note that this hole does NOT affect the security of your web server or PHP applications, only the ability for someone editing a template to execute PHP code. Other changes in this release can be found in the NEWS file.
2.5.0
-----
Very minor adjustments since RC2, see the NEWS file for details.
2.5.0-RC2
---------
Many fixes since the RC1 release. This one is as close to production quality as
they come, so this will be the last release before 2.5.0. The SGML documentation
files have also been removed from the tarball. If you want them, get them from
the CVS repository.
2.5.0-RC1
---------
Release Candidate 1. All $smarty vars can now be dynamic, such as
$smarty.get.$foo. A new class function get_function_object() gets you a
reference to an assigned object, useful within your own custom functions.
append() can now merge as well as append with a third optional attribute. A new
class function get_config_vars() was added, and get_template_vars() can now be
used to get individual vars. Full variable syntax is now supported within
double quotes via a backtick (`) syntax. Files created by smarty are now
written to a tmp file then renamed to avoid file lock retention. html_radios,
html_checkboxes, html_table, html_image, nl2br functions added, see the NEWS
file for full details.
2.4.2
-----
Another point release. Added support for dynamic object reference syntax
($foo->$bar), support for full variable syntax within quotes ("$foo[0].bar"),
and other minor fixes. See the NEWS file for full details.
2.4.1
-----
This is basically a point release, cleaning up a few things caught
in the 2.4.0 release. See the NEWS file for full details.
2.4.0
-----
Smarty now supports the ability to access objects within the templates. Two
methods are available, one which closely follows Smartys conventions, and
another that follows more traditional object syntax for those familiar with
PHP.
The internal compiling engine has also undergone some major work. The regex
parsing was rewritten to be much more strict, more secure and more
maintainable. Config files are now compiled, which can speed up pages quite a
bit that use config files extensively. Assigned variables are no longer
extracted to PHP namespace, saving an extract call for every template. There is
now support for applying modifiers to static values and functions. You can now
access constants with $smarty.const.VAR. See the NEWS file for complete
changes.
2.3.1
-----
The mtime on compiled files will now match the source files, in the case where
the source file may not get the current timestamp, recompiling will still work
as expected. Proper support for open_basedir has been added, so Smarty should
work correctly in safe mode. Added a few new features such as textformat block
function, strip variable modifier and optgroup support for html_options. Also
other minor bug fixes, see the Change Log.
2.3.0
-----
Smarty now has a {debug} template function that brings up the debugging console
right where {debug} is called, regardless of $debugging settings. This works a
little different than turning on $debugging in the sense that it shows all the
template variables available at the time {debug} is called, including local
scope vars. It does not show the templates names however, since this
executed during runtime of the template.
You can now supply an expire time when clearing cache or compile files. This is
mostly useful for removing stale files via the API.
Plugins now stop execution upon error, instead of outputting a warning and
continuing.
Two new API functions, assign_by_ref() and append_by_ref() were added. They
allow assigning template variables by reference. This can make a significant
performance gain, especially if you are assigning large arrays of data. PHP 5.0
will do this implicitly, so these functions are basically workarounds.
Several misc bug fixes, see the Change Log for information.
2.2.0
-----
Smarty now allows an array of paths for the $plugin_dir class variable. The
directories will be searched in the order they are given, so for efficiency keep
the most-used plugins at the top. Also, absolute paths to the plugin directories are
more efficient than relying on the PHP include_path.
Cache files can now be grouped with the cache_id. See the documentation under
the new "Caching" section for details. compile_id also respects the same
grouping syntax. The cache/compile file structure changed, so be sure to clear
out all your cache and compile files when upgrading Smarty. Also if you are
using PHP-accelerator, restart apache. I've seen some quirky things happen if
the phpa files do not get cleared (known issue with phpa and parent
class-member changes, so just clear 'em.)
Smarty now correctly respects the PHP include_path for $template_dir, $compile_dir,
$cache_dir, $config_dir and $plugin_dir. Be aware that relying on the
include_path is an overhead, try to use absolute pathnames when possible
(or relative to working directory.)
Documentation has been updated and rearranged a bit. Most notably, the
installation instructions are completely revamped, and a new Caching section
explains Smarty's caching in detail along with the new grouping functionality.
Many misc. bug fixes and enhancements, see the full ChangeLog (NEWS file) for
details.
2.1.1
-----
There was a bug with template paths and the include_path, this has been fixed.
Also register_outputfilter() did not work, this is fixed. A new template
function named "cycle" has been added to the distribution, nice for cycling
through a list (or array) of values.
2.1.0
-----
This release has quite a few new features and fixes. Most notable are the
introduction of block functions, so you can write plugins that work on a block
of text with {func}{/func} notation. Also output filters were added, so you can
apply a function against the output of your templates. This differs from the
postfilter function, which works on the compiled template at compile time, and
output filters work on the template output at runtime.
Many other features and bug fixes are noted in the NEWS file.
2.0.1
-----
This is a point release, fixing a few bugs and cleaning things up. A plugin
was renamed, the dash "-" was removed from compiled template and cached file
names. If you're upgrading, you might want to clear them out first. See the
ChangeLog for details.
2.0.0
-----
This release is a huge milestone for Smarty. Most notable new things are a
plugin architecture, removal of PEAR dependency, and optimizations that
drastically improve the performance of Smarty in most cases.
The plugin architecture allows modifiers, custom functions, compiler functions,
prefilters, postfilters, resources, and insert functions to be added by
simply dropping a file into the plugins directory. Once dropped in, they are
automatically registered by the template engine. This makes user-contributed
plugins easy to manage, as well as the internal workings of Smarty easy to
control and customize. This new architecture depends on the __FILE__ constant,
which contains the full path to the executing script. Some older versions of
PHP incorrectly gave the script name and not the full filesystem path. Be sure
your version of PHP populates __FILE__ correctly. If you use custom template
resource functions, the format of these changed with the plugin architecture.
Be sure to update your functions accordingly. See the template resource section
of the documentation.
The PEAR dependancy was removed from Smarty. The Config_File class that comes
with Smarty was actually what needed PEAR for error handling which Smarty didn't
use, but now everything is self-contained.
Performance improvements are graphed on the benchmark page, you will see that
overall performance has been sped up by as much as 80% in some cases.
Smarty-cached pages now support If-Modified-Since headers, meaning that if a
cached template page has not changed since the last request, a "304 Not
Modified" header will be sent instead of resending the same page. This is
disabled by default, change the setting of $cache_modified_check.
1.5.2
-----
Mostly bug fixes, added a default template resource handler.
1.5.1
-----
Critical bug fix release. If you use caching, you'll need to upgrade.
1.5.0
-----
Several feature enhancements were made to this version, most notably the
{foreach ...} command which is an alternative to {section ...} with an easier
syntax for looping through a single array of values. Several functions were
enhanced so that the output can be automatically assigned to a template
variable instead of displayed (assign attribute). Cache files can now be
controlled with a custom function as an alternative to the built-in file based
method. Many code cleanups and bug fixed went into this release as well.
1.4.6
-----
The behavior with caching and compile_check has been slightly enhanced. If
caching is enabled AND compile_check is enabled, the cache will immediately get
regenerated if _any_ involved template or config file is updated. This imposes
a slight performance hit because it must check all the files for changes, so be
sure to run live sites with caching enabled and compile_check disabled for best
performance. If you update a template or config file, simply turn on
compile_check, load the page, then turn it back off. This will update the cache
file with the new content. This is accomplished by maintaining a list of
included/loaded templates and config files at the beginning of the cache file.
Therefore it is advisable to remove all cache files after upgrading to 1.4.6
(although not absolutely necessary, old cache files will regenerate)
The debug console now has script timing and array values printed. You MUST
update your debug.tpl file with this version of Smarty. Also, the new debug.tpl
will not work with older versions of Smarty.
1.4.5
-----
Mostly bug fixes and minor improvements. Added compile id for separate compiled
versions of the same script. The directory format and filename convention for
the files in templates_c has changed, so you may want to remove all of the
existing ones before you upgrade.
1.4.4
-----
A few bug fixes, new section looping attributes and properties, debugging
console function for control via URL, and overLib integration and access
to request variables from within the template.
1.4.3
-----
This release has a few bug fixes and several enhancements. Smarty now supports
template security for third-party template editing. These features disallow the
ability for someone to execute commands or PHP code from the template language.
Smarty also now has a built-in debugging console, which is a javascript pop-up
window that displays all the included template names and assigned variables.
1.4.2
-----
This was mostly one bug fix with variable scoping within included templates
and a few documentation changes and updates. See the ChangeLog file for full
details.
1.4.1
-----
It seems that the EX_LOCK logic from the previous release didn't fix all the
problems with windows platforms. Hopefully this one does. It basically
disables file locking on windows, so there is a potential that two programs
could write over the same file at the same time, fyi.
The reset is minor bug fixes, please refer to the ChangeLog file.
1.4.0
-----
IMPORTANT NOTICE
Smarty now has a new syntax for accessing elements within section loops. The
new syntax is easier to use and nicely handles data structures of any
complexity. Consequently, this breaks the old syntax.
Here is an example of the syntax change:
old syntax:
{$sec1/sec2/sec3/customer.phone}
new syntax:
{$customer[$sec1][$sec2][$sec3].phone}
The section names used to come first, followed by the variable name. Now the
variable name always comes first, followed by the section names in brackets.
You can access variable indexes anywhere, depending on how you passed the
variables in.
To fix your current templates, we have provided a script that will adjust the
syntax for you. Located in misc/fix_vars.php, run this script from the the
command line, giving each template as an argument. Be sure to use absolute
pathnames, or pathnames relative to the executing script. Probably the easiest
way to do this is to copy the fix_vars.php script into your template directory
and run 'php -q fix_vars.php *.tpl' Be sure you have proper write permission,
and backup your scripts first to be safe! The examples in the 1.4.0
documentation have been updated to reflect the changes.
cd /path/to/templates
cp /path/to/fix_vars.php .
find . -name "*.tpl" -exec php -q ./fix_vars.php {} \;
NEW AND IMPROVED COMPILATION PROCESS
Smarty 1.4.0 also has a new compilation process. Instead of compiling all the
templates up front, it now compiles them at runtime. This has several
advantages. First of all, there is no longer a need to have a single template
directory. You can now have arbitrary template sources, such as multiple
directories or even database calls. This also speeds the performance of Smarty
when $compile_check is enabled, since it is only checking the template that is
being executed instead of everything found in the template directory. The
$tpl_file_ext is no longer needed, but kept for backward compatability.
Templates can now be named anything you like with any extension.
MINOR FIXES
A workaround for LOCK_EX on Windows systems was added, and changed a couple of
file permissions for better security on public servers.
$show_info_header is now defaulted to false instead of true. This header causes
problems when displaying content other than HTML, so now you must explicitly
set this flag to true to show the header information (or change the default in
your copy of Smarty.)
Documentation is written in docbook format. I updated the docbook -> HTML
generating software & style-sheets, and consequently the examples are no longer
in a different background color. If anyone wants to contribute a better
stylesheet or help with documentation, drop me a line. <monte at ohrt dot com>
CHANGES/ENHANCEMENTS/UPDATES
date_format, html_select_date and html_select_time used to require a unix
timestamp as the format of the date passed into the template. Smarty is now a
bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
etc. Just give some formats a try and see what works.
Smarty now has template prefilters, meaning that you can run your templates
through custom functions before they are compiled. This is good for things like
removing unwanted comments, keeping an eye on words or functionality people are
putting in templates, translating XML -> HTML, etc. See the register_prefilter
documentation for more info.
Another addition are the so-called compiler functions. These are custom
functions registered by the user that are executed at compilation time of the
template. They can be used to inject PHP code or time-sensitive static content
into the compiled template.
The run-time custom functions are now passed the Smarty object as the second
parameter. This can be used, for example, to assign or clear template variables
from inside the custom function.
clear_compile_dir() was added for clearing out compiled versions of your
templates. Not something normally needed, but you may have a need for this if
you have $compile_check set to false and you periodically update templates via
some automated process. As of 1.4.0, uncompiled templates _always_ get
compiled regardless of $compile_check setting, although they won't be checked
for recompile if $compile_check is set to false.
You can now refer to properties of objects assigned from PHP by using the '->'
symbol and specifying the property name after it, e.g. $foo->bar.
{php}{/php} tags were added to embed php into the templates. Not normally
needed, but some circumstances may call for it. Check out the "componentized
templates" tip in the documentation for an example.
{capture}{/capture} and {counter} functions were added. See the documentation
for a complete description and examples.
UPGRADE NOTES
The format of the files created in the $compile_dir are now a bit different.
The compiled template filename is the template resource name url-encoded.
Therefore, all compiled files are now in the top directory of $compile_dir.
This was done to make way for arbitrary template resources. Each compiled
template also has a header that states what template resource was used to
create it. From a unix command prompt, you can use "head -2 *" to see the first
two lines of each file.
When upgrading to 1.4.0, you will want to clear out all your old files in the
$compile_dir. If you have $compile_check set to false and the compiled template
does not yet exist, it will compile it regardless of this setting. This way you
can clear out the $compile_dir and not worry about setting $compile_check to
true to get the inital compilation under way.
1.3.2
-----
Smarty now has (an optional) header prepended to the output of the Smarty
templates. This displays the Smarty version and the date/time when the page was
generated. This is useful for debugging your cache routines, and purely
informational so there is evidence that the page was generated by Smarty. Set
$show_info_header to false to disable it.
{config_load ...} performance was tuned by placing the loaded variables into a
global array, so basically a config file is read from the file system and
placed into a php array structure only once, no matter how many times it is
called in any of the templates. The scope of the loaded variables has changed a
bit as well. Variables loaded by config_load used to be treated as global
variables, meaning that parent templates (templates that included the current
template) could see them. Now the default behavior is such that loaded
variables are only visible by the current template and child templates (all
templates included after the {config_load ...} is called.) To mimic the
original behavior, provide the attribute "global=yes" like so: {config_load
file="mystuff.conf" global=yes}. Now when you load in mystuff.conf, the
variables will be visible to parent templates (merged with any existing config
variables.)
A formatting attribute was added to the {math ...} function, adding the ability
to control the format of the output. Use the same formatting syntax as the PHP
function sprintf().
{html_select_time ...} was added, a custom function that works much like
{html_select_date ...} except it displays time elements instead of dates.
A few custom modifiers were added: count_characters, count_words,
count_sentences, count_paragraphs. All pretty self-explanatory.
/* vim: set et: */
+109
View File
@@ -0,0 +1,109 @@
= Known incompatibilities with Smarty 2 =
== Syntax ==
Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported
by a wrapper but deprecated. See the README that comes with Smarty 3 for more
information.
The {$array|@mod} syntax has always been a bit confusing, where an "@" is required
to apply a modifier to an array instead of the individual elements. Normally you
always want the modifier to apply to the variable regardless of its type. In Smarty 3,
{$array|mod} and {$array|@mod} behave identical. It is safe to drop the "@" and the
modifier will still apply to the array. If you really want the modifier to apply to
each array element, you must loop the array in-template, or use a custom modifier that
supports array iteration. Most smarty functions already escape values where necessary
such as {html_options}
== PHP Version ==
Smarty 3 is PHP 5 only. It will not work with PHP 4.
== {php} Tag ==
The {php} tag is disabled by default. The use of {php} tags is
deprecated. It can be enabled with $smarty->allow_php_tag=true.
But if you scatter PHP code which belongs together into several
{php} tags it may not work any longer.
== Delimiters and whitespace ==
Delimiters surrounded by whitespace are no longer treated as Smarty tags.
Therefore, { foo } will not compile as a tag, you must use {foo}. This change
Makes Javascript/CSS easier to work with, eliminating the need for {literal}.
This can be disabled by setting $smarty->auto_literal = false;
== Unquoted Strings ==
Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings
in parameters. Smarty3 is more restrictive. You can still pass strings without quotes
so long as they contain no special characters. (anything outside of A-Za-z0-9_)
For example filename strings must be quoted
<source lang="smarty">
{include file='path/foo.tpl'}
</source>
== Extending the Smarty class ==
Smarty 3 makes use of the __construct method for initialization. If you are extending
the Smarty class, its constructor is not called implicitly if the your child class defines
its own constructor. In order to run Smarty's constructor, a call to parent::__construct()
within your child constructor is required.
<source lang="php">
class MySmarty extends Smarty {
function __construct() {
parent::__construct();
// your initialization code goes here
}
}
</source>
== Autoloader ==
Smarty 3 does register its own autoloader with spl_autoload_register. If your code has
an existing __autoload function then this function must be explicitly registered on
the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php
for further details.
== Plugin Filenames ==
Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames
to be lower case. Because of this, Smarty plugin file names must also be lowercase.
In Smarty 2, mixed case file names did work.
== Scope of Special Smarty Variables ==
In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach...
had global scope. If you had loops with the same name in subtemplates you could accidentally
overwrite values of parent template.
In Smarty 3 these special Smarty variable have only local scope in the template which
is defining the loop. If you need their value in a subtemplate you have to pass them
as parameter.
<source lang="smarty">
{include file='path/foo.tpl' index=$smarty.section.foo.index}
</source>
== SMARTY_RESOURCE_CHAR_SET ==
Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset.
This is now used also on modifiers like escape as default charset. If your templates use
other charsets make sure that you define the constant accordingly. Otherwise you may not
get any output.
== newline at {if} tags ==
A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source.
If one of the {if} tags is at the line end you will now get a newline in the HTML output.
== trigger_error() ==
The API function trigger_error() has been removed because it did just map to PHP trigger_error.
However it's still included in the Smarty2 API wrapper.
== Smarty constants ==
The constants
SMARTY_PHP_PASSTHRU
SMARTY_PHP_QUOTE
SMARTY_PHP_REMOVE
SMARTY_PHP_ALLOW
have been replaced with class constants
Smarty::PHP_PASSTHRU
Smarty::PHP_QUOTE
Smarty::PHP_REMOVE
Smarty::PHP_ALLOW
@@ -0,0 +1,24 @@
== Smarty2 backward compatibility ==
All Smarty2 specific API functions and deprecated functionallity has been moved
to the SmartyBC class.
== {php} Tag ==
The {php} tag is no longer available in the standard Smarty calls.
The use of {php} tags is deprecated and only available in the SmartyBC class.
== {include_php} Tag ==
The {include_php} tag is no longer available in the standard Smarty calls.
The use of {include_php} tags is deprecated and only available in the SmartyBC class.
== php template resource ==
The support of the php template resource is removed.
== $cache_dir, $compile_dir, $config_dir, $template_dir access ==
The mentioned properties can't be accessed directly any longer. You must use
corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir()
== obsolete Smarty class properties ==
The following no longer used properties are removed:
$allow_php_tag
$allow_php_template
$deprecation_notices
+306
View File
@@ -0,0 +1,306 @@
Smarty 3.1 Notes
================
Smarty 3.1 is a departure from 2.0 compatibility. Most notably, all
backward compatibility has been moved to a separate class file named
SmartyBC.class.php. If you require compatibility with 2.0, you will
need to use this class.
Some differences from 3.0 are also present. 3.1 begins the journey of
requiring setters/getters for property access. So far this is only
implemented on the five directory properties: template_dir,
plugins_dir, configs_dir, compile_dir and cache_dir. These properties
are now protected, it is required to use the setters/getters instead.
That said, direct property access will still work, however slightly
slower since they will now fall through __set() and __get() and in
turn passed through the setter/getter methods. 3.2 will exhibit a full
list of setter/getter methods for all (currently) public properties,
so code-completion in your IDE will work as expected.
There is absolutely no PHP allowed in templates any more. All
deprecated features of Smarty 2.0 are gone. Again, use the SmartyBC
class if you need any backward compatibility.
Internal Changes
Full UTF-8 Compatibility
The plugins shipped with Smarty 3.1 have been rewritten to fully
support UTF-8 strings if Multibyte String is available. Without
MBString UTF-8 cannot be handled properly. For those rare cases where
templates themselves have to juggle encodings, the new modifiers
to_charset and from_charset may come in handy.
Plugin API and Performance
All Plugins (modifiers, functions, blocks, resources,
default_template_handlers, etc) are now receiving the
Smarty_Internal_Template instance, where they were supplied with the
Smarty instance in Smarty 3.0. *. As The Smarty_Internal_Template
mimics the behavior of Smarty, this API simplification should not
require any changes to custom plugins.
The plugins shipped with Smarty 3.1 have been rewritten for better
performance. Most notably {html_select_date} and {html_select_time}
have been improved vastly. Performance aside, plugins have also been
reviewed and generalized in their API. {html_select_date} and
{html_select_time} now share almost all available options.
The escape modifier now knows the $double_encode option, which will
prevent entities from being encoded again.
The capitalize modifier now know the $lc_rest option, which makes sure
all letters following a captial letter are lower-cased.
The count_sentences modifier now accepts (.?!) as
legitimate endings of a sentence - previously only (.) was
accepted
The new unescape modifier is there to reverse the effects of the
escape modifier. This applies to the escape formats html, htmlall and
entity.
default_template_handler_func
The invocation of $smarty->$default_template_handler_func had to be
altered. Instead of a Smarty_Internal_Template, the fifth argument is
now provided with the Smarty instance. New footprint:
/**
* Default Template Handler
*
* called when Smarty's file: resource is unable to load a requested file
*
* @param string $type resource type (e.g. "file", "string", "eval", "resource")
* @param string $name resource name (e.g. "foo/bar.tpl")
* @param string &$content template's content
* @param integer &$modified template's modification time
* @param Smarty $smarty Smarty instance
* @return string|boolean path to file or boolean true if $content and $modified
* have been filled, boolean false if no default template
* could be loaded
*/
function default_template_handler_func($type, $name, &$content, &$modified, Smarty $smarty) {
if (false) {
// return corrected filepath
return "/tmp/some/foobar.tpl";
} elseif (false) {
// return a template directly
$content = "the template source";
$modified = time();
return true;
} else {
// tell smarty that we failed
return false;
}
}
Stuff done to the compiler
Many performance improvements have happened internally. One notable
improvement is that all compiled templates are now handled as PHP
functions. This speeds up repeated templates tremendously, as each one
calls an (in-memory) PHP function instead of performing another file
include/scan.
New Features
Template syntax
{block}..{/block}
The {block} tag has a new hide option flag. It does suppress the block
content if no corresponding child block exists.
EXAMPLE:
parent.tpl
{block name=body hide} child content "{$smarty.block.child}" was
inserted {block}
In the above example the whole block will be suppressed if no child
block "body" is existing.
{setfilter}..{/setfilter}
The new {setfilter} block tag allows the definition of filters which
run on variable output.
SYNTAX:
{setfilter filter1|filter2|filter3....}
Smarty3 will lookup up matching filters in the following search order:
1. varibale filter plugin in plugins_dir.
2. a valid modifier. A modifier specification will also accept
additional parameter like filter2:'foo'
3. a PHP function
{/setfilter} will turn previous filter setting off again.
{setfilter} tags can be nested.
EXAMPLE:
{setfilter filter1}
{$foo}
{setfilter filter2}
{$bar}
{/setfilter}
{$buh}
{/setfilter}
{$blar}
In the above example filter1 will run on the output of $foo, filter2
on $bar, filter1 again on $buh and no filter on $blar.
NOTES:
- {$foo nofilter} will suppress the filters
- These filters will run in addition to filters defined by
registerFilter('variable',...), autoLoadFilter('variable',...) and
defined default modifier.
- {setfilter} will effect only the current template, not included
subtemplates.
Resource API
Smarty 3.1 features a new approach to resource management. The
Smarty_Resource API allows simple, yet powerful integration of custom
resources for templates and configuration files. It offers simple
functions for loading data from a custom resource (e.g. database) as
well as define new template types adhering to the special
non-compiling (e,g, plain php) and non-compile-caching (e.g. eval:
resource type) resources.
See demo/plugins/resource.mysql.php for an example custom database
resource.
Note that old-fashioned registration of callbacks for resource
management has been deprecated but is still possible with SmartyBC.
CacheResource API
In line with the Resource API, the CacheResource API offers a more
comfortable handling of output-cache data. With the
Smarty_CacheResource_Custom accessing databases is made simple. With
the introduction of Smarty_CacheResource_KeyValueStore the
implementation of resources like memcache or APC became a no-brainer;
simple hash-based storage systems are now supporting hierarchical
output-caches.
See demo/plugins/cacheresource.mysql.php for an example custom
database CacheResource.
See demo/plugins/cacheresource.memcache.php for an example custom
memcache CacheResource using the KeyValueStore helper.
Note that old-fashioned registration of $cache_handler is not possible
anymore. As the functionality had not been ported to Smarty 3.0.x
properly, it has been dropped from 3.1 completely.
Locking facilities have been implemented to avoid concurrent cache
generation. Enable cache locking by setting
$smarty->cache_locking = true;
Relative Paths in Templates (File-Resource)
As of Smarty 3.1 {include file="../foo.tpl"} and {include
file="./foo.tpl"} will resolve relative to the template they're in.
Relative paths are available with {include file="..."} and
{extends file="..."}. As $smarty->fetch('../foo.tpl') and
$smarty->fetch('./foo.tpl') cannot be relative to a template, an
exception is thrown.
Addressing a specific $template_dir
Smarty 3.1 introduces the $template_dir index notation.
$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"}
require the template bar.tpl to be loaded from $template_dir['foo'];
Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to
define indexes along with the actual directories.
Mixing Resources in extends-Resource
Taking the php extends: template resource one step further, it is now
possible to mix resources within an extends: call like
$smarty->fetch("extends:file:foo.tpl|db:bar.tpl");
To make eval: and string: resources available to the inheritance
chain, eval:base64:TPL_STRING and eval:urlencode:TPL_STRING have been
introduced. Supplying the base64 or urlencode flags will trigger
decoding the TPL_STRING in with either base64_decode() or urldecode().
extends-Resource in template inheritance
Template based inheritance may now inherit from php's extends:
resource like {extends file="extends:foo.tpl|db:bar.tpl"}.
New Smarty property escape_html
$smarty->escape_html = true will autoescape all template variable
output by calling htmlspecialchars({$output}, ENT_QUOTES,
SMARTY_RESOURCE_CHAR_SET).
NOTE:
This is a compile time option. If you change the setting you must make
sure that the templates get recompiled.
New option at Smarty property compile_check
The automatic recompilation of modified templates can now be
controlled by the following settings:
$smarty->compile_check = COMPILECHECK_OFF (false) - template files
will not be checked
$smarty->compile_check = COMPILECHECK_ON (true) - template files will
always be checked
$smarty->compile_check = COMPILECHECK_CACHEMISS - template files will
be checked if caching is enabled and there is no existing cache file
or it has expired
Automatic recompilation on Smarty version change
Templates will now be automatically recompiled on Smarty version
changes to avoide incompatibillities in the compiled code. Compiled
template checked against the current setting of the SMARTY_VERSION
constant.
default_config_handler_func()
Analogous to the default_template_handler_func()
default_config_handler_func() has been introduced.
default_plugin_handler_func()
An optional default_plugin_handler_func() can be defined which gets called
by the compiler on tags which can't be resolved internally or by plugins.
The default_plugin_handler() can map tags to plugins on the fly.
New getters/setters
The following setters/getters will be part of the official
documentation, and will be strongly recommended. Direct property
access will still work for the foreseeable future... it will be
transparently routed through the setters/getters, and consequently a
bit slower.
array|string getTemplateDir( [string $index] )
replaces $smarty->template_dir; and $smarty->template_dir[$index];
Smarty setTemplateDir( array|string $path )
replaces $smarty->template_dir = "foo"; and $smarty->template_dir =
array("foo", "bar");
Smarty addTemplateDir( array|string $path, [string $index])
replaces $smarty->template_dir[] = "bar"; and
$smarty->template_dir[$index] = "bar";
array|string getConfigDir( [string $index] )
replaces $smarty->config_dir; and $smarty->config_dir[$index];
Smarty setConfigDir( array|string $path )
replaces $smarty->config_dir = "foo"; and $smarty->config_dir =
array("foo", "bar");
Smarty addConfigDir( array|string $path, [string $index])
replaces $smarty->config_dir[] = "bar"; and
$smarty->config_dir[$index] = "bar";
array getPluginsDir()
replaces $smarty->plugins_dir;
Smarty setPluginsDir( array|string $path )
replaces $smarty->plugins_dir = "foo";
Smarty addPluginsDir( array|string $path )
replaces $smarty->plugins_dir[] = "bar";
string getCompileDir()
replaces $smarty->compile_dir;
Smarty setCompileDir( string $path )
replaces $smarty->compile_dir = "foo";
string getCacheDir()
replaces $smarty->cache_dir;
Smarty setCacheDir( string $path )
replaces $smarty->cache_dir;
File diff suppressed because it is too large Load Diff
@@ -1,393 +0,0 @@
<?php
/**
* Config_File class.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com
*
* @link http://www.smarty.net/
* @version 2.6.26
* @copyright Copyright: 2001-2005 New Digital Group, Inc.
* @author Andrei Zmievski <andrei@php.net>
* @access public
* @package Smarty
*/
/* $Id: Config_File.class.php 3149 2009-05-23 20:59:25Z monte.ohrt $ */
/**
* Config file reading class
* @package Smarty
*/
class Config_File {
/**#@+
* Options
* @var boolean
*/
/**
* Controls whether variables with the same name overwrite each other.
*/
var $overwrite = true;
/**
* Controls whether config values of on/true/yes and off/false/no get
* converted to boolean values automatically.
*/
var $booleanize = true;
/**
* Controls whether hidden config sections/vars are read from the file.
*/
var $read_hidden = true;
/**
* Controls whether or not to fix mac or dos formatted newlines.
* If set to true, \r or \r\n will be changed to \n.
*/
var $fix_newlines = true;
/**#@-*/
/** @access private */
var $_config_path = "";
var $_config_data = array();
/**#@-*/
/**
* Constructs a new config file class.
*
* @param string $config_path (optional) path to the config files
*/
function Config_File($config_path = NULL)
{
if (isset($config_path))
$this->set_path($config_path);
}
/**
* Set the path where configuration files can be found.
*
* @param string $config_path path to the config files
*/
function set_path($config_path)
{
if (!empty($config_path)) {
if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) {
$this->_trigger_error_msg("Bad config file path '$config_path'");
return;
}
if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
$config_path .= DIRECTORY_SEPARATOR;
}
$this->_config_path = $config_path;
}
}
/**
* Retrieves config info based on the file, section, and variable name.
*
* @param string $file_name config file to get info for
* @param string $section_name (optional) section to get info for
* @param string $var_name (optional) variable to get info for
* @return string|array a value or array of values
*/
function get($file_name, $section_name = NULL, $var_name = NULL)
{
if (empty($file_name)) {
$this->_trigger_error_msg('Empty config file name');
return;
} else {
$file_name = $this->_config_path . $file_name;
if (!isset($this->_config_data[$file_name]))
$this->load_file($file_name, false);
}
if (!empty($var_name)) {
if (empty($section_name)) {
return $this->_config_data[$file_name]["vars"][$var_name];
} else {
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
else
return array();
}
} else {
if (empty($section_name)) {
return (array)$this->_config_data[$file_name]["vars"];
} else {
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
else
return array();
}
}
}
/**
* Retrieves config info based on the key.
*
* @param $file_name string config key (filename/section/var)
* @return string|array same as get()
* @uses get() retrieves information from config file and returns it
*/
function &get_key($config_key)
{
list($file_name, $section_name, $var_name) = explode('/', $config_key, 3);
$result = &$this->get($file_name, $section_name, $var_name);
return $result;
}
/**
* Get all loaded config file names.
*
* @return array an array of loaded config file names
*/
function get_file_names()
{
return array_keys($this->_config_data);
}
/**
* Get all section names from a loaded file.
*
* @param string $file_name config file to get section names from
* @return array an array of section names from the specified file
*/
function get_section_names($file_name)
{
$file_name = $this->_config_path . $file_name;
if (!isset($this->_config_data[$file_name])) {
$this->_trigger_error_msg("Unknown config file '$file_name'");
return;
}
return array_keys($this->_config_data[$file_name]["sections"]);
}
/**
* Get all global or section variable names.
*
* @param string $file_name config file to get info for
* @param string $section_name (optional) section to get info for
* @return array an array of variables names from the specified file/section
*/
function get_var_names($file_name, $section = NULL)
{
if (empty($file_name)) {
$this->_trigger_error_msg('Empty config file name');
return;
} else if (!isset($this->_config_data[$file_name])) {
$this->_trigger_error_msg("Unknown config file '$file_name'");
return;
}
if (empty($section))
return array_keys($this->_config_data[$file_name]["vars"]);
else
return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
}
/**
* Clear loaded config data for a certain file or all files.
*
* @param string $file_name file to clear config data for
*/
function clear($file_name = NULL)
{
if ($file_name === NULL)
$this->_config_data = array();
else if (isset($this->_config_data[$file_name]))
$this->_config_data[$file_name] = array();
}
/**
* Load a configuration file manually.
*
* @param string $file_name file name to load
* @param boolean $prepend_path whether current config path should be
* prepended to the filename
*/
function load_file($file_name, $prepend_path = true)
{
if ($prepend_path && $this->_config_path != "")
$config_file = $this->_config_path . $file_name;
else
$config_file = $file_name;
ini_set('track_errors', true);
$fp = @fopen($config_file, "r");
if (!is_resource($fp)) {
$this->_trigger_error_msg("Could not open config file '$config_file'");
return false;
}
$contents = ($size = filesize($config_file)) ? fread($fp, $size) : '';
fclose($fp);
$this->_config_data[$config_file] = $this->parse_contents($contents);
return true;
}
/**
* Store the contents of a file manually.
*
* @param string $config_file file name of the related contents
* @param string $contents the file-contents to parse
*/
function set_file_contents($config_file, $contents)
{
$this->_config_data[$config_file] = $this->parse_contents($contents);
return true;
}
/**
* parse the source of a configuration file manually.
*
* @param string $contents the file-contents to parse
*/
function parse_contents($contents)
{
if($this->fix_newlines) {
// fix mac/dos formatted newlines
$contents = preg_replace('!\r\n?!', "\n", $contents);
}
$config_data = array();
$config_data['sections'] = array();
$config_data['vars'] = array();
/* reference to fill with data */
$vars =& $config_data['vars'];
/* parse file line by line */
preg_match_all('!^.*\r?\n?!m', $contents, $match);
$lines = $match[0];
for ($i=0, $count=count($lines); $i<$count; $i++) {
$line = $lines[$i];
if (empty($line)) continue;
if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
/* section found */
if (substr($match[1], 0, 1) == '.') {
/* hidden section */
if ($this->read_hidden) {
$section_name = substr($match[1], 1);
} else {
/* break reference to $vars to ignore hidden section */
unset($vars);
$vars = array();
continue;
}
} else {
$section_name = $match[1];
}
if (!isset($config_data['sections'][$section_name]))
$config_data['sections'][$section_name] = array('vars' => array());
$vars =& $config_data['sections'][$section_name]['vars'];
continue;
}
if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) {
/* variable found */
$var_name = rtrim($match[1]);
if (strpos($match[2], '"""') === 0) {
/* handle multiline-value */
$lines[$i] = substr($match[2], 3);
$var_value = '';
while ($i<$count) {
if (($pos = strpos($lines[$i], '"""')) === false) {
$var_value .= $lines[$i++];
} else {
/* end of multiline-value */
$var_value .= substr($lines[$i], 0, $pos);
break;
}
}
$booleanize = false;
} else {
/* handle simple value */
$var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2]));
$booleanize = $this->booleanize;
}
$this->_set_config_var($vars, $var_name, $var_value, $booleanize);
}
/* else unparsable line / means it is a comment / means ignore it */
}
return $config_data;
}
/**#@+ @access private */
/**
* @param array &$container
* @param string $var_name
* @param mixed $var_value
* @param boolean $booleanize determines whether $var_value is converted to
* to true/false
*/
function _set_config_var(&$container, $var_name, $var_value, $booleanize)
{
if (substr($var_name, 0, 1) == '.') {
if (!$this->read_hidden)
return;
else
$var_name = substr($var_name, 1);
}
if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) {
$this->_trigger_error_msg("Bad variable name '$var_name'");
return;
}
if ($booleanize) {
if (preg_match("/^(on|true|yes)$/i", $var_value))
$var_value = true;
else if (preg_match("/^(off|false|no)$/i", $var_value))
$var_value = false;
}
if (!isset($container[$var_name]) || $this->overwrite)
$container[$var_name] = $var_value;
else {
settype($container[$var_name], 'array');
$container[$var_name][] = $var_value;
}
}
/**
* @uses trigger_error() creates a PHP warning/error
* @param string $error_msg
* @param integer $error_type one of
*/
function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Config_File error: $error_msg", $error_type);
}
/**#@-*/
}
?>
File diff suppressed because it is too large Load Diff
+460
View File
@@ -0,0 +1,460 @@
<?php
/**
* Project: Smarty: the PHP compiling template engine
* File: SmartyBC.class.php
* SVN: $Id: $
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com
*
* @link http://www.smarty.net/
* @copyright 2008 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
*/
/**
* @ignore
*/
require(dirname(__FILE__) . '/Smarty.class.php');
/**
* Smarty Backward Compatability Wrapper Class
*
* @package Smarty
*/
class SmartyBC extends Smarty {
/**
* Smarty 2 BC
* @var string
*/
public $_version = self::SMARTY_VERSION;
/**
* Initialize new SmartyBC object
*
* @param array $options options to set during initialization, e.g. array( 'forceCompile' => false )
*/
public function __construct(array $options=array())
{
parent::__construct($options);
// register {php} tag
$this->registerPlugin('block', 'php', 'smarty_php_tag');
}
/**
* wrapper for assign_by_ref
*
* @param string $tpl_var the template variable name
* @param mixed &$value the referenced value to assign
*/
public function assign_by_ref($tpl_var, &$value)
{
$this->assignByRef($tpl_var, $value);
}
/**
* wrapper for append_by_ref
*
* @param string $tpl_var the template variable name
* @param mixed &$value the referenced value to append
* @param boolean $merge flag if array elements shall be merged
*/
public function append_by_ref($tpl_var, &$value, $merge = false)
{
$this->appendByRef($tpl_var, $value, $merge);
}
/**
* clear the given assigned template variable.
*
* @param string $tpl_var the template variable to clear
*/
public function clear_assign($tpl_var)
{
$this->clearAssign($tpl_var);
}
/**
* Registers custom function to be used in templates
*
* @param string $function the name of the template function
* @param string $function_impl the name of the PHP function to register
* @param bool $cacheable
* @param mixed $cache_attrs
*/
public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
{
$this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);
}
/**
* Unregisters custom function
*
* @param string $function name of template function
*/
public function unregister_function($function)
{
$this->unregisterPlugin('function', $function);
}
/**
* Registers object to be used in templates
*
* @param string $object name of template object
* @param object $object_impl the referenced PHP object to register
* @param array $allowed list of allowed methods (empty = all)
* @param boolean $smarty_args smarty argument format, else traditional
* @param array $block_functs list of methods that are block format
*/
public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
settype($allowed, 'array');
settype($smarty_args, 'boolean');
$this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);
}
/**
* Unregisters object
*
* @param string $object name of template object
*/
public function unregister_object($object)
{
$this->unregisterObject($object);
}
/**
* Registers block function to be used in templates
*
* @param string $block name of template block
* @param string $block_impl PHP function to register
* @param bool $cacheable
* @param mixed $cache_attrs
*/
public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
{
$this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);
}
/**
* Unregisters block function
*
* @param string $block name of template function
*/
public function unregister_block($block)
{
$this->unregisterPlugin('block', $block);
}
/**
* Registers compiler function
*
* @param string $function name of template function
* @param string $function_impl name of PHP function to register
* @param bool $cacheable
*/
public function register_compiler_function($function, $function_impl, $cacheable=true)
{
$this->registerPlugin('compiler', $function, $function_impl, $cacheable);
}
/**
* Unregisters compiler function
*
* @param string $function name of template function
*/
public function unregister_compiler_function($function)
{
$this->unregisterPlugin('compiler', $function);
}
/**
* Registers modifier to be used in templates
*
* @param string $modifier name of template modifier
* @param string $modifier_impl name of PHP function to register
*/
public function register_modifier($modifier, $modifier_impl)
{
$this->registerPlugin('modifier', $modifier, $modifier_impl);
}
/**
* Unregisters modifier
*
* @param string $modifier name of template modifier
*/
public function unregister_modifier($modifier)
{
$this->unregisterPlugin('modifier', $modifier);
}
/**
* Registers a resource to fetch a template
*
* @param string $type name of resource
* @param array $functions array of functions to handle resource
*/
public function register_resource($type, $functions)
{
$this->registerResource($type, $functions);
}
/**
* Unregisters a resource
*
* @param string $type name of resource
*/
public function unregister_resource($type)
{
$this->unregisterResource($type);
}
/**
* Registers a prefilter function to apply
* to a template before compiling
*
* @param callable $function
*/
public function register_prefilter($function)
{
$this->registerFilter('pre', $function);
}
/**
* Unregisters a prefilter function
*
* @param callable $function
*/
public function unregister_prefilter($function)
{
$this->unregisterFilter('pre', $function);
}
/**
* Registers a postfilter function to apply
* to a compiled template after compilation
*
* @param callable $function
*/
public function register_postfilter($function)
{
$this->registerFilter('post', $function);
}
/**
* Unregisters a postfilter function
*
* @param callable $function
*/
public function unregister_postfilter($function)
{
$this->unregisterFilter('post', $function);
}
/**
* Registers an output filter function to apply
* to a template output
*
* @param callable $function
*/
public function register_outputfilter($function)
{
$this->registerFilter('output', $function);
}
/**
* Unregisters an outputfilter function
*
* @param callable $function
*/
public function unregister_outputfilter($function)
{
$this->unregisterFilter('output', $function);
}
/**
* load a filter of specified type and name
*
* @param string $type filter type
* @param string $name filter name
*/
public function load_filter($type, $name)
{
$this->loadFilter($type, $name);
}
/**
* clear cached content for the given template and cache id
*
* @param string $tpl_file name of template file
* @param string $cache_id name of cache_id
* @param string $compile_id name of compile_id
* @param string $exp_time expiration time
* @return boolean
*/
public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
{
return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);
}
/**
* clear the entire contents of cache (all templates)
*
* @param string $exp_time expire time
* @return boolean
*/
public function clear_all_cache($exp_time = null)
{
return $this->clearCache(null, null, null, $exp_time);
}
/**
* test to see if valid cache exists for this template
*
* @param string $tpl_file name of template file
* @param string $cache_id
* @param string $compile_id
* @return boolean
*/
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{
return $this->isCached($tpl_file, $cache_id, $compile_id);
}
/**
* clear all the assigned template variables.
*/
public function clear_all_assign()
{
$this->clearAllAssign();
}
/**
* clears compiled version of specified template resource,
* or all compiled template files if one is not specified.
* This function is for advanced use only, not normally needed.
*
* @param string $tpl_file
* @param string $compile_id
* @param string $exp_time
* @return boolean results of {@link smarty_core_rm_auto()}
*/
public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
{
return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);
}
/**
* Checks whether requested template exists.
*
* @param string $tpl_file
* @return boolean
*/
public function template_exists($tpl_file)
{
return $this->templateExists($tpl_file);
}
/**
* Returns an array containing template variables
*
* @param string $name
* @return array
*/
public function get_template_vars($name=null)
{
return $this->getTemplateVars($name);
}
/**
* Returns an array containing config variables
*
* @param string $name
* @return array
*/
public function get_config_vars($name=null)
{
return $this->getConfigVars($name);
}
/**
* load configuration values
*
* @param string $file
* @param string $section
* @param string $scope
*/
public function config_load($file, $section = null, $scope = 'global')
{
$this->ConfigLoad($file, $section, $scope);
}
/**
* return a reference to a registered object
*
* @param string $name
* @return object
*/
public function get_registered_object($name)
{
return $this->getRegisteredObject($name);
}
/**
* clear configuration values
*
* @param string $var
*/
public function clear_config($var = null)
{
$this->clearConfig($var);
}
/**
* trigger Smarty error
*
* @param string $error_msg
* @param integer $error_type
*/
public function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
}
}
/**
* Smarty {php}{/php} block function
*
* @param array $params parameter list
* @param string $content contents of the block
* @param object $template template object
* @param boolean &$repeat repeat flag
* @return string content re-formatted
*/
function smarty_php_tag($params, $content, $template, &$repeat)
{
eval($content);
return '';
}
?>
File diff suppressed because it is too large Load Diff
+27 -51
View File
@@ -1,14 +1,10 @@
{* Smarty *}
{* debug.tpl, last updated version 2.1.0 *}
{assign_debug_info}
{capture assign=debug_output}
{capture name='_smarty_debug' assign=debug_output}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Smarty Debug Console</title>
{literal}
<style type="text/css">
/* <![CDATA[ */
{literal}
body, h1, h2, td, th, p {
font-family: sans-serif;
font-weight: normal;
@@ -85,73 +81,53 @@ td {
#table_config_vars th {
color: maroon;
}
/* ]]> */
</style>
{/literal}
</style>
</head>
<body>
<h1>Smarty Debug Console</h1>
<h1>Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
{if !empty($template_data)}
<h2>included templates &amp; config files (load time in seconds)</h2>
<div>
{section name=templates loop=$_debug_tpls}
{section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/section}
<font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>
{$_debug_tpls[templates].filename|escape:html}</font>
{if isset($_debug_tpls[templates].exec_time)}
<span class="exectime">
({$_debug_tpls[templates].exec_time|string_format:"%.5f"})
{if %templates.index% eq 0}(total){/if}
</span>
{/if}
<br />
{sectionelse}
<p>no templates included</p>
{/section}
{foreach $template_data as $template}
<font color=brown>{$template.name}</font>
<span class="exectime">
(compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
</span>
<br>
{/foreach}
</div>
{/if}
<h2>assigned template variables</h2>
<table id="table_assigned_vars">
{section name=vars loop=$_debug_keys}
<tr class="{cycle values="odd,even"}">
<th>{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}</th>
<td>{$_debug_vals[vars]|@debug_print_var}</td></tr>
{sectionelse}
<tr><td><p>no template variables assigned</p></td></tr>
{/section}
{foreach $assigned_vars as $vars}
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<th>${$vars@key|escape:'html'}</th>
<td>{$vars|debug_print_var nofilter}</td></tr>
{/foreach}
</table>
<h2>assigned config file variables (outer template scope)</h2>
<table id="table_config_vars">
{section name=config_vars loop=$_debug_config_keys}
<tr class="{cycle values="odd,even"}">
<th>{ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}</th>
<td>{$_debug_config_vals[config_vars]|@debug_print_var}</td></tr>
{sectionelse}
<tr><td><p>no config vars assigned</p></td></tr>
{/section}
{foreach $config_vars as $vars}
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
<th>{$vars@key|escape:'html'}</th>
<td>{$vars|debug_print_var nofilter}</td></tr>
{/foreach}
</table>
</body>
</html>
{/capture}
{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
{$debug_output}
{else}
<script type="text/javascript">
// <![CDATA[
if ( self.name == '' ) {ldelim}
var title = 'Console';
{rdelim}
else {ldelim}
var title = 'Console_' + self.name;
{rdelim}
_smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write('{$debug_output|escape:'javascript'}');
{$id = $template_name|default:''|md5}
_smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
_smarty_console.document.close();
// ]]>
</script>
{/if}
@@ -1,67 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* assemble filepath of requested plugin
*
* @param string $type
* @param string $name
* @return string|false
*/
function smarty_core_assemble_plugin_filepath($params, &$smarty)
{
static $_filepaths_cache = array();
$_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
if (isset($_filepaths_cache[$_plugin_filename])) {
return $_filepaths_cache[$_plugin_filename];
}
$_return = false;
foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
// see if path is relative
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
$_relative_paths[] = $_plugin_dir;
// relative path, see if it is in the SMARTY_DIR
if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
$_return = SMARTY_DIR . $_plugin_filepath;
break;
}
}
// try relative to cwd (or absolute)
if (@is_readable($_plugin_filepath)) {
$_return = $_plugin_filepath;
break;
}
}
if($_return === false) {
// still not found, try PHP include_path
if(isset($_relative_paths)) {
foreach ((array)$_relative_paths as $_plugin_dir) {
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
$_params = array('file_path' => $_plugin_filepath);
require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $smarty)) {
$_return = $_params['new_file_path'];
break;
}
}
}
}
$_filepaths_cache[$_plugin_filename] = $_return;
return $_return;
}
/* vim: set expandtab: */
?>
@@ -1,43 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty assign_smarty_interface core plugin
*
* Type: core<br>
* Name: assign_smarty_interface<br>
* Purpose: assign the $smarty interface variable
* @param array Format: null
* @param Smarty
*/
function smarty_core_assign_smarty_interface($params, &$smarty)
{
if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
return;
}
$_globals_map = array('g' => 'HTTP_GET_VARS',
'p' => 'HTTP_POST_VARS',
'c' => 'HTTP_COOKIE_VARS',
's' => 'HTTP_SERVER_VARS',
'e' => 'HTTP_ENV_VARS');
$_smarty_vars_request = array();
foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
if (isset($_globals_map[$_c])) {
$_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
}
}
$_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
$smarty->_smarty_vars['request'] = $_smarty_vars_request;
}
/* vim: set expandtab: */
?>
@@ -1,79 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* create full directory structure
*
* @param string $dir
*/
// $dir
function smarty_core_create_dir_structure($params, &$smarty)
{
if (!file_exists($params['dir'])) {
$_open_basedir_ini = ini_get('open_basedir');
if (DIRECTORY_SEPARATOR=='/') {
/* unix-style paths */
$_dir = $params['dir'];
$_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
$_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';
if($_use_open_basedir = !empty($_open_basedir_ini)) {
$_open_basedirs = explode(':', $_open_basedir_ini);
}
} else {
/* other-style paths */
$_dir = str_replace('\\','/', $params['dir']);
$_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {
/* leading "//" for network volume, or "[letter]:/" for full path */
$_new_dir = $_root_dir[1];
/* remove drive-letter from _dir_parts */
if (isset($_root_dir[3])) array_shift($_dir_parts);
} else {
$_new_dir = str_replace('\\', '/', getcwd()).'/';
}
if($_use_open_basedir = !empty($_open_basedir_ini)) {
$_open_basedirs = explode(';', str_replace('\\', '/', $_open_basedir_ini));
}
}
/* all paths use "/" only from here */
foreach ($_dir_parts as $_dir_part) {
$_new_dir .= $_dir_part;
if ($_use_open_basedir) {
// do not attempt to test or make directories outside of open_basedir
$_make_new_dir = false;
foreach ($_open_basedirs as $_open_basedir) {
if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {
$_make_new_dir = true;
break;
}
}
} else {
$_make_new_dir = true;
}
if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {
$smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
return false;
}
$_new_dir .= '/';
}
}
}
/* vim: set expandtab: */
?>
@@ -1,61 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty debug_console function plugin
*
* Type: core<br>
* Name: display_debug_console<br>
* Purpose: display the javascript debug console window
* @param array Format: null
* @param Smarty
*/
function smarty_core_display_debug_console($params, &$smarty)
{
// we must force compile the debug template in case the environment
// changed between separate applications.
if(empty($smarty->debug_tpl)) {
// set path to debug template from SMARTY_DIR
$smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
if($smarty->security && is_file($smarty->debug_tpl)) {
$smarty->secure_dir[] = realpath($smarty->debug_tpl);
}
$smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
}
$_ldelim_orig = $smarty->left_delimiter;
$_rdelim_orig = $smarty->right_delimiter;
$smarty->left_delimiter = '{';
$smarty->right_delimiter = '}';
$_compile_id_orig = $smarty->_compile_id;
$smarty->_compile_id = null;
$_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path))
{
ob_start();
$smarty->_include($_compile_path);
$_results = ob_get_contents();
ob_end_clean();
} else {
$_results = '';
}
$smarty->_compile_id = $_compile_id_orig;
$smarty->left_delimiter = $_ldelim_orig;
$smarty->right_delimiter = $_rdelim_orig;
return $_results;
}
/* vim: set expandtab: */
?>
@@ -1,44 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Get path to file from include_path
*
* @param string $file_path
* @param string $new_file_path
* @return boolean
* @staticvar array|null
*/
// $file_path, &$new_file_path
function smarty_core_get_include_path(&$params, &$smarty)
{
static $_path_array = null;
if(!isset($_path_array)) {
$_ini_include_path = ini_get('include_path');
if(strstr($_ini_include_path,';')) {
// windows pathnames
$_path_array = explode(';',$_ini_include_path);
} else {
$_path_array = explode(':',$_ini_include_path);
}
}
foreach ($_path_array as $_include_path) {
if (@is_readable($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
$params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
return true;
}
}
return false;
}
/* vim: set expandtab: */
?>
@@ -1,23 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Get seconds and microseconds
* @return double
*/
function smarty_core_get_microtime($params, &$smarty)
{
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = (double)($mtime[1]) + (double)($mtime[0]);
return ($mtime);
}
/* vim: set expandtab: */
?>
@@ -1,80 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Retrieves PHP script resource
*
* sets $php_resource to the returned resource
* @param string $resource
* @param string $resource_type
* @param $php_resource
* @return boolean
*/
function smarty_core_get_php_resource(&$params, &$smarty)
{
$params['resource_base_path'] = $smarty->trusted_dir;
$smarty->_parse_resource_name($params, $smarty);
/*
* Find out if the resource exists.
*/
if ($params['resource_type'] == 'file') {
$_readable = false;
if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) {
$_readable = true;
} else {
// test for file in include_path
$_params = array('file_path' => $params['resource_name']);
require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $smarty)) {
$_include_path = $_params['new_file_path'];
$_readable = true;
}
}
} else if ($params['resource_type'] != 'file') {
$_template_source = null;
$_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0])
&& call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0],
array($params['resource_name'], &$_template_source, &$smarty));
}
/*
* Set the error function, depending on which class calls us.
*/
if (method_exists($smarty, '_syntax_error')) {
$_error_funcc = '_syntax_error';
} else {
$_error_funcc = 'trigger_error';
}
if ($_readable) {
if ($smarty->security) {
require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
if (!smarty_core_is_trusted($params, $smarty)) {
$smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
return false;
}
}
} else {
$smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable');
return false;
}
if ($params['resource_type'] == 'file') {
$params['php_resource'] = $params['resource_name'];
} else {
$params['php_resource'] = $_template_source;
}
return true;
}
/* vim: set expandtab: */
?>
@@ -1,59 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* determines if a resource is secure or not.
*
* @param string $resource_type
* @param string $resource_name
* @return boolean
*/
// $resource_type, $resource_name
function smarty_core_is_secure($params, &$smarty)
{
if (!$smarty->security || $smarty->security_settings['INCLUDE_ANY']) {
return true;
}
if ($params['resource_type'] == 'file') {
$_rp = realpath($params['resource_name']);
if (isset($params['resource_base_path'])) {
foreach ((array)$params['resource_base_path'] as $curr_dir) {
if ( ($_cd = realpath($curr_dir)) !== false &&
strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
return true;
}
}
}
if (!empty($smarty->secure_dir)) {
foreach ((array)$smarty->secure_dir as $curr_dir) {
if ( ($_cd = realpath($curr_dir)) !== false) {
if($_cd == $_rp) {
return true;
} elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) {
return true;
}
}
}
}
} else {
// resource is not on local file system
return call_user_func_array(
$smarty->_plugins['resource'][$params['resource_type']][0][2],
array($params['resource_name'], &$smarty));
}
return false;
}
/* vim: set expandtab: */
?>
@@ -1,47 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* determines if a resource is trusted or not
*
* @param string $resource_type
* @param string $resource_name
* @return boolean
*/
// $resource_type, $resource_name
function smarty_core_is_trusted($params, &$smarty)
{
$_smarty_trusted = false;
if ($params['resource_type'] == 'file') {
if (!empty($smarty->trusted_dir)) {
$_rp = realpath($params['resource_name']);
foreach ((array)$smarty->trusted_dir as $curr_dir) {
if (!empty($curr_dir) && is_readable ($curr_dir)) {
$_cd = realpath($curr_dir);
if (strncmp($_rp, $_cd, strlen($_cd)) == 0
&& substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
$_smarty_trusted = true;
break;
}
}
}
}
} else {
// resource is not on local file system
$_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
array($params['resource_name'], $smarty));
}
return $_smarty_trusted;
}
/* vim: set expandtab: */
?>
@@ -1,125 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Load requested plugins
*
* @param array $plugins
*/
// $plugins
function smarty_core_load_plugins($params, &$smarty)
{
foreach ($params['plugins'] as $_plugin_info) {
list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
$_plugin = &$smarty->_plugins[$_type][$_name];
/*
* We do not load plugin more than once for each instance of Smarty.
* The following code checks for that. The plugin can also be
* registered dynamically at runtime, in which case template file
* and line number will be unknown, so we fill them in.
*
* The final element of the info array is a flag that indicates
* whether the dynamically registered plugin function has been
* checked for existence yet or not.
*/
if (isset($_plugin)) {
if (empty($_plugin[3])) {
if (!is_callable($_plugin[0])) {
$smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
} else {
$_plugin[1] = $_tpl_file;
$_plugin[2] = $_tpl_line;
$_plugin[3] = true;
if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
}
}
continue;
} else if ($_type == 'insert') {
/*
* For backwards compatibility, we check for insert functions in
* the symbol table before trying to load them as a plugin.
*/
$_plugin_func = 'insert_' . $_name;
if (function_exists($_plugin_func)) {
$_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false);
continue;
}
}
$_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
if (! $_found = ($_plugin_file != false)) {
$_message = "could not load plugin file '$_type.$_name.php'\n";
}
/*
* If plugin file is found, it -must- provide the properly named
* plugin function. In case it doesn't, simply output the error and
* do not fall back on any other method.
*/
if ($_found) {
include_once $_plugin_file;
$_plugin_func = 'smarty_' . $_type . '_' . $_name;
if (!function_exists($_plugin_func)) {
$smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
continue;
}
}
/*
* In case of insert plugins, their code may be loaded later via
* 'script' attribute.
*/
else if ($_type == 'insert' && $_delayed_loading) {
$_plugin_func = 'smarty_' . $_type . '_' . $_name;
$_found = true;
}
/*
* Plugin specific processing and error checking.
*/
if (!$_found) {
if ($_type == 'modifier') {
/*
* In case modifier falls back on using PHP functions
* directly, we only allow those specified in the security
* context.
*/
if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) {
$_message = "(secure mode) modifier '$_name' is not allowed";
} else {
if (!function_exists($_name)) {
$_message = "modifier '$_name' is not implemented";
} else {
$_plugin_func = $_name;
$_found = true;
}
}
} else if ($_type == 'function') {
/*
* This is a catch-all situation.
*/
$_message = "unknown tag - '$_name'";
}
}
if ($_found) {
$smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true);
} else {
// output error
$smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);
}
}
}
/* vim: set expandtab: */
?>
@@ -1,74 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* load a resource plugin
*
* @param string $type
*/
// $type
function smarty_core_load_resource_plugin($params, &$smarty)
{
/*
* Resource plugins are not quite like the other ones, so they are
* handled differently. The first element of plugin info is the array of
* functions provided by the plugin, the second one indicates whether
* all of them exist or not.
*/
$_plugin = &$smarty->_plugins['resource'][$params['type']];
if (isset($_plugin)) {
if (!$_plugin[1] && count($_plugin[0])) {
$_plugin[1] = true;
foreach ($_plugin[0] as $_plugin_func) {
if (!is_callable($_plugin_func)) {
$_plugin[1] = false;
break;
}
}
}
if (!$_plugin[1]) {
$smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__);
}
return;
}
$_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']);
$_found = ($_plugin_file != false);
if ($_found) { /*
* If the plugin file is found, it -must- provide the properly named
* plugin functions.
*/
include_once($_plugin_file);
/*
* Locate functions that we require the plugin to provide.
*/
$_resource_ops = array('source', 'timestamp', 'secure', 'trusted');
$_resource_funcs = array();
foreach ($_resource_ops as $_op) {
$_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op;
if (!function_exists($_plugin_func)) {
$smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__);
return;
} else {
$_resource_funcs[] = $_plugin_func;
}
}
$smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true);
}
}
/* vim: set expandtab: */
?>
@@ -1,71 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Replace cached inserts with the actual results
*
* @param string $results
* @return string
*/
function smarty_core_process_cached_inserts($params, &$smarty)
{
preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
$params['results'], $match);
list($cached_inserts, $insert_args) = $match;
for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$debug_start_time = smarty_core_get_microtime($_params, $smarty);
}
$args = unserialize($insert_args[$i]);
$name = $args['name'];
if (isset($args['script'])) {
$_params = array('resource_name' => $smarty->_dequote($args['script']));
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
if(!smarty_core_get_php_resource($_params, $smarty)) {
return false;
}
$resource_type = $_params['resource_type'];
$php_resource = $_params['php_resource'];
if ($resource_type == 'file') {
$smarty->_include($php_resource, true);
} else {
$smarty->_eval($php_resource);
}
}
$function_name = $smarty->_plugins['insert'][$name][0];
if (empty($args['assign'])) {
$replace = $function_name($args, $smarty);
} else {
$smarty->assign($args['assign'], $function_name($args, $smarty));
$replace = '';
}
$params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$name,
'depth' => $smarty->_inclusion_depth,
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
}
}
return $params['results'];
}
/* vim: set expandtab: */
?>
@@ -1,37 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Replace nocache-tags by results of the corresponding non-cacheable
* functions and return it
*
* @param string $compiled_tpl
* @param string $cached_source
* @return string
*/
function smarty_core_process_compiled_include($params, &$smarty)
{
$_cache_including = $smarty->_cache_including;
$smarty->_cache_including = true;
$_return = $params['results'];
foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
$smarty->_include($_include_file_path, true);
}
foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
$_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
array(&$smarty, '_process_compiled_include_callback'),
$_return);
}
$smarty->_cache_including = $_cache_including;
return $_return;
}
?>
@@ -1,101 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* read a cache file, determine if it needs to be
* regenerated or not
*
* @param string $tpl_file
* @param string $cache_id
* @param string $compile_id
* @param string $results
* @return boolean
*/
// $tpl_file, $cache_id, $compile_id, &$results
function smarty_core_read_cache_file(&$params, &$smarty)
{
static $content_cache = array();
if ($smarty->force_compile) {
// force compile enabled, always regenerate
return false;
}
if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) {
list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']];
return true;
}
if (!empty($smarty->cache_handler_func)) {
// use cache_handler function
call_user_func_array($smarty->cache_handler_func,
array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
} else {
// use local cache file
$_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
$_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
$params['results'] = $smarty->_read_file($_cache_file);
}
if (empty($params['results'])) {
// nothing to parse (error?), regenerate cache
return false;
}
$_contents = $params['results'];
$_info_start = strpos($_contents, "\n") + 1;
$_info_len = (int)substr($_contents, 0, $_info_start - 1);
$_cache_info = unserialize(substr($_contents, $_info_start, $_info_len));
$params['results'] = substr($_contents, $_info_start + $_info_len);
if ($smarty->caching == 2 && isset ($_cache_info['expires'])){
// caching by expiration time
if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) {
// cache expired, regenerate
return false;
}
} else {
// caching by lifetime
if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) {
// cache expired, regenerate
return false;
}
}
if ($smarty->compile_check) {
$_params = array('get_source' => false, 'quiet'=>true);
foreach (array_keys($_cache_info['template']) as $_template_dep) {
$_params['resource_name'] = $_template_dep;
if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
// template file has changed, regenerate cache
return false;
}
}
if (isset($_cache_info['config'])) {
$_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true);
foreach (array_keys($_cache_info['config']) as $_config_dep) {
$_params['resource_name'] = $_config_dep;
if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
// config file has changed, regenerate cache
return false;
}
}
}
}
$content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info);
$smarty->_cache_info = $_cache_info;
return true;
}
/* vim: set expandtab: */
?>
@@ -1,71 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* delete an automagically created file by name and id
*
* @param string $auto_base
* @param string $auto_source
* @param string $auto_id
* @param integer $exp_time
* @return boolean
*/
// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
function smarty_core_rm_auto($params, &$smarty)
{
if (!@is_dir($params['auto_base']))
return false;
if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
$_params = array(
'dirname' => $params['auto_base'],
'level' => 0,
'exp_time' => $params['exp_time']
);
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
$_res = smarty_core_rmdir($_params, $smarty);
} else {
$_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
if(isset($params['auto_source'])) {
if (isset($params['extensions'])) {
$_res = false;
foreach ((array)$params['extensions'] as $_extension)
$_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
} else {
$_res = $smarty->_unlink($_tname, $params['exp_time']);
}
} elseif ($smarty->use_sub_dirs) {
$_params = array(
'dirname' => $_tname,
'level' => 1,
'exp_time' => $params['exp_time']
);
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
$_res = smarty_core_rmdir($_params, $smarty);
} else {
// remove matching file names
$_handle = opendir($params['auto_base']);
$_res = true;
while (false !== ($_filename = readdir($_handle))) {
if($_filename == '.' || $_filename == '..') {
continue;
} elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
$_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
}
}
}
}
return $_res;
}
/* vim: set expandtab: */
?>
@@ -1,54 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* delete a dir recursively (level=0 -> keep root)
* WARNING: no tests, it will try to remove what you tell it!
*
* @param string $dirname
* @param integer $level
* @param integer $exp_time
* @return boolean
*/
// $dirname, $level = 1, $exp_time = null
function smarty_core_rmdir($params, &$smarty)
{
if(!isset($params['level'])) { $params['level'] = 1; }
if(!isset($params['exp_time'])) { $params['exp_time'] = null; }
if($_handle = @opendir($params['dirname'])) {
while (false !== ($_entry = readdir($_handle))) {
if ($_entry != '.' && $_entry != '..') {
if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) {
$_params = array(
'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry,
'level' => $params['level'] + 1,
'exp_time' => $params['exp_time']
);
smarty_core_rmdir($_params, $smarty);
}
else {
$smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']);
}
}
}
closedir($_handle);
}
if ($params['level']) {
return @rmdir($params['dirname']);
}
return (bool)$_handle;
}
/* vim: set expandtab: */
?>
@@ -1,71 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Handle insert tags
*
* @param array $args
* @return string
*/
function smarty_core_run_insert_handler($params, &$smarty)
{
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
if ($smarty->debugging) {
$_params = array();
$_debug_start_time = smarty_core_get_microtime($_params, $smarty);
}
if ($smarty->caching) {
$_arg_string = serialize($params['args']);
$_name = $params['args']['name'];
if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
$smarty->_cache_info['insert_tags'][$_name] = array('insert',
$_name,
$smarty->_plugins['insert'][$_name][1],
$smarty->_plugins['insert'][$_name][2],
!empty($params['args']['script']) ? true : false);
}
return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
} else {
if (isset($params['args']['script'])) {
$_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
if(!smarty_core_get_php_resource($_params, $smarty)) {
return false;
}
if ($_params['resource_type'] == 'file') {
$smarty->_include($_params['php_resource'], true);
} else {
$smarty->_eval($_params['php_resource']);
}
unset($params['args']['script']);
}
$_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
$_content = $_funcname($params['args'], $smarty);
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$params['args']['name'],
'depth' => $smarty->_inclusion_depth,
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
}
if (!empty($params['args']["assign"])) {
$smarty->assign($params['args']["assign"], $_content);
} else {
return $_content;
}
}
}
/* vim: set expandtab: */
?>
@@ -1,50 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* called for included php files within templates
*
* @param string $smarty_file
* @param string $smarty_assign variable to assign the included template's
* output into
* @param boolean $smarty_once uses include_once if this is true
* @param array $smarty_include_vars associative array of vars from
* {include file="blah" var=$var}
*/
// $file, $assign, $once, $_smarty_include_vars
function smarty_core_smarty_include_php($params, &$smarty)
{
$_params = array('resource_name' => $params['smarty_file']);
require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
smarty_core_get_php_resource($_params, $smarty);
$_smarty_resource_type = $_params['resource_type'];
$_smarty_php_resource = $_params['php_resource'];
if (!empty($params['smarty_assign'])) {
ob_start();
if ($_smarty_resource_type == 'file') {
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
} else {
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
}
$smarty->assign($params['smarty_assign'], ob_get_contents());
ob_end_clean();
} else {
if ($_smarty_resource_type == 'file') {
$smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
} else {
$smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
}
}
}
/* vim: set expandtab: */
?>
@@ -1,96 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Prepend the cache information to the cache file
* and write it
*
* @param string $tpl_file
* @param string $cache_id
* @param string $compile_id
* @param string $results
* @return true|null
*/
// $tpl_file, $cache_id, $compile_id, $results
function smarty_core_write_cache_file($params, &$smarty)
{
// put timestamp in cache header
$smarty->_cache_info['timestamp'] = time();
if ($smarty->cache_lifetime > -1){
// expiration set
$smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
} else {
// cache will never expire
$smarty->_cache_info['expires'] = -1;
}
// collapse nocache.../nocache-tags
if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
// remove everything between every pair of outermost noache.../nocache-tags
// and replace it by a single nocache-tag
// this new nocache-tag will be replaced by dynamic contents in
// smarty_core_process_compiled_includes() on a cache-read
$match_count = count($match[0]);
$results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
$level = 0;
$j = 0;
for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
if ($results[$i] == $match[0][$j]) {
// nocache tag
if ($match[1][$j]) { // closing tag
$level--;
unset($results[$i]);
} else { // opening tag
if ($level++ > 0) unset($results[$i]);
}
$j++;
} elseif ($level > 0) {
unset($results[$i]);
}
}
$params['results'] = implode('', $results);
}
$smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
// prepend the cache header info into cache file
$_cache_info = serialize($smarty->_cache_info);
$params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
if (!empty($smarty->cache_handler_func)) {
// use cache_handler function
call_user_func_array($smarty->cache_handler_func,
array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires']));
} else {
// use local cache file
if(!@is_writable($smarty->cache_dir)) {
// cache_dir not writable, see if it exists
if(!@is_dir($smarty->cache_dir)) {
$smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
return false;
}
$smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
return false;
}
$_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
$_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
$_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty);
return true;
}
}
/* vim: set expandtab: */
?>
@@ -1,91 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Extract non-cacheable parts out of compiled template and write it
*
* @param string $compile_path
* @param string $template_compiled
* @return boolean
*/
function smarty_core_write_compiled_include($params, &$smarty)
{
$_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; endif;';
$_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\)\: echo \'\{/nocache\:(\\2)#(\\3)\}\'; endif;';
preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
$params['compiled_content'], $_match_source, PREG_SET_ORDER);
// no nocache-parts found: done
if (count($_match_source)==0) return;
// convert the matched php-code to functions
$_include_compiled = "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
$_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
$_compile_path = $params['include_file_path'];
$smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
$_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
$_include_compiled .= $params['plugins_code'];
$_include_compiled .= "<?php";
$this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
$_match =& $_match_source[$_i];
$source = $_match[4];
if ($this_varname == '_smarty') {
/* rename $this to $_smarty in the sourcecode */
$tokens = token_get_all('<?php ' . $_match[4]);
/* remove trailing <?php */
$open_tag = '';
while ($tokens) {
$token = array_shift($tokens);
if (is_array($token)) {
$open_tag .= $token[1];
} else {
$open_tag .= $token;
}
if ($open_tag == '<?php ') break;
}
for ($i=0, $count = count($tokens); $i < $count; $i++) {
if (is_array($tokens[$i])) {
if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
$tokens[$i] = '$' . $this_varname;
} else {
$tokens[$i] = $tokens[$i][1];
}
}
}
$source = implode('', $tokens);
}
/* add function to compiled include */
$_include_compiled .= "
function _smarty_tplfunc_$_match[2]_$_match[3](&\$$this_varname)
{
$source
}
";
}
$_include_compiled .= "\n\n?>\n";
$_params = array('filename' => $_compile_path,
'contents' => $_include_compiled, 'create_dirs' => true);
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty);
return true;
}
?>
@@ -1,35 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* write the compiled resource
*
* @param string $compile_path
* @param string $compiled_content
* @return true
*/
function smarty_core_write_compiled_resource($params, &$smarty)
{
if(!@is_writable($smarty->compile_dir)) {
// compile_dir not writable, see if it exists
if(!@is_dir($smarty->compile_dir)) {
$smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
return false;
}
$smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
return false;
}
$_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty);
return true;
}
/* vim: set expandtab: */
?>
@@ -1,54 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* write out a file to disk
*
* @param string $filename
* @param string $contents
* @param boolean $create_dirs
* @return boolean
*/
function smarty_core_write_file($params, &$smarty)
{
$_dirname = dirname($params['filename']);
if ($params['create_dirs']) {
$_params = array('dir' => $_dirname);
require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
smarty_core_create_dir_structure($_params, $smarty);
}
// write to tmp file, then rename it to avoid file locking race condition
$_tmp_file = tempnam($_dirname, 'wrt');
if (!($fd = @fopen($_tmp_file, 'wb'))) {
$_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
if (!($fd = @fopen($_tmp_file, 'wb'))) {
$smarty->trigger_error("problem writing temporary file '$_tmp_file'");
return false;
}
}
fwrite($fd, $params['contents']);
fclose($fd);
if (DIRECTORY_SEPARATOR == '\\' || !@rename($_tmp_file, $params['filename'])) {
// On platforms and filesystems that cannot overwrite with rename()
// delete the file before renaming it -- because windows always suffers
// this, it is short-circuited to avoid the initial rename() attempt
@unlink($params['filename']);
@rename($_tmp_file, $params['filename']);
}
@chmod($params['filename'], $smarty->_file_perms);
return true;
}
/* vim: set expandtab: */
?>
@@ -1,8 +1,9 @@
<?php
/**
* Smarty plugin
* Smarty plugin to format text blocks
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsBlock
*/
/**
@@ -12,23 +13,26 @@
* Name: textformat<br>
* Purpose: format text a certain way with preset styles
* or custom wrap/indent settings<br>
* @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
* (Smarty online manual)
* @param array
* Params:
* <pre>
* Params: style: string (email)
* indent: integer (0)
* wrap: integer (80)
* wrap_char string ("\n")
* indent_char: string (" ")
* wrap_boundary: boolean (true)
* - style - string (email)
* - indent - integer (0)
* - wrap - integer (80)
* - wrap_char - string ("\n")
* - indent_char - string (" ")
* - wrap_boundary - boolean (true)
* </pre>
*
* @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat}
* (Smarty online manual)
* @param array $params parameters
* @param string $content contents of the block
* @param Smarty_Internal_Template $template template object
* @param boolean &$repeat repeat flag
* @return string content re-formatted
* @author Monte Ohrt <monte at ohrt dot com>
* @param string contents of the block
* @param Smarty clever simulation of a method
* @return string string $content re-formatted
*/
function smarty_block_textformat($params, $content, &$smarty)
function smarty_block_textformat($params, $content, $template, &$repeat)
{
if (is_null($content)) {
return;
@@ -42,7 +46,7 @@ function smarty_block_textformat($params, $content, &$smarty)
$wrap_char = "\n";
$wrap_cut = false;
$assign = null;
foreach ($params as $_key => $_val) {
switch ($_key) {
case 'style':
@@ -63,41 +67,47 @@ function smarty_block_textformat($params, $content, &$smarty)
break;
default:
$smarty->trigger_error("textformat: unknown attribute '$_key'");
trigger_error("textformat: unknown attribute '$_key'");
}
}
if ($style == 'email') {
$wrap = 72;
}
// split into paragraphs
$_paragraphs = preg_split('![\r\n][\r\n]!',$content);
$_paragraphs = preg_split('![\r\n]{2}!', $content);
$_output = '';
for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
if ($_paragraphs[$_x] == '') {
foreach ($_paragraphs as &$_paragraph) {
if (!$_paragraph) {
continue;
}
// convert mult. spaces & special chars to single space
$_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
$_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph);
// indent first line
if($indent_first > 0) {
$_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
if ($indent_first > 0) {
$_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph;
}
// wordwrap sentences
$_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php');
$_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
} else {
$_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
}
// indent lines
if($indent > 0) {
$_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
if ($indent > 0) {
$_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph);
}
}
$_output = implode($wrap_char . $wrap_char, $_paragraphs);
return $assign ? $smarty->assign($assign, $_output) : $_output;
if ($assign) {
$template->assign($assign, $_output);
} else {
return $_output;
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,40 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {assign} compiler function plugin
*
* Type: compiler function<br>
* Name: assign<br>
* Purpose: assign a value to a template variable
* @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com> (initial author)
* @author messju mohr <messju at lammfellpuschen dot de> (conversion to compiler function)
* @param string containing var-attribute and value-attribute
* @param Smarty_Compiler
*/
function smarty_compiler_assign($tag_attrs, &$compiler)
{
$_params = $compiler->_parse_attrs($tag_attrs);
if (!isset($_params['var'])) {
$compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
return;
}
if (!isset($_params['value'])) {
$compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
return;
}
return "\$this->assign({$_params['var']}, {$_params['value']});";
}
/* vim: set expandtab: */
?>
@@ -1,40 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {assign_debug_info} function plugin
*
* Type: function<br>
* Name: assign_debug_info<br>
* Purpose: assign debug info to the template<br>
* @author Monte Ohrt <monte at ohrt dot com>
* @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
* {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
* @param Smarty
*/
function smarty_function_assign_debug_info($params, &$smarty)
{
$assigned_vars = $smarty->_tpl_vars;
ksort($assigned_vars);
if (@is_array($smarty->_config[0])) {
$config_vars = $smarty->_config[0];
ksort($config_vars);
$smarty->assign("_debug_config_keys", array_keys($config_vars));
$smarty->assign("_debug_config_vals", array_values($config_vars));
}
$included_templates = $smarty->_smarty_debug_info;
$smarty->assign("_debug_keys", array_keys($assigned_vars));
$smarty->assign("_debug_vals", array_values($assigned_vars));
$smarty->assign("_debug_tpls", $included_templates);
}
/* vim: set expandtab: */
?>
@@ -1,142 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {config_load} function plugin
*
* Type: function<br>
* Name: config_load<br>
* Purpose: load config file vars
* @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author messju mohr <messju at lammfellpuschen dot de> (added use of resources)
* @param array Format:
* <pre>
* array('file' => required config file name,
* 'section' => optional config file section to load
* 'scope' => local/parent/global
* 'global' => overrides scope, setting to parent if true)
* </pre>
* @param Smarty
*/
function smarty_function_config_load($params, &$smarty)
{
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$_debug_start_time = smarty_core_get_microtime($_params, $smarty);
}
$_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null;
$_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null;
$_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global';
$_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
if (!isset($_file) || strlen($_file) == 0) {
$smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
}
if (isset($_scope)) {
if ($_scope != 'local' &&
$_scope != 'parent' &&
$_scope != 'global') {
$smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
}
} else {
if ($_global) {
$_scope = 'parent';
} else {
$_scope = 'local';
}
}
$_params = array('resource_name' => $_file,
'resource_base_path' => $smarty->config_dir,
'get_source' => false);
$smarty->_parse_resource_name($_params);
$_file_path = $_params['resource_type'] . ':' . $_params['resource_name'];
if (isset($_section))
$_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
else
$_compile_file = $smarty->_get_compile_path($_file_path);
if($smarty->force_compile || !file_exists($_compile_file)) {
$_compile = true;
} elseif ($smarty->compile_check) {
$_params = array('resource_name' => $_file,
'resource_base_path' => $smarty->config_dir,
'get_source' => false);
$_compile = $smarty->_fetch_resource_info($_params) &&
$_params['resource_timestamp'] > filemtime($_compile_file);
} else {
$_compile = false;
}
if($_compile) {
// compile config file
if(!is_object($smarty->_conf_obj)) {
require_once SMARTY_DIR . $smarty->config_class . '.class.php';
$smarty->_conf_obj = new $smarty->config_class();
$smarty->_conf_obj->overwrite = $smarty->config_overwrite;
$smarty->_conf_obj->booleanize = $smarty->config_booleanize;
$smarty->_conf_obj->read_hidden = $smarty->config_read_hidden;
$smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines;
}
$_params = array('resource_name' => $_file,
'resource_base_path' => $smarty->config_dir,
$_params['get_source'] = true);
if (!$smarty->_fetch_resource_info($_params)) {
return;
}
$smarty->_conf_obj->set_file_contents($_file, $_params['source_content']);
$_config_vars = array_merge($smarty->_conf_obj->get($_file),
$smarty->_conf_obj->get($_file, $_section));
if(function_exists('var_export')) {
$_output = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; ?>';
} else {
$_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
}
$_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $smarty);
} else {
include($_compile_file);
}
if ($smarty->caching) {
$smarty->_cache_info['config'][$_file] = true;
}
$smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
$smarty->_config[0]['files'][$_file] = true;
if ($_scope == 'parent') {
$smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
$smarty->_config[1]['files'][$_file] = true;
} else if ($_scope == 'global') {
for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
$smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
$smarty->_config[$i]['files'][$_file] = true;
}
}
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'config',
'filename' => $_file.' ['.$_section.'] '.$_scope,
'depth' => $smarty->_inclusion_depth,
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
}
}
/* vim: set expandtab: */
?>
@@ -2,24 +2,24 @@
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {counter} function plugin
*
* Type: function<br>
* Name: counter<br>
* Purpose: print out a counter value
*
* @author Monte Ohrt <monte at ohrt dot com>
* @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
* @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
* (Smarty online manual)
* @param array parameters
* @param Smarty
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string|null
*/
function smarty_function_counter($params, &$smarty)
function smarty_function_counter($params, $template)
{
static $counters = array();
@@ -43,7 +43,7 @@ function smarty_function_counter($params, &$smarty)
}
if (isset($counter['assign'])) {
$smarty->assign($counter['assign'], $counter['count']);
$template->assign($counter['assign'], $counter['count']);
}
if (isset($params['print'])) {
@@ -75,6 +75,4 @@ function smarty_function_counter($params, &$smarty)
}
/* vim: set expandtab: */
?>
?>
@@ -1,8 +1,9 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
@@ -12,47 +13,48 @@
* Name: cycle<br>
* Date: May 3, 2002<br>
* Purpose: cycle through given values<br>
* Input:
* - name = name of cycle (optional)
* - values = comma separated list of values to cycle,
* or an array of values to cycle
* (this can be left out for subsequent calls)
* - reset = boolean - resets given var to true
* - print = boolean - print var or not. default is true
* - advance = boolean - whether or not to advance the cycle
* - delimiter = the value delimiter, default is ","
* - assign = boolean, assigns to template var instead of
* printed.
*
* Params:
* <pre>
* - name - name of cycle (optional)
* - values - comma separated list of values to cycle, or an array of values to cycle
* (this can be left out for subsequent calls)
* - reset - boolean - resets given var to true
* - print - boolean - print var or not. default is true
* - advance - boolean - whether or not to advance the cycle
* - delimiter - the value delimiter, default is ","
* - assign - boolean, assigns to template var instead of printed.
* </pre>
* Examples:<br>
* <pre>
* {cycle values="#eeeeee,#d0d0d0d"}
* {cycle name=row values="one,two,three" reset=true}
* {cycle name=row}
* </pre>
* @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
*
* @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author credit to Mark Priatel <mpriatel@rogers.com>
* @author credit to Gerard <gerard@interfold.com>
* @author credit to Jason Sweat <jsweat_php@yahoo.com>
* @version 1.3
* @param array
* @param Smarty
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string|null
*/
function smarty_function_cycle($params, &$smarty)
function smarty_function_cycle($params, $template)
{
static $cycle_vars;
$name = (empty($params['name'])) ? 'default' : $params['name'];
$print = (isset($params['print'])) ? (bool)$params['print'] : true;
$advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
$reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
if (!in_array('values', array_keys($params))) {
if (!isset($params['values'])) {
if(!isset($cycle_vars[$name]['values'])) {
$smarty->trigger_error("cycle: missing 'values' parameter");
trigger_error("cycle: missing 'values' parameter");
return;
}
} else {
@@ -63,23 +65,27 @@ function smarty_function_cycle($params, &$smarty)
$cycle_vars[$name]['values'] = $params['values'];
}
$cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
if (isset($params['delimiter'])) {
$cycle_vars[$name]['delimiter'] = $params['delimiter'];
} elseif (!isset($cycle_vars[$name]['delimiter'])) {
$cycle_vars[$name]['delimiter'] = ',';
}
if(is_array($cycle_vars[$name]['values'])) {
$cycle_array = $cycle_vars[$name]['values'];
} else {
$cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
}
if(!isset($cycle_vars[$name]['index']) || $reset ) {
$cycle_vars[$name]['index'] = 0;
}
if (isset($params['assign'])) {
$print = false;
$smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
$template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
}
if($print) {
$retval = $cycle_array[$cycle_vars[$name]['index']];
} else {
@@ -93,10 +99,8 @@ function smarty_function_cycle($params, &$smarty)
$cycle_vars[$name]['index']++;
}
}
return $retval;
}
/* vim: set expandtab: */
?>
?>
@@ -1,35 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {debug} function plugin
*
* Type: function<br>
* Name: debug<br>
* Date: July 1, 2002<br>
* Purpose: popup debug window
* @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param array
* @param Smarty
* @return string output from {@link Smarty::_generate_debug_output()}
*/
function smarty_function_debug($params, &$smarty)
{
if (isset($params['output'])) {
$smarty->assign('_smarty_debug_output', $params['output']);
}
require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
return smarty_core_display_debug_console(null, $smarty);
}
/* vim: set expandtab: */
?>
@@ -1,49 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {eval} function plugin
*
* Type: function<br>
* Name: eval<br>
* Purpose: evaluate a template variable as a template<br>
* @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
*/
function smarty_function_eval($params, &$smarty)
{
if (!isset($params['var'])) {
$smarty->trigger_error("eval: missing 'var' parameter");
return;
}
if($params['var'] == '') {
return;
}
$smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
ob_start();
$smarty->_eval('?>' . $_var_compiled);
$_contents = ob_get_contents();
ob_end_clean();
if (!empty($params['assign'])) {
$smarty->assign($params['assign'], $_contents);
} else {
return $_contents;
}
}
/* vim: set expandtab: */
?>
@@ -1,221 +1,214 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {fetch} plugin
*
* Type: function<br>
* Name: fetch<br>
* Purpose: fetch file, web or ftp data and display results
* @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
*
* @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string|null if the assign parameter is passed, Smarty assigns the
* result to a template variable
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable
*/
function smarty_function_fetch($params, &$smarty)
function smarty_function_fetch($params, $template)
{
if (empty($params['file'])) {
$smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty");
trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE);
return;
}
// strip file protocol
if (stripos($params['file'], 'file://') === 0) {
$params['file'] = substr($params['file'], 7);
}
$protocol = strpos($params['file'], '://');
if ($protocol !== false) {
$protocol = strtolower(substr($params['file'], 0, $protocol));
}
if (isset($template->smarty->security_policy)) {
if ($protocol) {
// remote resource (or php stream, …)
if(!$template->smarty->security_policy->isTrustedUri($params['file'])) {
return;
}
} else {
// local file
if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) {
return;
}
}
}
$content = '';
if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
$_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
if(!smarty_core_is_secure($_params, $smarty)) {
$smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
return;
}
// fetch the file
if($fp = @fopen($params['file'],'r')) {
while(!feof($fp)) {
$content .= fgets ($fp,4096);
if ($protocol == 'http') {
// http fetch
if($uri_parts = parse_url($params['file'])) {
// set defaults
$host = $server_name = $uri_parts['host'];
$timeout = 30;
$accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
$agent = "Smarty Template Engine ". Smarty::SMARTY_VERSION;
$referer = "";
$uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
$uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
$_is_proxy = false;
if(empty($uri_parts['port'])) {
$port = 80;
} else {
$port = $uri_parts['port'];
}
if(!empty($uri_parts['user'])) {
$user = $uri_parts['user'];
}
if(!empty($uri_parts['pass'])) {
$pass = $uri_parts['pass'];
}
// loop through parameters, setup headers
foreach($params as $param_key => $param_value) {
switch($param_key) {
case "file":
case "assign":
case "assign_headers":
break;
case "user":
if(!empty($param_value)) {
$user = $param_value;
}
break;
case "pass":
if(!empty($param_value)) {
$pass = $param_value;
}
break;
case "accept":
if(!empty($param_value)) {
$accept = $param_value;
}
break;
case "header":
if(!empty($param_value)) {
if(!preg_match('![\w\d-]+: .+!',$param_value)) {
trigger_error("[plugin] invalid header format '".$param_value."'",E_USER_NOTICE);
return;
} else {
$extra_headers[] = $param_value;
}
}
break;
case "proxy_host":
if(!empty($param_value)) {
$proxy_host = $param_value;
}
break;
case "proxy_port":
if(!preg_match('!\D!', $param_value)) {
$proxy_port = (int) $param_value;
} else {
trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE);
return;
}
break;
case "agent":
if(!empty($param_value)) {
$agent = $param_value;
}
break;
case "referer":
if(!empty($param_value)) {
$referer = $param_value;
}
break;
case "timeout":
if(!preg_match('!\D!', $param_value)) {
$timeout = (int) $param_value;
} else {
trigger_error("[plugin] invalid value for attribute '".$param_key."'",E_USER_NOTICE);
return;
}
break;
default:
trigger_error("[plugin] unrecognized attribute '".$param_key."'",E_USER_NOTICE);
return;
}
}
if(!empty($proxy_host) && !empty($proxy_port)) {
$_is_proxy = true;
$fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
} else {
$fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
}
if(!$fp) {
trigger_error("[plugin] unable to fetch: $errstr ($errno)",E_USER_NOTICE);
return;
} else {
if($_is_proxy) {
fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
} else {
fputs($fp, "GET $uri HTTP/1.0\r\n");
}
if(!empty($host)) {
fputs($fp, "Host: $host\r\n");
}
if(!empty($accept)) {
fputs($fp, "Accept: $accept\r\n");
}
if(!empty($agent)) {
fputs($fp, "User-Agent: $agent\r\n");
}
if(!empty($referer)) {
fputs($fp, "Referer: $referer\r\n");
}
if(isset($extra_headers) && is_array($extra_headers)) {
foreach($extra_headers as $curr_header) {
fputs($fp, $curr_header."\r\n");
}
}
if(!empty($user) && !empty($pass)) {
fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
}
fputs($fp, "\r\n");
while(!feof($fp)) {
$content .= fgets($fp,4096);
}
fclose($fp);
$csplit = preg_split("!\r\n\r\n!",$content,2);
$content = $csplit[1];
if(!empty($params['assign_headers'])) {
$template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0]));
}
}
fclose($fp);
} else {
$smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
trigger_error("[plugin fetch] unable to parse URL, check syntax",E_USER_NOTICE);
return;
}
} else {
// not a local file
if(preg_match('!^http://!i',$params['file'])) {
// http fetch
if($uri_parts = parse_url($params['file'])) {
// set defaults
$host = $server_name = $uri_parts['host'];
$timeout = 30;
$accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
$agent = "Smarty Template Engine ".$smarty->_version;
$referer = "";
$uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
$uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
$_is_proxy = false;
if(empty($uri_parts['port'])) {
$port = 80;
} else {
$port = $uri_parts['port'];
}
if(!empty($uri_parts['user'])) {
$user = $uri_parts['user'];
}
if(!empty($uri_parts['pass'])) {
$pass = $uri_parts['pass'];
}
// loop through parameters, setup headers
foreach($params as $param_key => $param_value) {
switch($param_key) {
case "file":
case "assign":
case "assign_headers":
break;
case "user":
if(!empty($param_value)) {
$user = $param_value;
}
break;
case "pass":
if(!empty($param_value)) {
$pass = $param_value;
}
break;
case "accept":
if(!empty($param_value)) {
$accept = $param_value;
}
break;
case "header":
if(!empty($param_value)) {
if(!preg_match('![\w\d-]+: .+!',$param_value)) {
$smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'");
return;
} else {
$extra_headers[] = $param_value;
}
}
break;
case "proxy_host":
if(!empty($param_value)) {
$proxy_host = $param_value;
}
break;
case "proxy_port":
if(!preg_match('!\D!', $param_value)) {
$proxy_port = (int) $param_value;
} else {
$smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
return;
}
break;
case "agent":
if(!empty($param_value)) {
$agent = $param_value;
}
break;
case "referer":
if(!empty($param_value)) {
$referer = $param_value;
}
break;
case "timeout":
if(!preg_match('!\D!', $param_value)) {
$timeout = (int) $param_value;
} else {
$smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
return;
}
break;
default:
$smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'");
return;
}
}
if(!empty($proxy_host) && !empty($proxy_port)) {
$_is_proxy = true;
$fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
} else {
$fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
}
if(!$fp) {
$smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)");
return;
} else {
if($_is_proxy) {
fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
} else {
fputs($fp, "GET $uri HTTP/1.0\r\n");
}
if(!empty($host)) {
fputs($fp, "Host: $host\r\n");
}
if(!empty($accept)) {
fputs($fp, "Accept: $accept\r\n");
}
if(!empty($agent)) {
fputs($fp, "User-Agent: $agent\r\n");
}
if(!empty($referer)) {
fputs($fp, "Referer: $referer\r\n");
}
if(isset($extra_headers) && is_array($extra_headers)) {
foreach($extra_headers as $curr_header) {
fputs($fp, $curr_header."\r\n");
}
}
if(!empty($user) && !empty($pass)) {
fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
}
fputs($fp, "\r\n");
while(!feof($fp)) {
$content .= fgets($fp,4096);
}
fclose($fp);
$csplit = split("\r\n\r\n",$content,2);
$content = $csplit[1];
if(!empty($params['assign_headers'])) {
$smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
}
}
} else {
$smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax");
return;
}
} else {
// ftp fetch
if($fp = @fopen($params['file'],'r')) {
while(!feof($fp)) {
$content .= fgets ($fp,4096);
}
fclose($fp);
} else {
$smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
return;
}
$content = @file_get_contents($params['file']);
if ($content === false) {
throw new SmartyException("{fetch} cannot read resource '" . $params['file'] ."'");
}
}
if (!empty($params['assign'])) {
$smarty->assign($params['assign'],$content);
$template->assign($params['assign'], $content);
} else {
return $content;
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,11 +1,11 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {html_checkboxes} function plugin
*
@@ -14,40 +14,46 @@
* Name: html_checkboxes<br>
* Date: 24.Feb.2003<br>
* Purpose: Prints out a list of checkbox input types<br>
* Input:<br>
* - name (optional) - string default "checkbox"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each checkbox
* - assign (optional) - assign the output as an array to this variable
* Examples:
* <pre>
* {html_checkboxes values=$ids output=$names}
* {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
* {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
* </pre>
* @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
* Params:
* <pre>
* - name (optional) - string default "checkbox"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each checkbox
* - assign (optional) - assign the output as an array to this variable
* - escape (optional) - escape the content (not value), defaults to true
* </pre>
*
* @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
* (Smarty online manual)
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param array
* @param Smarty
* @param array $params parameters
* @param object $template template object
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_checkboxes($params, &$smarty)
function smarty_function_html_checkboxes($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$name = 'checkbox';
$values = null;
$options = null;
$selected = null;
$selected = array();
$separator = '';
$escape = true;
$labels = true;
$label_ids = false;
$output = null;
$extra = '';
@@ -56,40 +62,82 @@ function smarty_function_html_checkboxes($params, &$smarty)
switch($_key) {
case 'name':
case 'separator':
$$_key = $_val;
$$_key = (string) $_val;
break;
case 'escape':
case 'labels':
$$_key = (bool)$_val;
case 'label_ids':
$$_key = (bool) $_val;
break;
case 'options':
$$_key = (array)$_val;
$$_key = (array) $_val;
break;
case 'values':
case 'output':
$$_key = array_values((array)$_val);
$$_key = array_values((array) $_val);
break;
case 'checked':
case 'selected':
$selected = array_map('strval', array_values((array)$_val));
if (is_array($_val)) {
$selected = array();
foreach ($_val as $_sel) {
if (is_object($_sel)) {
if (method_exists($_sel, "__toString")) {
$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
} else {
trigger_error("html_checkboxes: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE);
continue;
}
} else {
$_sel = smarty_function_escape_special_chars((string) $_sel);
}
$selected[$_sel] = true;
}
} elseif (is_object($_val)) {
if (method_exists($_val, "__toString")) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
trigger_error("html_checkboxes: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
}
} else {
$selected = smarty_function_escape_special_chars((string) $_val);
}
break;
case 'checkboxes':
$smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
$options = (array)$_val;
trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
$options = (array) $_val;
break;
case 'assign':
break;
case 'strict': break;
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
@@ -98,46 +146,88 @@ function smarty_function_html_checkboxes($params, &$smarty)
if (!isset($options) && !isset($values))
return ''; /* raise error here? */
settype($selected, 'array');
$_html_result = array();
if (isset($options)) {
foreach ($options as $_key=>$_val)
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
foreach ($options as $_key=>$_val) {
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
}
} else {
foreach ($values as $_i=>$_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
$_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
}
}
if(!empty($params['assign'])) {
$smarty->assign($params['assign'], $_html_result);
$template->assign($params['assign'], $_html_result);
} else {
return implode("\n",$_html_result);
return implode("\n", $_html_result);
}
}
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape=true) {
$_output = '';
if ($labels) $_output .= '<label>';
$_output .= '<input type="checkbox" name="'
. smarty_function_escape_special_chars($name) . '[]" value="'
. smarty_function_escape_special_chars($value) . '"';
if (in_array((string)$value, $selected)) {
if (is_object($value)) {
if (method_exists($value, "__toString")) {
$value = (string) $value->__toString();
} else {
trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
return '';
}
} else {
$value = (string) $value;
}
if (is_object($output)) {
if (method_exists($output, "__toString")) {
$output = (string) $output->__toString();
} else {
trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE);
return '';
}
} else {
$output = (string) $output;
}
if ($labels) {
if ($label_ids) {
$_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value));
$_output .= '<label for="' . $_id . '">';
} else {
$_output .= '<label>';
}
}
$name = smarty_function_escape_special_chars($name);
$value = smarty_function_escape_special_chars($value);
if ($escape) {
$output = smarty_function_escape_special_chars($output);
}
$_output .= '<input type="checkbox" name="' . $name . '[]" value="' . $value . '"';
if ($labels && $label_ids) {
$_output .= ' id="' . $_id . '"';
}
if (is_array($selected)) {
if (isset($selected[$value])) {
$_output .= ' checked="checked"';
}
} elseif ($value === $selected) {
$_output .= ' checked="checked"';
}
$_output .= $extra . ' />' . $output;
if ($labels) $_output .= '</label>';
if ($labels) {
$_output .= '</label>';
}
$_output .= $separator;
return $_output;
}
?>
?>
@@ -1,43 +1,43 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {html_image} function plugin
*
*
* Type: function<br>
* Name: html_image<br>
* Date: Feb 24, 2003<br>
* Purpose: format HTML tags for the image<br>
* Input:<br>
* - file = file (and path) of image (required)
* - height = image height (optional, default actual height)
* - width = image width (optional, default actual width)
* - basedir = base directory for absolute paths, default
* is environment variable DOCUMENT_ROOT
* - path_prefix = prefix for path output (optional, default empty)
*
* Examples: {html_image file="/images/masthead.gif"}
* Output: <img src="/images/masthead.gif" width=400 height=23>
* @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
* Examples: {html_image file="/images/masthead.gif"}<br>
* Output: <img src="/images/masthead.gif" width=400 height=23><br>
* Params:
* <pre>
* - file - (required) - file (and path) of image
* - height - (optional) - image height (default actual height)
* - width - (optional) - image width (default actual width)
* - basedir - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
* - path_prefix - prefix for path output (optional, default empty)
* </pre>
*
* @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Duda <duda@big.hu> - wrote first image function
* in repository, helped with lots of functionality
* @version 1.0
* @param array
* @param Smarty
* @return string
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Duda <duda@big.hu>
* @version 1.0
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_image($params, &$smarty)
function smarty_function_html_image($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$alt = '';
$file = '';
$height = '';
@@ -46,10 +46,9 @@ function smarty_function_html_image($params, &$smarty)
$prefix = '';
$suffix = '';
$path_prefix = '';
$server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
$basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
$basedir = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '';
foreach($params as $_key => $_val) {
switch($_key) {
switch ($_key) {
case 'file':
case 'height':
case 'width':
@@ -60,11 +59,11 @@ function smarty_function_html_image($params, &$smarty)
break;
case 'alt':
if(!is_array($_val)) {
if (!is_array($_val)) {
$$_key = smarty_function_escape_special_chars($_val);
} else {
$smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
case 'link':
@@ -74,69 +73,87 @@ function smarty_function_html_image($params, &$smarty)
break;
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
$smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
}
}
if (empty($file)) {
$smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
return;
}
}
if (substr($file,0,1) == '/') {
if ($file[0] == '/') {
$_image_path = $basedir . $file;
} else {
$_image_path = $file;
}
if(!isset($params['width']) || !isset($params['height'])) {
if(!$_image_data = @getimagesize($_image_path)) {
if(!file_exists($_image_path)) {
$smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
// strip file protocol
if (stripos($params['file'], 'file://') === 0) {
$params['file'] = substr($params['file'], 7);
}
$protocol = strpos($params['file'], '://');
if ($protocol !== false) {
$protocol = strtolower(substr($params['file'], 0, $protocol));
}
if (isset($template->smarty->security_policy)) {
if ($protocol) {
// remote resource (or php stream, …)
if(!$template->smarty->security_policy->isTrustedUri($params['file'])) {
return;
} else if(!is_readable($_image_path)) {
$smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
return;
} else {
$smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
}
} else {
// local file
if(!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) {
return;
}
}
if ($smarty->security &&
($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
(require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
(!smarty_core_is_secure($_params, $smarty)) ) {
$smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
}
if(!isset($params['width'])) {
$width = $_image_data[0];
}
if(!isset($params['height'])) {
$height = $_image_data[1];
}
}
if(isset($params['dpi'])) {
if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
if (!isset($params['width']) || !isset($params['height'])) {
// FIXME: (rodneyrehm) getimagesize() loads the complete file off a remote resource, use custom [jpg,png,gif]header reader!
if (!$_image_data = @getimagesize($_image_path)) {
if (!file_exists($_image_path)) {
trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
return;
} else if (!is_readable($_image_path)) {
trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
return;
} else {
trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
return;
}
}
if (!isset($params['width'])) {
$width = $_image_data[0];
}
if (!isset($params['height'])) {
$height = $_image_data[1];
}
}
if (isset($params['dpi'])) {
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Mac')) {
// FIXME: (rodneyrehm) wrong dpi assumption
// don't know who thought this up… even if it was true in 1998, it's definitely wrong in 2011.
$dpi_default = 72;
} else {
$dpi_default = 96;
}
$_resize = $dpi_default/$params['dpi'];
}
$_resize = $dpi_default / $params['dpi'];
$width = round($width * $_resize);
$height = round($height * $_resize);
}
}
return $prefix . '<img src="'.$path_prefix.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
}
return $prefix . '<img src="' . $path_prefix . $file . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $extra . ' />' . $suffix;
}
/* vim: set expandtab: */
?>
?>
@@ -1,122 +1,193 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {html_options} function plugin
*
*
* Type: function<br>
* Name: html_options<br>
* Input:<br>
* - name (optional) - string default "select"
* - values (required if no options supplied) - array
* - options (required if no values supplied) - associative array
* - selected (optional) - string default not set
* - output (required if not options supplied) - array
* Purpose: Prints the list of <option> tags generated from
* the passed parameters
* @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
* the passed parameters<br>
* Params:
* <pre>
* - name (optional) - string default "select"
* - values (required) - if no options supplied) - array
* - options (required) - if no values supplied) - associative array
* - selected (optional) - string default not set
* - output (required) - if not options supplied) - array
* - id (optional) - string default not set
* - class (optional) - string default not set
* </pre>
*
* @link http://www.smarty.net/manual/en/language.function.html.options.php {html_image}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string
* @author Monte Ohrt <monte at ohrt dot com>
* @author Ralf Strehle (minor optimization) <ralf dot strehle at yahoo dot de>
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_options($params, &$smarty)
function smarty_function_html_options($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$name = null;
$values = null;
$options = null;
$selected = array();
$selected = null;
$output = null;
$id = null;
$class = null;
$extra = '';
foreach($params as $_key => $_val) {
switch($_key) {
foreach ($params as $_key => $_val) {
switch ($_key) {
case 'name':
$$_key = (string)$_val;
case 'class':
case 'id':
$$_key = (string) $_val;
break;
case 'options':
$$_key = (array)$_val;
$options = (array) $_val;
break;
case 'values':
case 'output':
$$_key = array_values((array)$_val);
$$_key = array_values((array) $_val);
break;
case 'selected':
$$_key = array_map('strval', array_values((array)$_val));
break;
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
if (is_array($_val)) {
$selected = array();
foreach ($_val as $_sel) {
if (is_object($_sel)) {
if (method_exists($_sel, "__toString")) {
$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
} else {
trigger_error("html_options: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE);
continue;
}
} else {
$_sel = smarty_function_escape_special_chars((string) $_sel);
}
$selected[$_sel] = true;
}
} elseif (is_object($_val)) {
if (method_exists($_val, "__toString")) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
trigger_error("html_options: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
}
} else {
$smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
$selected = smarty_function_escape_special_chars((string) $_val);
}
break;
}
case 'strict': break;
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
if (!isset($options) && !isset($values))
return ''; /* raise error here? */
if (!isset($options) && !isset($values)) {
/* raise error here? */
return '';
}
$_html_result = '';
$_idx = 0;
if (isset($options)) {
foreach ($options as $_key=>$_val)
$_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
} else {
foreach ($values as $_i=>$_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
foreach ($options as $_key => $_val) {
$_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
}
}
if(!empty($name)) {
$_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
}
return $_html_result;
}
function smarty_function_html_options_optoutput($key, $value, $selected) {
if(!is_array($value)) {
$_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
smarty_function_escape_special_chars($key) . '"';
if (in_array((string)$key, $selected))
$_html_result .= ' selected="selected"';
$_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
} else {
$_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
foreach ($values as $_i => $_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
}
}
if (!empty($name)) {
$_html_class = !empty($class) ? ' class="'.$class.'"' : '';
$_html_id = !empty($id) ? ' id="'.$id.'"' : '';
$_html_result = '<select name="' . $name . '"' . $_html_class . $_html_id . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
}
return $_html_result;
}
function smarty_function_html_options_optgroup($key, $values, $selected) {
function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
{
if (!is_array($value)) {
$_key = smarty_function_escape_special_chars($key);
$_html_result = '<option value="' . $_key . '"';
if (is_array($selected)) {
if (isset($selected[$_key])) {
$_html_result .= ' selected="selected"';
}
} elseif ($_key === $selected) {
$_html_result .= ' selected="selected"';
}
$_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
$_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : '';
if (is_object($value)) {
if (method_exists($value, "__toString")) {
$value = smarty_function_escape_special_chars((string) $value->__toString());
} else {
trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
return '';
}
} else {
$value = smarty_function_escape_special_chars((string) $value);
}
$_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n";
$idx++;
} else {
$_idx = 0;
$_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id.'-'.$idx) : null, $class, $_idx);
$idx++;
}
return $_html_result;
}
function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
{
$optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
foreach ($values as $key => $value) {
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
}
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx);
}
$optgroup_html .= "</optgroup>\n";
return $optgroup_html;
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,156 +1,217 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {html_radios} function plugin
*
*
* File: function.html_radios.php<br>
* Type: function<br>
* Name: html_radios<br>
* Date: 24.Feb.2003<br>
* Purpose: Prints out a list of radio input types<br>
* Input:<br>
* - name (optional) - string default "radio"
* - values (required) - array
* - options (optional) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each radio button
* - assign (optional) - assign the output as an array to this variable
* Params:
* <pre>
* - name (optional) - string default "radio"
* - values (required) - array
* - options (required) - associative array
* - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each radio button
* - assign (optional) - assign the output as an array to this variable
* - escape (optional) - escape the content (not value), defaults to true
* </pre>
* Examples:
* <pre>
* {html_radios values=$ids output=$names}
* {html_radios values=$ids name='box' separator='<br>' output=$names}
* {html_radios values=$ids checked=$checked separator='<br>' output=$names}
* </pre>
*
* @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
* (Smarty online manual)
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param array
* @param Smarty
* @return string
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_radios($params, &$smarty)
function smarty_function_html_radios($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$name = 'radio';
$values = null;
$options = null;
$selected = null;
$separator = '';
$escape = true;
$labels = true;
$label_ids = false;
$output = null;
$extra = '';
foreach($params as $_key => $_val) {
switch($_key) {
switch ($_key) {
case 'name':
case 'separator':
$$_key = (string)$_val;
$$_key = (string) $_val;
break;
case 'checked':
case 'selected':
if(is_array($_val)) {
$smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
if (is_array($_val)) {
trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
} elseif (is_object($_val)) {
if (method_exists($_val, "__toString")) {
$selected = smarty_function_escape_special_chars((string) $_val->__toString());
} else {
trigger_error("html_radios: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
}
} else {
$selected = (string)$_val;
}
$selected = (string) $_val;
}
break;
case 'escape':
case 'labels':
case 'label_ids':
$$_key = (bool)$_val;
$$_key = (bool) $_val;
break;
case 'options':
$$_key = (array)$_val;
$$_key = (array) $_val;
break;
case 'values':
case 'output':
$$_key = array_values((array)$_val);
$$_key = array_values((array) $_val);
break;
case 'radios':
$smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
$options = (array)$_val;
trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
$options = (array) $_val;
break;
case 'assign':
break;
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
case 'strict': break;
if (!isset($options) && !isset($values))
return ''; /* raise error here? */
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
if (!isset($options) && !isset($values)) {
/* raise error here? */
return '';
}
$_html_result = array();
if (isset($options)) {
foreach ($options as $_key=>$_val)
$_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
} else {
foreach ($values as $_i=>$_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
foreach ($options as $_key => $_val) {
$_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
}
}
if(!empty($params['assign'])) {
$smarty->assign($params['assign'], $_html_result);
} else {
return implode("\n",$_html_result);
foreach ($values as $_i => $_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
$_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape);
}
}
if (!empty($params['assign'])) {
$template->assign($params['assign'], $_html_result);
} else {
return implode("\n", $_html_result);
}
}
function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape)
{
$_output = '';
if (is_object($value)) {
if (method_exists($value, "__toString")) {
$value = (string) $value->__toString();
} else {
trigger_error("html_options: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
return '';
}
} else {
$value = (string) $value;
}
if (is_object($output)) {
if (method_exists($output, "__toString")) {
$output = (string) $output->__toString();
} else {
trigger_error("html_options: output is an object of class '". get_class($output) ."' without __toString() method", E_USER_NOTICE);
return '';
}
} else {
$output = (string) $output;
}
if ($labels) {
if ($label_ids) {
$_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value));
$_output .= '<label for="' . $_id . '">';
} else {
$_output .= '<label>';
}
}
$name = smarty_function_escape_special_chars($name);
$value = smarty_function_escape_special_chars($value);
if ($escape) {
$output = smarty_function_escape_special_chars($output);
}
$_output .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
if ($labels && $label_ids) {
$_output .= ' id="' . $_id . '"';
}
}
function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids) {
$_output = '';
if ($labels) {
if($label_ids) {
$_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value));
$_output .= '<label for="' . $_id . '">';
} else {
$_output .= '<label>';
}
}
$_output .= '<input type="radio" name="'
. smarty_function_escape_special_chars($name) . '" value="'
. smarty_function_escape_special_chars($value) . '"';
if ($labels && $label_ids) $_output .= ' id="' . $_id . '"';
if ((string)$value==$selected) {
if ($value === $selected) {
$_output .= ' checked="checked"';
}
$_output .= $extra . ' />' . $output;
if ($labels) $_output .= '</label>';
$_output .= $separator;
if ($labels) {
$_output .= '</label>';
}
$_output .= $separator;
return $_output;
}
}
?>
?>
@@ -1,99 +1,142 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
/**
* Smarty {html_select_date} plugin
*
*
* Type: function<br>
* Name: html_select_date<br>
* Purpose: Prints the dropdowns for date selection.
*
* ChangeLog:<br>
* - 1.0 initial release
* - 1.1 added support for +/- N syntax for begin
* and end year values. (Monte)
* - 1.2 added support for yyyy-mm-dd syntax for
* time value. (Jan Rosier)
* - 1.3 added support for choosing format for
* month values (Gary Loescher)
* - 1.3.1 added support for choosing format for
* day values (Marcus Bointon)
* - 1.3.2 support negative timestamps, force year
* dropdown to include given date unless explicitly set (Monte)
* - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
* of 0000-00-00 dates (cybot, boots)
* @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
*
* ChangeLog:
* <pre>
* - 1.0 initial release
* - 1.1 added support for +/- N syntax for begin
* and end year values. (Monte)
* - 1.2 added support for yyyy-mm-dd syntax for
* time value. (Jan Rosier)
* - 1.3 added support for choosing format for
* month values (Gary Loescher)
* - 1.3.1 added support for choosing format for
* day values (Marcus Bointon)
* - 1.3.2 support negative timestamps, force year
* dropdown to include given date unless explicitly set (Monte)
* - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
* of 0000-00-00 dates (cybot, boots)
* - 2.0 complete rewrite for performance,
* added attributes month_names, *_id
* </pre>
*
* @link http://www.smarty.net/manual/en/language.function.html.select.date.php {html_select_date}
* (Smarty online manual)
* @version 1.3.4
* @author Andrei Zmievski
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string
* @version 2.0
* @author Andrei Zmievski
* @author Monte Ohrt <monte at ohrt dot com>
* @author Rodney Rehm
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
*/
function smarty_function_html_select_date($params, &$smarty)
function smarty_function_html_select_date($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
require_once $smarty->_get_plugin_filepath('function','html_options');
// generate timestamps used for month names only
static $_month_timestamps = null;
static $_current_year = null;
if ($_month_timestamps === null) {
$_current_year = date('Y');
$_month_timestamps = array();
for ($i = 1; $i <= 12; $i++) {
$_month_timestamps[$i] = mktime(0, 0, 0, $i, 1, 2000);
}
}
/* Default values. */
$prefix = "Date_";
$start_year = strftime("%Y");
$end_year = $start_year;
$display_days = true;
$display_months = true;
$display_years = true;
$month_format = "%B";
$prefix = "Date_";
$start_year = null;
$end_year = null;
$display_days = true;
$display_months = true;
$display_years = true;
$month_format = "%B";
/* Write months as numbers by default GL */
$month_value_format = "%m";
$day_format = "%02d";
$day_format = "%02d";
/* Write day values using this format MB */
$day_value_format = "%d";
$year_as_text = false;
$year_as_text = false;
/* Display years in reverse order? Ie. 2000,1999,.... */
$reverse_years = false;
$reverse_years = false;
/* Should the select boxes be part of an array when returned from PHP?
e.g. setting it to "birthday", would create "birthday[Day]",
"birthday[Month]" & "birthday[Year]". Can be combined with prefix */
$field_array = null;
$field_array = null;
/* <select size>'s of the different <select> tags.
If not set, uses default dropdown. */
$day_size = null;
$month_size = null;
$year_size = null;
$day_size = null;
$month_size = null;
$year_size = null;
/* Unparsed attributes common to *ALL* the <select>/<input> tags.
An example might be in the template: all_extra ='class ="foo"'. */
$all_extra = null;
$all_extra = null;
/* Separate attributes for the tags. */
$day_extra = null;
$month_extra = null;
$year_extra = null;
$day_extra = null;
$month_extra = null;
$year_extra = null;
/* Order in which to display the fields.
"D" -> day, "M" -> month, "Y" -> year. */
$field_order = 'MDY';
$field_order = 'MDY';
/* String printed between the different fields. */
$field_separator = "\n";
$time = time();
$all_empty = null;
$day_empty = null;
$month_empty = null;
$year_empty = null;
$extra_attrs = '';
$option_separator = "\n";
$time = null;
// $all_empty = null;
// $day_empty = null;
// $month_empty = null;
// $year_empty = null;
$extra_attrs = '';
$all_id = null;
$day_id = null;
$month_id = null;
$year_id = null;
foreach ($params as $_key=>$_value) {
foreach ($params as $_key => $_value) {
switch ($_key) {
case 'prefix':
case 'time':
if (!is_array($_value) && $_value !== null) {
$time = smarty_make_timestamp($_value);
}
break;
case 'month_names':
if (is_array($_value) && count($_value) == 12) {
$$_key = $_value;
} else {
trigger_error("html_select_date: month_names must be an array of 12 strings", E_USER_NOTICE);
}
break;
case 'prefix':
case 'field_array':
case 'start_year':
case 'end_year':
case 'month_format':
case 'day_format':
case 'day_value_format':
case 'field_array':
case 'month_format':
case 'month_value_format':
case 'day_size':
case 'month_size':
case 'year_size':
@@ -103,18 +146,18 @@ function smarty_function_html_select_date($params, &$smarty)
case 'year_extra':
case 'field_order':
case 'field_separator':
case 'month_value_format':
case 'option_separator':
case 'all_empty':
case 'month_empty':
case 'day_empty':
case 'year_empty':
case 'all_id':
case 'month_id':
case 'day_id':
case 'year_id':
$$_key = (string)$_value;
break;
case 'all_empty':
$$_key = (string)$_value;
$day_empty = $month_empty = $year_empty = $all_empty;
break;
case 'display_days':
case 'display_months':
case 'display_years':
@@ -124,208 +167,228 @@ function smarty_function_html_select_date($params, &$smarty)
break;
default:
if(!is_array($_value)) {
$extra_attrs .= ' '.$_key.'="'.smarty_function_escape_special_chars($_value).'"';
if (!is_array($_value)) {
$extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
} else {
$smarty->trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
// Note: date() is faster than strftime()
// Note: explode(date()) is faster than date() date() date()
if (isset($params['time']) && is_array($params['time'])) {
if (isset($params['time'][$prefix . 'Year'])) {
// $_REQUEST[$field_array] given
foreach (array('Y' => 'Year', 'm' => 'Month', 'd' => 'Day') as $_elementKey => $_elementName) {
$_variableName = '_' . strtolower($_elementName);
$$_variableName = isset($params['time'][$prefix . $_elementName])
? $params['time'][$prefix . $_elementName]
: date($_elementKey);
}
$time = mktime(0, 0, 0, $_month, $_day, $_year);
} elseif (isset($params['time'][$field_array][$prefix . 'Year'])) {
// $_REQUEST given
foreach (array('Y' => 'Year', 'm' => 'Month', 'd' => 'Day') as $_elementKey => $_elementName) {
$_variableName = '_' . strtolower($_elementName);
$$_variableName = isset($params['time'][$field_array][$prefix . $_elementName])
? $params['time'][$field_array][$prefix . $_elementName]
: date($_elementKey);
}
$time = mktime(0, 0, 0, $_month, $_day, $_year);
} else {
// no date found, use NOW
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
}
} elseif ($time === null) {
if (array_key_exists('time', $params)) {
$_year = $_month = $_day = $time = null;
} else {
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
}
}
if (preg_match('!^-\d+$!', $time)) {
// negative timestamp, use date()
$time = date('Y-m-d', $time);
}
// If $time is not in format yyyy-mm-dd
if (preg_match('/^(\d{0,4}-\d{0,2}-\d{0,2})/', $time, $found)) {
$time = $found[1];
} else {
// use smarty_make_timestamp to get an unix timestamp and
// strftime to make yyyy-mm-dd
$time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time));
}
// Now split this in pieces, which later can be used to set the select
$time = explode("-", $time);
// make syntax "+N" or "-N" work with start_year and end_year
if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
if ($match[1] == '+') {
$end_year = strftime('%Y') + $match[2];
// make syntax "+N" or "-N" work with $start_year and $end_year
// Note preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match) is slower than trim+substr
foreach (array('start', 'end') as $key) {
$key .= '_year';
$t = $$key;
if ($t === null) {
$$key = (int)$_current_year;
} else if ($t[0] == '+') {
$$key = (int)($_current_year + trim(substr($t, 1)));
} else if ($t[0] == '-') {
$$key = (int)($_current_year - trim(substr($t, 1)));
} else {
$end_year = strftime('%Y') - $match[2];
}
}
if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
if ($match[1] == '+') {
$start_year = strftime('%Y') + $match[2];
} else {
$start_year = strftime('%Y') - $match[2];
}
}
if (strlen($time[0]) > 0) {
if ($start_year > $time[0] && !isset($params['start_year'])) {
// force start year to include given date if not explicitly set
$start_year = $time[0];
}
if($end_year < $time[0] && !isset($params['end_year'])) {
// force end year to include given date if not explicitly set
$end_year = $time[0];
$$key = (int)$$key;
}
}
$field_order = strtoupper($field_order);
$html_result = $month_result = $day_result = $year_result = "";
$field_separator_count = -1;
if ($display_months) {
$field_separator_count++;
$month_names = array();
$month_values = array();
if(isset($month_empty)) {
$month_names[''] = $month_empty;
$month_values[''] = '';
}
for ($i = 1; $i <= 12; $i++) {
$month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
$month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
}
$month_result .= '<select name=';
if (null !== $field_array){
$month_result .= '"' . $field_array . '[' . $prefix . 'Month]"';
} else {
$month_result .= '"' . $prefix . 'Month"';
}
if (null !== $month_size){
$month_result .= ' size="' . $month_size . '"';
}
if (null !== $month_extra){
$month_result .= ' ' . $month_extra;
}
if (null !== $all_extra){
$month_result .= ' ' . $all_extra;
}
$month_result .= $extra_attrs . '>'."\n";
$month_result .= smarty_function_html_options(array('output' => $month_names,
'values' => $month_values,
'selected' => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
'print_result' => false),
$smarty);
$month_result .= '</select>';
}
if ($display_days) {
$field_separator_count++;
$days = array();
if (isset($day_empty)) {
$days[''] = $day_empty;
$day_values[''] = '';
}
for ($i = 1; $i <= 31; $i++) {
$days[] = sprintf($day_format, $i);
$day_values[] = sprintf($day_value_format, $i);
}
$day_result .= '<select name=';
if (null !== $field_array){
$day_result .= '"' . $field_array . '[' . $prefix . 'Day]"';
} else {
$day_result .= '"' . $prefix . 'Day"';
}
if (null !== $day_size){
$day_result .= ' size="' . $day_size . '"';
}
if (null !== $all_extra){
$day_result .= ' ' . $all_extra;
}
if (null !== $day_extra){
$day_result .= ' ' . $day_extra;
}
$day_result .= $extra_attrs . '>'."\n";
$day_result .= smarty_function_html_options(array('output' => $days,
'values' => $day_values,
'selected' => $time[2],
'print_result' => false),
$smarty);
$day_result .= '</select>';
// flip for ascending or descending
if (($start_year > $end_year && !$reverse_years) || ($start_year < $end_year && $reverse_years)) {
$t = $end_year;
$end_year = $start_year;
$start_year = $t;
}
// generate year <select> or <input>
if ($display_years) {
$field_separator_count++;
if (null !== $field_array){
$year_name = $field_array . '[' . $prefix . 'Year]';
} else {
$year_name = $prefix . 'Year';
$_html_years = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Year]') : ($prefix . 'Year');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if ($year_extra) {
$_extra .= ' ' . $year_extra;
}
if ($year_as_text) {
$year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"';
if (null !== $all_extra){
$year_result .= ' ' . $all_extra;
}
if (null !== $year_extra){
$year_result .= ' ' . $year_extra;
}
$year_result .= ' />';
$_html_years = '<input type="text" name="' . $_name . '" value="' . $_year . '" size="4" maxlength="4"' . $_extra . $extra_attrs . ' />';
} else {
$years = range((int)$start_year, (int)$end_year);
if ($reverse_years) {
rsort($years, SORT_NUMERIC);
} else {
sort($years, SORT_NUMERIC);
$_html_years = '<select name="' . $_name . '"';
if ($year_id !== null || $all_id !== null) {
$_html_years .= ' id="' . smarty_function_escape_special_chars(
$year_id !== null ? ( $year_id ? $year_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
$yearvals = $years;
if(isset($year_empty)) {
array_unshift($years, $year_empty);
array_unshift($yearvals, '');
if ($year_size) {
$_html_years .= ' size="' . $year_size . '"';
}
$_html_years .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($year_empty) || isset($all_empty)) {
$_html_years .= '<option value="">' . ( isset($year_empty) ? $year_empty : $all_empty ) . '</option>' . $option_separator;
}
$year_result .= '<select name="' . $year_name . '"';
if (null !== $year_size){
$year_result .= ' size="' . $year_size . '"';
$op = $start_year > $end_year ? -1 : 1;
for ($i=$start_year; $op > 0 ? $i <= $end_year : $i >= $end_year; $i += $op) {
$_html_years .= '<option value="' . $i . '"'
. ($_year == $i ? ' selected="selected"' : '')
. '>' . $i . '</option>' . $option_separator;
}
if (null !== $all_extra){
$year_result .= ' ' . $all_extra;
}
if (null !== $year_extra){
$year_result .= ' ' . $year_extra;
}
$year_result .= $extra_attrs . '>'."\n";
$year_result .= smarty_function_html_options(array('output' => $years,
'values' => $yearvals,
'selected' => $time[0],
'print_result' => false),
$smarty);
$year_result .= '</select>';
$_html_years .= '</select>';
}
}
// generate month <select> or <input>
if ($display_months) {
$_html_month = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Month]') : ($prefix . 'Month');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if ($month_extra) {
$_extra .= ' ' . $month_extra;
}
$_html_months = '<select name="' . $_name . '"';
if ($month_id !== null || $all_id !== null) {
$_html_months .= ' id="' . smarty_function_escape_special_chars(
$month_id !== null ? ( $month_id ? $month_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
if ($month_size) {
$_html_months .= ' size="' . $month_size . '"';
}
$_html_months .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($month_empty) || isset($all_empty)) {
$_html_months .= '<option value="">' . ( isset($month_empty) ? $month_empty : $all_empty ) . '</option>' . $option_separator;
}
for ($i = 1; $i <= 12; $i++) {
$_val = sprintf('%02d', $i);
$_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[$i]) : ($month_format == "%m" ? $_val : strftime($month_format, $_month_timestamps[$i]));
$_value = $month_value_format == "%m" ? $_val : strftime($month_value_format, $_month_timestamps[$i]);
$_html_months .= '<option value="' . $_value . '"'
. ($_val == $_month ? ' selected="selected"' : '')
. '>' . $_text . '</option>' . $option_separator;
}
$_html_months .= '</select>';
}
// generate day <select> or <input>
if ($display_days) {
$_html_day = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Day]') : ($prefix . 'Day');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if ($day_extra) {
$_extra .= ' ' . $day_extra;
}
$_html_days = '<select name="' . $_name . '"';
if ($day_id !== null || $all_id !== null) {
$_html_days .= ' id="' . smarty_function_escape_special_chars(
$day_id !== null ? ( $day_id ? $day_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
if ($day_size) {
$_html_days .= ' size="' . $day_size . '"';
}
$_html_days .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($day_empty) || isset($all_empty)) {
$_html_days .= '<option value="">' . ( isset($day_empty) ? $day_empty : $all_empty ) . '</option>' . $option_separator;
}
for ($i = 1; $i <= 31; $i++) {
$_val = sprintf('%02d', $i);
$_text = $day_format == '%02d' ? $_val : sprintf($day_format, $i);
$_value = $day_value_format == '%02d' ? $_val : sprintf($day_value_format, $i);
$_html_days .= '<option value="' . $_value . '"'
. ($_val == $_day ? ' selected="selected"' : '')
. '>' . $_text . '</option>' . $option_separator;
}
$_html_days .= '</select>';
}
// Loop thru the field_order field
for ($i = 0; $i <= 2; $i++){
$c = substr($field_order, $i, 1);
switch ($c){
case 'D':
$html_result .= $day_result;
break;
case 'M':
$html_result .= $month_result;
break;
// order the fields for output
$_html = '';
for ($i=0; $i <= 2; $i++) {
switch ($field_order[$i]) {
case 'Y':
$html_result .= $year_result;
break;
}
// Add the field seperator
if($i < $field_separator_count) {
$html_result .= $field_separator;
case 'y':
if (isset($_html_years)) {
if ($_html) {
$_html .= $field_separator;
}
$_html .= $_html_years;
}
break;
case 'm':
case 'M':
if (isset($_html_months)) {
if ($_html) {
$_html .= $field_separator;
}
$_html .= $_html_months;
}
break;
case 'd':
case 'D':
if (isset($_html_days)) {
if ($_html) {
$_html .= $field_separator;
}
$_html .= $_html_days;
}
break;
}
}
return $html_result;
return $_html;
}
/* vim: set expandtab: */
?>
?>
@@ -1,10 +1,19 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
/**
* @ignore
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
/**
* Smarty {html_select_time} function plugin
@@ -12,50 +21,102 @@
* Type: function<br>
* Name: html_select_time<br>
* Purpose: Prints the dropdowns for time selection
* @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
*
* @link http://www.smarty.net/manual/en/language.function.html.select.time.php {html_select_time}
* (Smarty online manual)
* @author Roberto Berto <roberto@berto.net>
* @credits Monte Ohrt <monte AT ohrt DOT com>
* @param array
* @param Smarty
* @author Monte Ohrt <monte AT ohrt DOT com>
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
* @uses smarty_make_timestamp()
*/
function smarty_function_html_select_time($params, &$smarty)
function smarty_function_html_select_time($params, $template)
{
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
require_once $smarty->_get_plugin_filepath('function','html_options');
/* Default values. */
$prefix = "Time_";
$time = time();
$display_hours = true;
$display_minutes = true;
$display_seconds = true;
$display_meridian = true;
$use_24_hours = true;
$minute_interval = 1;
$second_interval = 1;
/* Should the select boxes be part of an array when returned from PHP?
e.g. setting it to "birthday", would create "birthday[Hour]",
"birthday[Minute]", "birthday[Seconds]" & "birthday[Meridian]".
Can be combined with prefix. */
$field_array = null;
$all_extra = null;
$hour_extra = null;
$minute_extra = null;
$second_extra = null;
$meridian_extra = null;
$prefix = "Time_";
$field_array = null;
$field_separator = "\n";
$option_separator = "\n";
$time = null;
foreach ($params as $_key=>$_value) {
$display_hours = true;
$display_minutes = true;
$display_seconds = true;
$display_meridian = true;
$hour_format = '%02d';
$hour_value_format = '%02d';
$minute_format = '%02d';
$minute_value_format = '%02d';
$second_format = '%02d';
$second_value_format = '%02d';
$hour_size = null;
$minute_size = null;
$second_size = null;
$meridian_size = null;
$all_empty = null;
$hour_empty = null;
$minute_empty = null;
$second_empty = null;
$meridian_empty = null;
$all_id = null;
$hour_id = null;
$minute_id = null;
$second_id = null;
$meridian_id = null;
$use_24_hours = true;
$minute_interval = 1;
$second_interval = 1;
$extra_attrs = '';
$all_extra = null;
$hour_extra = null;
$minute_extra = null;
$second_extra = null;
$meridian_extra = null;
foreach ($params as $_key => $_value) {
switch ($_key) {
case 'prefix':
case 'time':
if (!is_array($_value) && $_value !== null) {
$time = smarty_make_timestamp($_value);
}
break;
case 'prefix':
case 'field_array':
case 'field_separator':
case 'option_separator':
case 'all_extra':
case 'hour_extra':
case 'minute_extra':
case 'second_extra':
case 'meridian_extra':
case 'all_empty':
case 'hour_empty':
case 'minute_empty':
case 'second_empty':
case 'meridian_empty':
case 'all_id':
case 'hour_id':
case 'minute_id':
case 'second_id':
case 'meridian_id':
case 'hour_format':
case 'hour_value_format':
case 'minute_format':
case 'minute_value_format':
case 'second_format':
case 'second_value_format':
$$_key = (string)$_value;
break;
@@ -69,126 +130,237 @@ function smarty_function_html_select_time($params, &$smarty)
case 'minute_interval':
case 'second_interval':
case 'hour_size':
case 'minute_size':
case 'second_size':
case 'meridian_size':
$$_key = (int)$_value;
break;
default:
$smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING);
if (!is_array($_value)) {
$extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
} else {
trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
$time = smarty_make_timestamp($time);
$html_result = '';
if (isset($params['time']) && is_array($params['time'])) {
if (isset($params['time'][$prefix . 'Hour'])) {
// $_REQUEST[$field_array] given
foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) {
$_variableName = '_' . strtolower($_elementName);
$$_variableName = isset($params['time'][$prefix . $_elementName])
? $params['time'][$prefix . $_elementName]
: date($_elementKey);
}
$_meridian = isset($params['time'][$prefix . 'Meridian'])
? (' ' . $params['time'][$prefix . 'Meridian'])
: '';
$time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian );
list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
} elseif (isset($params['time'][$field_array][$prefix . 'Hour'])) {
// $_REQUEST given
foreach (array('H' => 'Hour', 'i' => 'Minute', 's' => 'Second') as $_elementKey => $_elementName) {
$_variableName = '_' . strtolower($_elementName);
$$_variableName = isset($params['time'][$field_array][$prefix . $_elementName])
? $params['time'][$field_array][$prefix . $_elementName]
: date($_elementKey);
}
$_meridian = isset($params['time'][$field_array][$prefix . 'Meridian'])
? (' ' . $params['time'][$field_array][$prefix . 'Meridian'])
: '';
$time = strtotime( $_hour . ':' . $_minute . ':' . $_second . $_meridian );
list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
} else {
// no date found, use NOW
list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d'));
}
} elseif ($time === null) {
if (array_key_exists('time', $params)) {
$_hour = $_minute = $_second = $time = null;
} else {
list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s'));
}
} else {
list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time));
}
// generate hour <select>
if ($display_hours) {
$hours = $use_24_hours ? range(0, 23) : range(1, 12);
$hour_fmt = $use_24_hours ? '%H' : '%I';
for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
$hours[$i] = sprintf('%02d', $hours[$i]);
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
} else {
$html_result .= '"' . $prefix . 'Hour"';
$_html_hours = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Hour]') : ($prefix . 'Hour');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if (null !== $hour_extra){
$html_result .= ' ' . $hour_extra;
if ($hour_extra) {
$_extra .= ' ' . $hour_extra;
}
if (null !== $all_extra){
$html_result .= ' ' . $all_extra;
$_html_hours = '<select name="' . $_name . '"';
if ($hour_id !== null || $all_id !== null) {
$_html_hours .= ' id="' . smarty_function_escape_special_chars(
$hour_id !== null ? ( $hour_id ? $hour_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $hours,
'values' => $hours,
'selected' => strftime($hour_fmt, $time),
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
if ($hour_size) {
$_html_hours .= ' size="' . $hour_size . '"';
}
$_html_hours .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($hour_empty) || isset($all_empty)) {
$_html_hours .= '<option value="">' . ( isset($hour_empty) ? $hour_empty : $all_empty ) . '</option>' . $option_separator;
}
$start = $use_24_hours ? 0 : 1;
$end = $use_24_hours ? 23 : 12;
for ($i=$start; $i <= $end; $i++) {
$_val = sprintf('%02d', $i);
$_text = $hour_format == '%02d' ? $_val : sprintf($hour_format, $i);
$_value = $hour_value_format == '%02d' ? $_val : sprintf($hour_value_format, $i);
if (!$use_24_hours) {
$_hour12 = $_hour == 0
? 12
: ($_hour <= 12 ? $_hour : $_hour -12);
}
$selected = $_hour !== null ? ($use_24_hours ? $_hour == $_val : $_hour12 == $_val) : null;
$_html_hours .= '<option value="' . $_value . '"'
. ($selected ? ' selected="selected"' : '')
. '>' . $_text . '</option>' . $option_separator;
}
$_html_hours .= '</select>';
}
// generate minute <select>
if ($display_minutes) {
$all_minutes = range(0, 59);
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
$minutes[] = sprintf('%02d', $all_minutes[$i]);
$selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
} else {
$html_result .= '"' . $prefix . 'Minute"';
$_html_minutes = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Minute]') : ($prefix . 'Minute');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if (null !== $minute_extra){
$html_result .= ' ' . $minute_extra;
if ($minute_extra) {
$_extra .= ' ' . $minute_extra;
}
if (null !== $all_extra){
$html_result .= ' ' . $all_extra;
$_html_minutes = '<select name="' . $_name . '"';
if ($minute_id !== null || $all_id !== null) {
$_html_minutes .= ' id="' . smarty_function_escape_special_chars(
$minute_id !== null ? ( $minute_id ? $minute_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $minutes,
'values' => $minutes,
'selected' => $selected,
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
if ($minute_size) {
$_html_minutes .= ' size="' . $minute_size . '"';
}
$_html_minutes .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($minute_empty) || isset($all_empty)) {
$_html_minutes .= '<option value="">' . ( isset($minute_empty) ? $minute_empty : $all_empty ) . '</option>' . $option_separator;
}
$selected = $_minute !== null ? ($_minute - $_minute % $minute_interval) : null;
for ($i=0; $i <= 59; $i += $minute_interval) {
$_val = sprintf('%02d', $i);
$_text = $minute_format == '%02d' ? $_val : sprintf($minute_format, $i);
$_value = $minute_value_format == '%02d' ? $_val : sprintf($minute_value_format, $i);
$_html_minutes .= '<option value="' . $_value . '"'
. ($selected === $i ? ' selected="selected"' : '')
. '>' . $_text . '</option>' . $option_separator;
}
$_html_minutes .= '</select>';
}
// generate second <select>
if ($display_seconds) {
$all_seconds = range(0, 59);
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
$seconds[] = sprintf('%02d', $all_seconds[$i]);
$selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
} else {
$html_result .= '"' . $prefix . 'Second"';
$_html_seconds = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Second]') : ($prefix . 'Second');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if (null !== $second_extra){
$html_result .= ' ' . $second_extra;
if ($second_extra) {
$_extra .= ' ' . $second_extra;
}
if (null !== $all_extra){
$html_result .= ' ' . $all_extra;
$_html_seconds = '<select name="' . $_name . '"';
if ($second_id !== null || $all_id !== null) {
$_html_seconds .= ' id="' . smarty_function_escape_special_chars(
$second_id !== null ? ( $second_id ? $second_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => $seconds,
'values' => $seconds,
'selected' => $selected,
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
if ($second_size) {
$_html_seconds .= ' size="' . $second_size . '"';
}
$_html_seconds .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($second_empty) || isset($all_empty)) {
$_html_seconds .= '<option value="">' . ( isset($second_empty) ? $second_empty : $all_empty ) . '</option>' . $option_separator;
}
$selected = $_second !== null ? ($_second - $_second % $second_interval) : null;
for ($i=0; $i <= 59; $i += $second_interval) {
$_val = sprintf('%02d', $i);
$_text = $second_format == '%02d' ? $_val : sprintf($second_format, $i);
$_value = $second_value_format == '%02d' ? $_val : sprintf($second_value_format, $i);
$_html_seconds .= '<option value="' . $_value . '"'
. ($selected === $i ? ' selected="selected"' : '')
. '>' . $_text . '</option>' . $option_separator;
}
$_html_seconds .= '</select>';
}
// generate meridian <select>
if ($display_meridian && !$use_24_hours) {
$html_result .= '<select name=';
if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"';
} else {
$html_result .= '"' . $prefix . 'Meridian"';
$_html_meridian = '';
$_extra = '';
$_name = $field_array ? ($field_array . '[' . $prefix . 'Meridian]') : ($prefix . 'Meridian');
if ($all_extra) {
$_extra .= ' ' . $all_extra;
}
if (null !== $meridian_extra){
$html_result .= ' ' . $meridian_extra;
if ($meridian_extra) {
$_extra .= ' ' . $meridian_extra;
}
if (null !== $all_extra){
$html_result .= ' ' . $all_extra;
$_html_meridian = '<select name="' . $_name . '"';
if ($meridian_id !== null || $all_id !== null) {
$_html_meridian .= ' id="' . smarty_function_escape_special_chars(
$meridian_id !== null ? ( $meridian_id ? $meridian_id : $_name ) : ( $all_id ? ($all_id . $_name) : $_name )
) . '"';
}
$html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
'values' => array('am', 'pm'),
'selected' => strtolower(strftime('%p', $time)),
'print_result' => false),
$smarty);
$html_result .= "</select>\n";
if ($meridian_size) {
$_html_meridian .= ' size="' . $meridian_size . '"';
}
$_html_meridian .= $_extra . $extra_attrs . '>' . $option_separator;
if (isset($meridian_empty) || isset($all_empty)) {
$_html_meridian .= '<option value="">' . ( isset($meridian_empty) ? $meridian_empty : $all_empty ) . '</option>' . $option_separator;
}
$_html_meridian .= '<option value="am"'. ($_hour < 12 ? ' selected="selected"' : '') .'>AM</option>' . $option_separator
. '<option value="pm"'. ($_hour < 12 ? '' : ' selected="selected"') .'>PM</option>' . $option_separator
. '</select>';
}
return $html_result;
$_html = '';
foreach (array('_html_hours', '_html_minutes', '_html_seconds', '_html_meridian') as $k) {
if (isset($$k)) {
if ($_html) {
$_html .= $field_separator;
}
$_html .= $$k;
}
}
return $_html;
}
/* vim: set expandtab: */
?>
?>
@@ -1,11 +1,11 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {html_table} function plugin
*
@@ -13,40 +13,41 @@
* Name: html_table<br>
* Date: Feb 17, 2003<br>
* Purpose: make an html table from an array of data<br>
* Input:<br>
* - loop = array to loop through
* - cols = number of columns, comma separated list of column names
* or array of column names
* - rows = number of rows
* - table_attr = table attributes
* - th_attr = table heading attributes (arrays are cycled)
* - tr_attr = table row attributes (arrays are cycled)
* - td_attr = table cell attributes (arrays are cycled)
* - trailpad = value to pad trailing cells with
* - caption = text for caption element
* - vdir = vertical direction (default: "down", means top-to-bottom)
* - hdir = horizontal direction (default: "right", means left-to-right)
* - inner = inner loop (default "cols": print $loop line by line,
* $loop will be printed column by column otherwise)
*
*
* Params:
* <pre>
* - loop - array to loop through
* - cols - number of columns, comma separated list of column names
* or array of column names
* - rows - number of rows
* - table_attr - table attributes
* - th_attr - table heading attributes (arrays are cycled)
* - tr_attr - table row attributes (arrays are cycled)
* - td_attr - table cell attributes (arrays are cycled)
* - trailpad - value to pad trailing cells with
* - caption - text for caption element
* - vdir - vertical direction (default: "down", means top-to-bottom)
* - hdir - horizontal direction (default: "right", means left-to-right)
* - inner - inner loop (default "cols": print $loop line by line,
* $loop will be printed column by column otherwise)
* </pre>
* Examples:
* <pre>
* {table loop=$data}
* {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
* {table loop=$data cols="first,second,third" tr_attr=$colors}
* </pre>
* @author Monte Ohrt <monte at ohrt dot com>
*
* @author Monte Ohrt <monte at ohrt dot com>
* @author credit to Messju Mohr <messju at lammfellpuschen dot de>
* @author credit to boots <boots dot smarty at yahoo dot com>
* @version 1.1
* @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
* @version 1.1
* @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
* (Smarty online manual)
* @param array
* @param Smarty
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
*/
function smarty_function_html_table($params, &$smarty)
function smarty_function_html_table($params, $template)
{
$table_attr = 'border="1"';
$tr_attr = '';
@@ -59,13 +60,14 @@ function smarty_function_html_table($params, &$smarty)
$hdir = 'right';
$inner = 'cols';
$caption = '';
$loop = null;
if (!isset($params['loop'])) {
$smarty->trigger_error("html_table: missing 'loop' parameter");
trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING);
return;
}
foreach ($params as $_key=>$_value) {
foreach ($params as $_key => $_value) {
switch ($_key) {
case 'loop':
$$_key = (array)$_value;
@@ -109,11 +111,11 @@ function smarty_function_html_table($params, &$smarty)
$loop_count = count($loop);
if (empty($params['rows'])) {
/* no rows specified */
$rows = ceil($loop_count/$cols_count);
$rows = ceil($loop_count / $cols_count);
} elseif (empty($params['cols'])) {
if (!empty($params['rows'])) {
/* no cols specified, but rows */
$cols_count = ceil($loop_count/$rows);
$cols_count = ceil($loop_count / $rows);
}
}
@@ -127,7 +129,7 @@ function smarty_function_html_table($params, &$smarty)
$cols = ($hdir == 'right') ? $cols : array_reverse($cols);
$output .= "<thead><tr>\n";
for ($r=0; $r<$cols_count; $r++) {
for ($r = 0; $r < $cols_count; $r++) {
$output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';
$output .= $cols[$r];
$output .= "</th>\n";
@@ -136,18 +138,18 @@ function smarty_function_html_table($params, &$smarty)
}
$output .= "<tbody>\n";
for ($r=0; $r<$rows; $r++) {
for ($r = 0; $r < $rows; $r++) {
$output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
$rx = ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count;
$rx = ($vdir == 'down') ? $r * $cols_count : ($rows-1 - $r) * $cols_count;
for ($c=0; $c<$cols_count; $c++) {
$x = ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c;
if ($inner!='cols') {
for ($c = 0; $c < $cols_count; $c++) {
$x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count-1 - $c;
if ($inner != 'cols') {
/* shuffle x to loop over rows*/
$x = floor($x/$cols_count) + ($x%$cols_count)*$rows;
$x = floor($x / $cols_count) + ($x % $cols_count) * $rows;
}
if ($x<$loop_count) {
if ($x < $loop_count) {
$output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
} else {
$output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
@@ -157,21 +159,19 @@ function smarty_function_html_table($params, &$smarty)
}
$output .= "</tbody>\n";
$output .= "</table>\n";
return $output;
}
function smarty_function_html_table_cycle($name, $var, $no) {
if(!is_array($var)) {
function smarty_function_html_table_cycle($name, $var, $no)
{
if (!is_array($var)) {
$ret = $var;
} else {
$ret = $var[$no % count($var)];
}
return ($ret) ? ' '.$ret : '';
return ($ret) ? ' ' . $ret : '';
}
/* vim: set expandtab: */
?>
?>
@@ -1,34 +1,34 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {mailto} function plugin
*
* Type: function<br>
* Name: mailto<br>
* Date: May 21, 2002
* Purpose: automate mailto address link creation, and optionally
* encode them.<br>
* Input:<br>
* - address = e-mail address
* - text = (optional) text to display, default is address
* - encode = (optional) can be one of:
* * none : no encoding (default)
* * javascript : encode with javascript
* * javascript_charcode : encode with javascript charcode
* * hex : encode with hexidecimal (no javascript)
* - cc = (optional) address(es) to carbon copy
* - bcc = (optional) address(es) to blind carbon copy
* - subject = (optional) e-mail subject
* - newsgroups = (optional) newsgroup(s) to post to
* - followupto = (optional) address(es) to follow up to
* - extra = (optional) extra tags for the href link
*
* Purpose: automate mailto address link creation, and optionally encode them.<br>
* Params:
* <pre>
* - address - (required) - e-mail address
* - text - (optional) - text to display, default is address
* - encode - (optional) - can be one of:
* * none : no encoding (default)
* * javascript : encode with javascript
* * javascript_charcode : encode with javascript charcode
* * hex : encode with hexidecimal (no javascript)
* - cc - (optional) - address(es) to carbon copy
* - bcc - (optional) - address(es) to blind carbon copy
* - subject - (optional) - e-mail subject
* - newsgroups - (optional) - newsgroup(s) to post to
* - followupto - (optional) - address(es) to follow up to
* - extra - (optional) - extra tags for the href link
* </pre>
* Examples:
* <pre>
* {mailto address="me@domain.com"}
@@ -38,45 +38,46 @@
* {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
* {mailto address="me@domain.com" extra='class="mailto"'}
* </pre>
* @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
*
* @link http://www.smarty.net/manual/en/language.function.mailto.php {mailto}
* (Smarty online manual)
* @version 1.2
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Jason Sweat (added cc, bcc and subject functionality)
* @param array
* @param Smarty
* @return string
* @version 1.2
* @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Jason Sweat (added cc, bcc and subject functionality)
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string
*/
function smarty_function_mailto($params, &$smarty)
function smarty_function_mailto($params, $template)
{
static $_allowed_encoding = array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true);
$extra = '';
if (empty($params['address'])) {
$smarty->trigger_error("mailto: missing 'address' parameter");
trigger_error("mailto: missing 'address' parameter",E_USER_WARNING);
return;
} else {
$address = $params['address'];
}
$text = $address;
// netscape and mozilla do not decode %40 (@) in BCC field (bug?)
// so, don't encode it.
$search = array('%40', '%2C');
$replace = array('@', ',');
$replace = array('@', ',');
$mail_parms = array();
foreach ($params as $var=>$value) {
foreach ($params as $var => $value) {
switch ($var) {
case 'cc':
case 'bcc':
case 'followupto':
if (!empty($value))
$mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value));
$mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value));
break;
case 'subject':
case 'newsgroups':
$mail_parms[] = $var.'='.rawurlencode($value);
$mail_parms[] = $var . '=' . rawurlencode($value);
break;
case 'extra':
@@ -87,79 +88,65 @@ function smarty_function_mailto($params, &$smarty)
}
}
$mail_parm_vals = '';
for ($i=0; $i<count($mail_parms); $i++) {
$mail_parm_vals .= (0==$i) ? '?' : '&';
$mail_parm_vals .= $mail_parms[$i];
if ($mail_parms) {
$address .= '?' . join('&', $mail_parms);
}
$address .= $mail_parm_vals;
$encode = (empty($params['encode'])) ? 'none' : $params['encode'];
if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) {
$smarty->trigger_error("mailto: 'encode' parameter must be none, javascript or hex");
if (!isset($_allowed_encoding[$encode])) {
trigger_error("mailto: 'encode' parameter must be none, javascript, javascript_charcode or hex", E_USER_WARNING);
return;
}
if ($encode == 'javascript' ) {
$string = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');';
// FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed!
if ($encode == 'javascript') {
$string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');';
$js_encode = '';
for ($x=0; $x < strlen($string); $x++) {
for ($x = 0, $_length = strlen($string); $x < $_length; $x++) {
$js_encode .= '%' . bin2hex($string[$x]);
}
return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';
} elseif ($encode == 'javascript_charcode') {
$string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
} elseif ($encode == 'javascript_charcode' ) {
$string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
for($x = 0, $y = strlen($string); $x < $y; $x++ ) {
$ord[] = ord($string[$x]);
for($x = 0, $y = strlen($string); $x < $y; $x++) {
$ord[] = ord($string[$x]);
}
$_ret = "<script type=\"text/javascript\" language=\"javascript\">\n";
$_ret .= "<!--\n";
$_ret .= "{document.write(String.fromCharCode(";
$_ret .= implode(',',$ord);
$_ret .= "))";
$_ret .= "}\n";
$_ret .= "//-->\n";
$_ret .= "</script>\n";
return $_ret;
} elseif ($encode == 'hex') {
$_ret = "<script type=\"text/javascript\" language=\"javascript\">\n"
. "{document.write(String.fromCharCode("
. implode(',', $ord)
. "))"
. "}\n"
. "</script>\n";
preg_match('!^(.*)(\?.*)$!',$address,$match);
if(!empty($match[2])) {
$smarty->trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.");
return $_ret;
} elseif ($encode == 'hex') {
preg_match('!^(.*)(\?.*)$!', $address, $match);
if (!empty($match[2])) {
trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.",E_USER_WARNING);
return;
}
$address_encode = '';
for ($x=0; $x < strlen($address); $x++) {
if(preg_match('!\w!',$address[$x])) {
for ($x = 0, $_length = strlen($address); $x < $_length; $x++) {
if (preg_match('!\w!' . Smarty::$_UTF8_MODIFIER, $address[$x])) {
$address_encode .= '%' . bin2hex($address[$x]);
} else {
$address_encode .= $address[$x];
}
}
$text_encode = '';
for ($x=0; $x < strlen($text); $x++) {
$text_encode .= '&#x' . bin2hex($text[$x]).';';
for ($x = 0, $_length = strlen($text); $x < $_length; $x++) {
$text_encode .= '&#x' . bin2hex($text[$x]) . ';';
}
$mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
return '<a href="'.$mailto.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
return '<a href="' . $mailto . $address_encode . '" ' . $extra . '>' . $text_encode . '</a>';
} else {
// no encoding
return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
return '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,49 +1,53 @@
<?php
/**
* Smarty plugin
*
* This plugin is only for Smarty2 BC
* @package Smarty
* @subpackage plugins
* @subpackage PluginsFunction
*/
/**
* Smarty {math} function plugin
*
* Type: function<br>
* Name: math<br>
* Purpose: handle math computations in template<br>
* @link http://smarty.php.net/manual/en/language.function.math.php {math}
* Purpose: handle math computations in template
*
* @link http://www.smarty.net/manual/en/language.function.math.php {math}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string
* @param array $params parameters
* @param Smarty_Internal_Template $template template object
* @return string|null
*/
function smarty_function_math($params, &$smarty)
function smarty_function_math($params, $template)
{
static $_allowed_funcs = array(
'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true,
'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true,
'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true ,'tan' => true
);
// be sure equation parameter is present
if (empty($params['equation'])) {
$smarty->trigger_error("math: missing equation parameter");
trigger_error("math: missing equation parameter",E_USER_WARNING);
return;
}
// strip out backticks, not necessary for math
$equation = str_replace('`','',$params['equation']);
$equation = $params['equation'];
// make sure parenthesis are balanced
if (substr_count($equation,"(") != substr_count($equation,")")) {
$smarty->trigger_error("math: unbalanced parenthesis");
trigger_error("math: unbalanced parenthesis",E_USER_WARNING);
return;
}
// match all vars in equation, make sure all are passed
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
$allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
foreach($match[1] as $curr_var) {
if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
$smarty->trigger_error("math: function call $curr_var not allowed");
if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) {
trigger_error("math: function call $curr_var not allowed",E_USER_WARNING);
return;
}
}
@@ -52,34 +56,32 @@ function smarty_function_math($params, &$smarty)
if ($key != "equation" && $key != "format" && $key != "assign") {
// make sure value is not empty
if (strlen($val)==0) {
$smarty->trigger_error("math: parameter $key is empty");
trigger_error("math: parameter $key is empty",E_USER_WARNING);
return;
}
if (!is_numeric($val)) {
$smarty->trigger_error("math: parameter $key: is not numeric");
trigger_error("math: parameter $key: is not numeric",E_USER_WARNING);
return;
}
$equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
}
}
$smarty_math_result = null;
eval("\$smarty_math_result = ".$equation.";");
if (empty($params['format'])) {
if (empty($params['assign'])) {
return $smarty_math_result;
} else {
$smarty->assign($params['assign'],$smarty_math_result);
$template->assign($params['assign'],$smarty_math_result);
}
} else {
if (empty($params['assign'])){
printf($params['format'],$smarty_math_result);
} else {
$smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
$template->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
}
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,119 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {popup} function plugin
*
* Type: function<br>
* Name: popup<br>
* Purpose: make text pop up in windows via overlib
* @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string
*/
function smarty_function_popup($params, &$smarty)
{
$append = '';
foreach ($params as $_key=>$_value) {
switch ($_key) {
case 'text':
case 'trigger':
case 'function':
case 'inarray':
$$_key = (string)$_value;
if ($_key == 'function' || $_key == 'inarray')
$append .= ',' . strtoupper($_key) . ",'$_value'";
break;
case 'caption':
case 'closetext':
case 'status':
$append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
break;
case 'fgcolor':
case 'bgcolor':
case 'textcolor':
case 'capcolor':
case 'closecolor':
case 'textfont':
case 'captionfont':
case 'closefont':
case 'fgbackground':
case 'bgbackground':
case 'caparray':
case 'capicon':
case 'background':
case 'frame':
$append .= ',' . strtoupper($_key) . ",'$_value'";
break;
case 'textsize':
case 'captionsize':
case 'closesize':
case 'width':
case 'height':
case 'border':
case 'offsetx':
case 'offsety':
case 'snapx':
case 'snapy':
case 'fixx':
case 'fixy':
case 'padx':
case 'pady':
case 'timeout':
case 'delay':
$append .= ',' . strtoupper($_key) . ",$_value";
break;
case 'sticky':
case 'left':
case 'right':
case 'center':
case 'above':
case 'below':
case 'noclose':
case 'autostatus':
case 'autostatuscap':
case 'fullhtml':
case 'hauto':
case 'vauto':
case 'mouseoff':
case 'followmouse':
case 'closeclick':
if ($_value) $append .= ',' . strtoupper($_key);
break;
default:
$smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
}
}
if (empty($text) && !isset($inarray) && empty($function)) {
$smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
return false;
}
if (empty($trigger)) { $trigger = "onmouseover"; }
$retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
$retval .= $append . ');"';
if ($trigger == 'onmouseover')
$retval .= ' onmouseout="nd();"';
return $retval;
}
/* vim: set expandtab: */
?>
@@ -1,40 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {popup_init} function plugin
*
* Type: function<br>
* Name: popup_init<br>
* Purpose: initialize overlib
* @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array
* @param Smarty
* @return string
*/
function smarty_function_popup_init($params, &$smarty)
{
$zindex = 1000;
if (!empty($params['zindex'])) {
$zindex = $params['zindex'];
}
if (!empty($params['src'])) {
return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
. '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
} else {
$smarty->trigger_error("popup_init: missing src parameter");
}
}
/* vim: set expandtab: */
?>
@@ -1,43 +1,65 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty capitalize modifier plugin
*
*
* Type: modifier<br>
* Name: capitalize<br>
* Purpose: capitalize words in the string
* @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
* capitalize (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return string
*
* {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }}
*
* @param string $string string to capitalize
* @param boolean $uc_digits also capitalize "x123" to "X123"
* @param boolean $lc_rest capitalize first letters, lowercase all following letters "aAa" to "Aaa"
* @return string capitalized string
* @author Monte Ohrt <monte at ohrt dot com>
* @author Rodney Rehm
*/
function smarty_modifier_capitalize($string, $uc_digits = false)
function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false)
{
smarty_modifier_capitalize_ucfirst(null, $uc_digits);
return preg_replace_callback('!\'?\b\w(\w|\')*\b!', 'smarty_modifier_capitalize_ucfirst', $string);
}
function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null)
{
static $_uc_digits = false;
if(isset($uc_digits)) {
$_uc_digits = $uc_digits;
return;
if (Smarty::$_MBSTRING) {
if ($lc_rest) {
// uppercase (including hyphenated words)
$upper_string = mb_convert_case( $string, MB_CASE_TITLE, Smarty::$_CHARSET );
} else {
// uppercase word breaks
$upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[2]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '");'), $string);
}
// check uc_digits case
if (!$uc_digits) {
if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
foreach($matches[1] as $match) {
$upper_string = substr_replace($upper_string, mb_strtolower($match[0], Smarty::$_CHARSET), $match[1], strlen($match[0]));
}
}
}
$upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '");'), $upper_string);
return $upper_string;
}
if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits)
return ucfirst($string[0]);
else
return $string[0];
}
// lowercase first
if ($lc_rest) {
$string = strtolower($string);
}
// uppercase (including hyphenated words)
$upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[2]));'), $string);
// check uc_digits case
if (!$uc_digits) {
if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
foreach($matches[1] as $match) {
$upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0]));
}
}
}
$upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[3]));'), $upper_string);
return $upper_string;
}
?>
?>
@@ -1,33 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty cat modifier plugin
*
* Type: modifier<br>
* Name: cat<br>
* Date: Feb 24, 2003
* Purpose: catenate a value to a variable
* Input: string to catenate
* Example: {$var|cat:"foo"}
* @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
* (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param string
* @param string
* @return string
*/
function smarty_modifier_cat($string, $cat)
{
return $string . $cat;
}
/* vim: set expandtab: */
?>
@@ -1,32 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty count_characters modifier plugin
*
* Type: modifier<br>
* Name: count_characteres<br>
* Purpose: count the number of characters in a text
* @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
* count_characters (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param boolean include whitespace in the character count
* @return integer
*/
function smarty_modifier_count_characters($string, $include_spaces = false)
{
if ($include_spaces)
return(strlen($string));
return preg_match_all("/[^\s]/",$string, $match);
}
/* vim: set expandtab: */
?>
@@ -1,29 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty count_paragraphs modifier plugin
*
* Type: modifier<br>
* Name: count_paragraphs<br>
* Purpose: count the number of paragraphs in a text
* @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
* count_paragraphs (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return integer
*/
function smarty_modifier_count_paragraphs($string)
{
// count \r or \n characters
return count(preg_split('/[\r\n]+/', $string));
}
/* vim: set expandtab: */
?>
@@ -1,29 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty count_sentences modifier plugin
*
* Type: modifier<br>
* Name: count_sentences
* Purpose: count the number of sentences in a text
* @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
* count_sentences (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return integer
*/
function smarty_modifier_count_sentences($string)
{
// find periods with a word before but not after.
return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
}
/* vim: set expandtab: */
?>
@@ -1,33 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty count_words modifier plugin
*
* Type: modifier<br>
* Name: count_words<br>
* Purpose: count the number of words in a text
* @link http://smarty.php.net/manual/en/language.modifier.count.words.php
* count_words (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return integer
*/
function smarty_modifier_count_words($string)
{
// split text by ' ',\r,\n,\f,\t
$split_array = preg_split('/\s+/',$string);
// count matches that contain alphanumerics
$word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
return count($word_count);
}
/* vim: set expandtab: */
?>
@@ -1,58 +1,65 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Include the {@link shared.make_timestamp.php} plugin
*/
require_once $smarty->_get_plugin_filepath('shared', 'make_timestamp');
/**
* Smarty date_format modifier plugin
*
*
* Type: modifier<br>
* Name: date_format<br>
* Purpose: format datestamps via strftime<br>
* Input:<br>
* - string: input date string
* - format: strftime format for output
* - default_date: default date if $string is empty
* @link http://smarty.php.net/manual/en/language.modifier.date.format.php
* date_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @param string
* @return string|void
* - string: input date string
* - format: strftime format for output
* - default_date: default date if $string is empty
*
* @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string $string input date string
* @param string $format strftime format for output
* @param string $default_date default date if $string is empty
* @param string $formatter either 'strftime' or 'auto'
* @return string |void
* @uses smarty_make_timestamp()
*/
function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_date = '')
function smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
{
if ($string != '') {
if ($format === null) {
$format = Smarty::$_DATE_FORMAT;
}
/**
* Include the {@link shared.make_timestamp.php} plugin
*/
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') {
$timestamp = smarty_make_timestamp($string);
} elseif ($default_date != '') {
$timestamp = smarty_make_timestamp($default_date);
} else {
return;
}
if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) {
if (DS == '\\') {
$_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
$_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
if (strpos($format, '%e') !== false) {
$_win_from[] = '%e';
$_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
}
if (strpos($format, '%l') !== false) {
$_win_from[] = '%l';
$_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
}
$format = str_replace($_win_from, $_win_to, $format);
}
return strftime($format, $timestamp);
} else {
return date($format, $timestamp);
}
if (DIRECTORY_SEPARATOR == '\\') {
$_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
$_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
if (strpos($format, '%e') !== false) {
$_win_from[] = '%e';
$_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
}
if (strpos($format, '%l') !== false) {
$_win_from[] = '%l';
$_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
}
$format = str_replace($_win_from, $_win_to, $format);
}
return strftime($format, $timestamp);
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,53 +1,53 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage Debug
*/
/**
* Smarty debug_print_var modifier plugin
*
*
* Type: modifier<br>
* Name: debug_print_var<br>
* Purpose: formats variable contents for display in the console
* @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
* debug_print_var (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param array|object
* @param integer
* @param integer
* @return string
*
* @author Monte Ohrt <monte at ohrt dot com>
* @param array|object $var variable to be formatted
* @param integer $depth maximum recursion depth if $var is an array
* @param integer $length maximum string length if $var is a string
* @return string
*/
function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
{
$_replace = array(
"\n" => '<i>\n</i>',
$_replace = array("\n" => '<i>\n</i>',
"\r" => '<i>\r</i>',
"\t" => '<i>\t</i>'
);
);
switch (gettype($var)) {
case 'array' :
$results = '<b>Array (' . count($var) . ')</b>';
foreach ($var as $curr_key => $curr_val) {
$results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
. '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
. smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
$depth--;
}
. '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
. smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
$depth--;
}
break;
case 'object' :
$object_vars = get_object_vars($var);
$results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';
foreach ($object_vars as $curr_key => $curr_val) {
$results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
. '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
. smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
$depth--;
}
. '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
. smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
$depth--;
}
break;
case 'boolean' :
case 'NULL' :
case 'resource' :
@@ -59,32 +59,47 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
$results = 'null';
} else {
$results = htmlspecialchars((string) $var);
}
}
$results = '<i>' . $results . '</i>';
break;
case 'integer' :
case 'float' :
$results = htmlspecialchars((string) $var);
break;
case 'string' :
$results = strtr($var, $_replace);
if (strlen($var) > $length ) {
$results = substr($var, 0, $length - 3) . '...';
if (Smarty::$_MBSTRING) {
if (mb_strlen($var, Smarty::$_CHARSET) > $length) {
$results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';
}
} else {
if (isset($var[$length])) {
$results = substr($var, 0, $length - 3) . '...';
}
}
$results = htmlspecialchars('"' . $results . '"');
break;
case 'unknown type' :
default :
$results = strtr((string) $var, $_replace);
if (strlen($results) > $length ) {
$results = substr($results, 0, $length - 3) . '...';
if (Smarty::$_MBSTRING) {
if (mb_strlen($results, Smarty::$_CHARSET) > $length) {
$results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...';
}
} else {
if (strlen($results) > $length) {
$results = substr($results, 0, $length - 3) . '...';
}
}
$results = htmlspecialchars($results);
}
}
return $results;
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,32 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty default modifier plugin
*
* Type: modifier<br>
* Name: default<br>
* Purpose: designate default value for empty variables
* @link http://smarty.php.net/manual/en/language.modifier.default.php
* default (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @return string
*/
function smarty_modifier_default($string, $default = '')
{
if (!isset($string) || $string === '')
return $default;
else
return $string;
}
/* vim: set expandtab: */
?>
@@ -1,93 +1,188 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty escape modifier plugin
*
* Type: modifier<br>
* Name: escape<br>
* Purpose: Escape the string according to escapement type
* @link http://smarty.php.net/manual/en/language.modifier.escape.php
* escape (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param html|htmlall|url|quotes|hex|hexentity|javascript
* @return string
* Purpose: escape string for output
*
* @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string $string input string
* @param string $esc_type escape type
* @param string $char_set character set, used for htmlspecialchars() or htmlentities()
* @param boolean $double_encode encode already encoded entitites again, used for htmlspecialchars() or htmlentities()
* @return string escaped input string
*/
function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1')
function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)
{
static $_double_encode = null;
if ($_double_encode === null) {
$_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
}
if (!$char_set) {
$char_set = Smarty::$_CHARSET;
}
switch ($esc_type) {
case 'html':
return htmlspecialchars($string, ENT_QUOTES, $char_set);
if ($_double_encode) {
// php >=5.3.2 - go native
return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
} else {
if ($double_encode) {
// php <5.2.3 - only handle double encoding
return htmlspecialchars($string, ENT_QUOTES, $char_set);
} else {
// php <5.2.3 - prevent double encoding
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
$string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
return $string;
}
}
case 'htmlall':
return htmlentities($string, ENT_QUOTES, $char_set);
if (Smarty::$_MBSTRING) {
// mb_convert_encoding ignores htmlspecialchars()
if ($_double_encode) {
// php >=5.3.2 - go native
$string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);
} else {
if ($double_encode) {
// php <5.2.3 - only handle double encoding
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
} else {
// php <5.2.3 - prevent double encoding
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
$string = htmlspecialchars($string, ENT_QUOTES, $char_set);
$string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
return $string;
}
}
// htmlentities() won't convert everything, so use mb_convert_encoding
return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);
}
// no MBString fallback
if ($_double_encode) {
return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);
} else {
if ($double_encode) {
return htmlentities($string, ENT_QUOTES, $char_set);
} else {
$string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
$string = htmlentities($string, ENT_QUOTES, $char_set);
$string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
return $string;
}
}
case 'url':
return rawurlencode($string);
case 'urlpathinfo':
return str_replace('%2F','/',rawurlencode($string));
return str_replace('%2F', '/', rawurlencode($string));
case 'quotes':
// escape unescaped single quotes
return preg_replace("%(?<!\\\\)'%", "\\'", $string);
case 'hex':
// escape every character into hex
// escape every byte into hex
// Note that the UTF-8 encoded character ä will be represented as %c3%a4
$return = '';
for ($x=0; $x < strlen($string); $x++) {
$_length = strlen($string);
for ($x = 0; $x < $_length; $x++) {
$return .= '%' . bin2hex($string[$x]);
}
return $return;
case 'hexentity':
$return = '';
for ($x=0; $x < strlen($string); $x++) {
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
$return = '';
foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
$return .= '&#x' . strtoupper(dechex($unicode)) . ';';
}
return $return;
}
// no MBString fallback
$_length = strlen($string);
for ($x = 0; $x < $_length; $x++) {
$return .= '&#x' . bin2hex($string[$x]) . ';';
}
return $return;
case 'decentity':
$return = '';
for ($x=0; $x < strlen($string); $x++) {
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
$return = '';
foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
$return .= '&#' . $unicode . ';';
}
return $return;
}
// no MBString fallback
$_length = strlen($string);
for ($x = 0; $x < $_length; $x++) {
$return .= '&#' . ord($string[$x]) . ';';
}
return $return;
case 'javascript':
// escape quotes and backslashes, newlines, etc.
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
return strtr($string, array('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', '</' => '<\/'));
case 'mail':
// safe way to display e-mail address on a web page
return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
return smarty_mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
}
// no MBString fallback
return str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
case 'nonstd':
// escape non-standard chars, such as ms document quotes
$_res = '';
for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
$_ord = ord(substr($string, $_i, 1));
// non-standard char, escape it
if($_ord >= 126){
$_res .= '&#' . $_ord . ';';
}
else {
$_res .= substr($string, $_i, 1);
}
}
return $_res;
// escape non-standard chars, such as ms document quotes
$return = '';
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php');
foreach (smarty_mb_to_unicode($string, Smarty::$_CHARSET) as $unicode) {
if ($unicode >= 126) {
$return .= '&#' . $unicode . ';';
} else {
$return .= chr($unicode);
}
}
return $return;
}
$_length = strlen($string);
for ($_i = 0; $_i < $_length; $_i++) {
$_ord = ord(substr($string, $_i, 1));
// non-standard char, escape it
if ($_ord >= 126) {
$return .= '&#' . $_ord . ';';
} else {
$return .= substr($string, $_i, 1);
}
}
return $return;
default:
return $string;
}
}
/* vim: set expandtab: */
?>
?>
@@ -1,28 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty indent modifier plugin
*
* Type: modifier<br>
* Name: indent<br>
* Purpose: indent lines of text
* @link http://smarty.php.net/manual/en/language.modifier.indent.php
* indent (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param integer
* @param string
* @return string
*/
function smarty_modifier_indent($string,$chars=4,$char=" ")
{
return preg_replace('!^!m',str_repeat($char,$chars),$string);
}
?>
@@ -1,26 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty lower modifier plugin
*
* Type: modifier<br>
* Name: lower<br>
* Purpose: convert string to lowercase
* @link http://smarty.php.net/manual/en/language.modifier.lower.php
* lower (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return string
*/
function smarty_modifier_lower($string)
{
return strtolower($string);
}
?>
@@ -1,35 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty plugin
*
* Type: modifier<br>
* Name: nl2br<br>
* Date: Feb 26, 2003
* Purpose: convert \r\n, \r or \n to <<br>>
* Input:<br>
* - contents = contents to replace
* - preceed_test = if true, includes preceeding break tags
* in replacement
* Example: {$text|nl2br}
* @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
* nl2br (Smarty online manual)
* @version 1.0
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return string
*/
function smarty_modifier_nl2br($string)
{
return nl2br($string);
}
/* vim: set expandtab: */
?>
@@ -1,48 +1,55 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty regex_replace modifier plugin
*
* Type: modifier<br>
* Name: regex_replace<br>
* Purpose: regular expression search/replace
*
* @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
* regex_replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string|array
* @param string|array
* @author Monte Ohrt <monte at ohrt dot com>
* @param string $string input string
* @param string|array $search regular expression(s) to search for
* @param string|array $replace string(s) that should be replaced
* @return string
*/
function smarty_modifier_regex_replace($string, $search, $replace)
{
if(is_array($search)) {
foreach($search as $idx => $s)
$search[$idx] = _smarty_regex_replace_check($s);
foreach($search as $idx => $s) {
$search[$idx] = _smarty_regex_replace_check($s);
}
} else {
$search = _smarty_regex_replace_check($search);
}
$search = _smarty_regex_replace_check($search);
}
return preg_replace($search, $replace, $string);
}
/**
* @param string $search string(s) that should be replaced
* @return string
* @ignore
*/
function _smarty_regex_replace_check($search)
{
if (($pos = strpos($search,"\0")) !== false)
$search = substr($search,0,$pos);
// null-byte injection detection
// anything behind the first null-byte is ignored
if (($pos = strpos($search,"\0")) !== false) {
$search = substr($search,0,$pos);
}
// remove eval-modifier from $search
if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
/* remove eval-modifier from $search */
$search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
}
return $search;
}
/* vim: set expandtab: */
?>
?>
@@ -2,29 +2,32 @@
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty replace modifier plugin
*
*
* Type: modifier<br>
* Name: replace<br>
* Purpose: simple search/replace
* @link http://smarty.php.net/manual/en/language.modifier.replace.php
* replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @param string
* @return string
*
* @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
* @param string $string input string
* @param string $search text to search for
* @param string $replace replacement text
* @return string
*/
function smarty_modifier_replace($string, $search, $replace)
{
if (Smarty::$_MBSTRING) {
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
return smarty_mb_str_replace($search, $replace, $string);
}
return str_replace($search, $replace, $string);
}
}
/* vim: set expandtab: */
?>
?>
@@ -2,29 +2,26 @@
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty spacify modifier plugin
*
*
* Type: modifier<br>
* Name: spacify<br>
* Purpose: add spaces between characters in a string
* @link http://smarty.php.net/manual/en/language.modifier.spacify.php
* spacify (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
*
* @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string $string input string
* @param string $spacify_char string to insert between characters.
* @return string
*/
function smarty_modifier_spacify($string, $spacify_char = ' ')
{
return implode($spacify_char,
preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY));
}
// well… what about charsets besides latin and UTF-8?
return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY));
}
/* vim: set expandtab: */
?>
?>
@@ -1,29 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty string_format modifier plugin
*
* Type: modifier<br>
* Name: string_format<br>
* Purpose: format strings via sprintf
* @link http://smarty.php.net/manual/en/language.modifier.string.format.php
* string_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @return string
*/
function smarty_modifier_string_format($string, $format)
{
return sprintf($format, $string);
}
/* vim: set expandtab: */
?>
@@ -1,33 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty strip modifier plugin
*
* Type: modifier<br>
* Name: strip<br>
* Purpose: Replace all repeated spaces, newlines, tabs
* with a single space or supplied replacement string.<br>
* Example: {$var|strip} {$var|strip:"&nbsp;"}
* Date: September 25th, 2002
* @link http://smarty.php.net/manual/en/language.modifier.strip.php
* strip (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @version 1.0
* @param string
* @param string
* @return string
*/
function smarty_modifier_strip($text, $replace = ' ')
{
return preg_replace('!\s+!', $replace, $text);
}
/* vim: set expandtab: */
?>
@@ -1,32 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty strip_tags modifier plugin
*
* Type: modifier<br>
* Name: strip_tags<br>
* Purpose: strip html tags from text
* @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
* strip_tags (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param boolean
* @return string
*/
function smarty_modifier_strip_tags($string, $replace_with_space = true)
{
if ($replace_with_space)
return preg_replace('!<[^>]*?>!', ' ', $string);
else
return strip_tags($string);
}
/* vim: set expandtab: */
?>
@@ -1,50 +1,59 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage plugins
* @subpackage PluginsModifier
*/
/**
* Smarty truncate modifier plugin
*
*
* Type: modifier<br>
* Name: truncate<br>
* Purpose: Truncate a string to a certain length if necessary,
* optionally splitting in the middle of a word, and
* appending the $etc string or inserting $etc into the middle.
* @link http://smarty.php.net/manual/en/language.modifier.truncate.php
* truncate (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param integer
* @param string
* @param boolean
* @param boolean
* @return string
* optionally splitting in the middle of a word, and
* appending the $etc string or inserting $etc into the middle.
*
* @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string $string input string
* @param integer $length length of truncated text
* @param string $etc end string
* @param boolean $break_words truncate at word boundary
* @param boolean $middle truncate in the middle of text
* @return string truncated string
*/
function smarty_modifier_truncate($string, $length = 80, $etc = '...',
$break_words = false, $middle = false)
{
function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) {
if ($length == 0)
return '';
if (strlen($string) > $length) {
$length -= min($length, strlen($etc));
if (!$break_words && !$middle) {
$string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
if (Smarty::$_MBSTRING) {
if (mb_strlen($string, Smarty::$_CHARSET) > $length) {
$length -= min($length, mb_strlen($etc, Smarty::$_CHARSET));
if (!$break_words && !$middle) {
$string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', mb_substr($string, 0, $length + 1, Smarty::$_CHARSET));
}
if (!$middle) {
return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc;
}
return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET);
}
if(!$middle) {
return substr($string, 0, $length) . $etc;
} else {
return substr($string, 0, $length/2) . $etc . substr($string, -$length/2);
}
} else {
return $string;
}
}
// no MBString fallback
if (isset($string[$length])) {
$length -= min($length, strlen($etc));
if (!$break_words && !$middle) {
$string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1));
}
if (!$middle) {
return substr($string, 0, $length) . $etc;
}
return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);
}
return $string;
}
/* vim: set expandtab: */
?>
?>
@@ -1,26 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty upper modifier plugin
*
* Type: modifier<br>
* Name: upper<br>
* Purpose: convert string to uppercase
* @link http://smarty.php.net/manual/en/language.modifier.upper.php
* upper (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return string
*/
function smarty_modifier_upper($string)
{
return strtoupper($string);
}
?>
@@ -1,29 +0,0 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty wordwrap modifier plugin
*
* Type: modifier<br>
* Name: wordwrap<br>
* Purpose: wrap a string of text at a given length
* @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
* wordwrap (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param integer
* @param string
* @param boolean
* @return string
*/
function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
{
return wordwrap($string,$length,$break,$cut);
}
?>
@@ -0,0 +1,30 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty cat modifier plugin
*
* Type: modifier<br>
* Name: cat<br>
* Date: Feb 24, 2003<br>
* Purpose: catenate a value to a variable<br>
* Input: string to catenate<br>
* Example: {$var|cat:"foo"}
*
* @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
* (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_cat($params, $compiler)
{
return '('.implode(').(', $params).')';
}
?>
@@ -0,0 +1,33 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_characters modifier plugin
*
* Type: modifier<br>
* Name: count_characteres<br>
* Purpose: count the number of characters in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_count_characters($params, $compiler)
{
if (!isset($params[1]) || $params[1] != 'true') {
return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)';
}
if (Smarty::$_MBSTRING) {
return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';
}
// no MBString fallback
return 'strlen(' . $params[0] . ')';
}
?>
@@ -0,0 +1,28 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_paragraphs modifier plugin
*
* Type: modifier<br>
* Name: count_paragraphs<br>
* Purpose: count the number of paragraphs in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_paragraphs (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_count_paragraphs($params, $compiler)
{
// count \r or \n characters
return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)';
}
?>
@@ -0,0 +1,28 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_sentences modifier plugin
*
* Type: modifier<br>
* Name: count_sentences
* Purpose: count the number of sentences in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
* count_sentences (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_count_sentences($params, $compiler)
{
// find periods, question marks, exclamation marks with a word before but not after.
return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)';
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty count_words modifier plugin
*
* Type: modifier<br>
* Name: count_words<br>
* Purpose: count the number of words in a text
*
* @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_count_words($params, $compiler)
{
if (Smarty::$_MBSTRING) {
// return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';
// expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592
return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';
}
// no MBString fallback
return 'str_word_count(' . $params[0] . ')';
}
?>
@@ -0,0 +1,35 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty default modifier plugin
*
* Type: modifier<br>
* Name: default<br>
* Purpose: designate default value for empty variables
*
* @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_default ($params, $compiler)
{
$output = $params[0];
if (!isset($params[1])) {
$params[1] = "''";
}
array_shift($params);
foreach ($params as $param) {
$output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)';
}
return $output;
}
?>
@@ -0,0 +1,125 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* @ignore
*/
require_once( SMARTY_PLUGINS_DIR .'shared.literal_compiler_param.php' );
/**
* Smarty escape modifier plugin
*
* Type: modifier<br>
* Name: escape<br>
* Purpose: escape string for output
*
* @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)
* @author Rodney Rehm
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_escape($params, $compiler)
{
static $_double_encode = null;
if ($_double_encode === null) {
$_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');
}
try {
$esc_type = smarty_literal_compiler_param($params, 1, 'html');
$char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET);
$double_encode = smarty_literal_compiler_param($params, 3, true);
if (!$char_set) {
$char_set = Smarty::$_CHARSET;
}
switch ($esc_type) {
case 'html':
if ($_double_encode) {
return 'htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true) . ')';
} else if ($double_encode) {
return 'htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ')';
} else {
// fall back to modifier.escape.php
}
case 'htmlall':
if (Smarty::$_MBSTRING) {
if ($_double_encode) {
// php >=5.2.3 - go native
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true)
. '), "HTML-ENTITIES", '
. var_export($char_set, true) . ')';
} else if ($double_encode) {
// php <5.2.3 - only handle double encoding
return 'mb_convert_encoding(htmlspecialchars('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true)
. '), "HTML-ENTITIES", '
. var_export($char_set, true) . ')';
} else {
// fall back to modifier.escape.php
}
}
// no MBString fallback
if ($_double_encode) {
// php >=5.2.3 - go native
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ', '
. var_export($double_encode, true) . ')';
} else if ($double_encode) {
// php <5.2.3 - only handle double encoding
return 'htmlentities('
. $params[0] .', ENT_QUOTES, '
. var_export($char_set, true) . ')';
} else {
// fall back to modifier.escape.php
}
case 'url':
return 'rawurlencode(' . $params[0] . ')';
case 'urlpathinfo':
return 'str_replace("%2F", "/", rawurlencode(' . $params[0] . '))';
case 'quotes':
// escape unescaped single quotes
return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[0] . ')';
case 'javascript':
// escape quotes and backslashes, newlines, etc.
return 'strtr(' . $params[0] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))';
}
} catch(SmartyException $e) {
// pass through to regular plugin fallback
}
// could not optimize |escape call, so fallback to regular plugin
if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {
$compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';
$compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape';
} else {
$compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';
$compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape';
}
return 'smarty_modifier_escape(' . join( ', ', $params ) . ')';
}
?>
@@ -0,0 +1,34 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty from_charset modifier plugin
*
* Type: modifier<br>
* Name: from_charset<br>
* Purpose: convert character encoding from $charset to internal encoding
*
* @author Rodney Rehm
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_from_charset($params, $compiler)
{
if (!Smarty::$_MBSTRING) {
// FIXME: (rodneyrehm) shouldn't this throw an error?
return $params[0];
}
if (!isset($params[1])) {
$params[1] = '"ISO-8859-1"';
}
return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')';
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty indent modifier plugin
*
* Type: modifier<br>
* Name: indent<br>
* Purpose: indent lines of text
*
* @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_indent($params, $compiler)
{
if (!isset($params[1])) {
$params[1] = 4;
}
if (!isset($params[2])) {
$params[2] = "' '";
}
return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')';
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty lower modifier plugin
*
* Type: modifier<br>
* Name: lower<br>
* Purpose: convert string to lowercase
*
* @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_lower($params, $compiler)
{
if (Smarty::$_MBSTRING) {
return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;
}
// no MBString fallback
return 'strtolower(' . $params[0] . ')';
}
?>
@@ -0,0 +1,25 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty noprint modifier plugin
*
* Type: modifier<br>
* Name: noprint<br>
* Purpose: return an empty string
*
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_noprint($params, $compiler)
{
return "''";
}
?>
@@ -0,0 +1,26 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty string_format modifier plugin
*
* Type: modifier<br>
* Name: string_format<br>
* Purpose: format strings via sprintf
*
* @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_string_format($params, $compiler)
{
return 'sprintf(' . $params[1] . ',' . $params[0] . ')';
}
?>
@@ -0,0 +1,33 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty strip modifier plugin
*
* Type: modifier<br>
* Name: strip<br>
* Purpose: Replace all repeated spaces, newlines, tabs
* with a single space or supplied replacement string.<br>
* Example: {$var|strip} {$var|strip:"&nbsp;"}<br>
* Date: September 25th, 2002
*
* @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_strip($params, $compiler)
{
if (!isset($params[1])) {
$params[1] = "' '";
}
return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})";
}
?>
@@ -0,0 +1,28 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty strip_tags modifier plugin
*
* Type: modifier<br>
* Name: strip_tags<br>
* Purpose: strip html tags from text
*
* @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)
* @author Uwe Tews
* @param array $params parameters
* @return string with compiled code
*/
function smarty_modifiercompiler_strip_tags($params, $compiler)
{
if (!isset($params[1]) || $params[1] === true || trim($params[1],'"') == 'true') {
return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
} else {
return 'strip_tags(' . $params[0] . ')';
}
}

Some files were not shown because too many files have changed in this diff Show More