Skip to content

Instantly share code, notes, and snippets.

View skrosoft's full-sized avatar

Vincent Guyard skrosoft

View GitHub Profile
@skrosoft
skrosoft / ezmultiupload-fix.php
Last active August 28, 2015 19:43
fix ezmultiupload giving the file extension name to uploaded file. This fix a webdav listing folder problem !
<?php
$items = eZPersistentObject::fetchObjectList( eZBinaryFile::definition(), null, array( ), null, null, true );
foreach ($items as $item){
$original = $item->attribute('original_filename');
$filename = $item->attribute('filename');
$original_has_extension = !(strpos($original, '.') === false);
$has_extension = !(strpos($filename, '.') === false);
{set-block scope=root variable=my_var_name}
{let selected_id_array=$attribute.content}
{section var=Options loop=$attribute.class_content.options}
{section-exclude match=$selected_id_array|contains( $Options.item.id )|not}
{$Options.item.name|wash( xhtml )}{delimiter}<br/>{/delimiter}{/section}
{/let}
{/set-block}
{set-block scope=root variable=my_var_name}{attribute_view_gui attribute=$node.data_map.myattribute}{/set-block}
process.stdin.resume();
process.stdin.setEncoding("ascii");
var input = "";
process.stdin.on("data", function (chunk) {
input += chunk;
});
process.stdin.on("end", function () {
// mi codigo
for (var i=0; i<input; i++){
function processData(input) {
var n = parseInt(input);
var number = numberToArray(n);
while(n > 1){
number = multiplyArray(number, numberToArray(n-1));
n--;
}
function processData(input) {
var is = input.split('\n');
var is1 = is[0].split(' ');
var is2 = is[1].split(' ');
var result = 10000;
var date_ret = new Date(is1[1] + '-' + is1[0] + '-' + is1[2]);
var date_max = new Date(is2[1] + '-' + is2[0] + '-' + is2[2]);
function processData(input) {
var is_pm = input.indexOf('PM') != -1;
var s = input.replace('PM', '').replace('AM', '').split(':');
if (is_pm && s[0] != '12') s[0] = parseInt(s[0]) + 12;
if (!is_pm && s[0] == '12') s[0] = '00';
process.stdout.write(s[0] + ':' + s[1] + ':' + s[2]);
}
@skrosoft
skrosoft / ezpublish_clear_users.sql
Last active October 20, 2018 16:45
Allow you to clean the eZ Publish database of users - Fully remove users with no node
-----------------
-- please first activate or remove non activated users from the administration interface /user/unactivated
-----------------
-- ezcontentobject_attribute
DELETE FROM `ezcontentobject_attribute` WHERE `contentobject_id` IN (SELECT `contentobject_id` FROM `ezuser` WHERE `contentobject_id` NOT IN (SELECT `contentobject_id` FROM `ezcontentobject_tree`));
-- ezcontentobject
@skrosoft
skrosoft / ezp_override.php
Created August 26, 2016 13:46
ezp_override example
return array(
'eZOrder' => 'extension/orderstatenotifier/classes/ezorder.php'
);
@skrosoft
skrosoft / config.php
Created August 26, 2016 13:47
EzPublish Allow Kernel Override
define( 'EZP_AUTOLOAD_ALLOW_KERNEL_OVERRIDE', true );