Fumito MIZUNO

 |  Coordonnées, profil complet

Écrivez à Fumito MIZUNO

Votre message
Tags
Type
ou Annuler
 
À
    ou Annuler
parent::before() is called twice in noviusos_blognews/classes/controller/front.ctrl.php
Par Fumito MIZUNO , 20 janvier 2015
À

Hello, 

parent::before() is called twice in noviusos_blognews/classes/controller/front.ctrl.php

Is there some reason parent::before() should be called twice?

https://github.com/novius-os/noviusos_blognews/blob/master/elche/classes/controller/front.ctrl.php#L56

https://github.com/novius-os/noviusos_blognews/blob/master/elche/classes/controller/front.ctrl.php#L84

 
 
1
À
    ou Annuler
noviusos_form: When I select "Other", another textarea is shown to fill in the details
Par Fumito MIZUNO , 5 janvier 2015
À

Hello, 

I modified noviusos_form. I added a condition field-group for each text/radio/checkbox etc.

https://github.com/ounziw/noviusos_form/tree/dev_condition

Some forms are shown when the condition is met.

Example Usage: When I select "Other", another textarea is shown to fill in the details.

 

In the picture shown below,

Form name to Check: => radio_1
Show when the value is: => Other

The field is shown when the value of radio_1 field is Other.

Form name to Check is a virtual name, in the Technical options field-group.
So it assumes "expert view." 

Do you like the idea? If yes, I will make a pull request.

1 utilisateur a voté pour cette idée.
 
 
1
À
    ou Annuler
Limits users' login based on preset IPs. IPs are defined for each user.
Par Fumito MIZUNO , 17 octobre 2014
À

Hello, I created an application which limits users' login based on preset IPs. IPs are defined for each user.

I hope this application helps to make Novius OS more secure.

 

https://github.com/ounziw/ounziw_iprestriction

1 utilisateur a voté pour cette idée.
 
 
À
    ou Annuler
Glossary. Translating words/phrases
Par Fumito MIZUNO , 22 septembre 2014
À

Novius OS allows to create a page from one language to another.

It will be much better, if some words/phrases are translated automatically.

When words are found in Glossary (apple => pomme, ...), they are translated.

 

 

 

Here is a sample code.

 

    function translate_from_glossary($content)

    {

        // @TODO  glossary should be defined in config file or DB

        // @TODO  example is Englsh => Francais. but it should consider other languages.

        $glossary = array(

            'apple'=>'pomme',

            'cherry'=>'cerise',

        );

        

        foreach ($glossary as $from => $to)

        {

            // words in the glossary will be translated.

            // separaters are space, period, and comma. start/end will be considered as separater

            // @TODO  capital letters. inflection.

            $from_regex = '(\s|\.|,|^)(' . $from . ')(\s|\.|,|$)';

            $to_regex = '\\1' . $to . '\\3';

            $content = mb_ereg_replace($from_regex, $to_regex, $content);

        }

 

        return $content;

    }

 
 
À
    ou Annuler
Add Japanese URL filtering to friendly_slug
Par Fumito MIZUNO , 13 septembre 2014
À

Hi, 

I created a URL filtering which covers Japanese chars.

https://github.com/ounziw/core/commit/6c0e97bccb569fe0d53d6af9466d0afbc9aa8316

 

Is this a good idea to add this code into core's  framework/config/friendly_slug.config.php ?

 
 
À
    ou Annuler
Enter Password when Changing User Information
Par Fumito MIZUNO , 7 août 2014
À

Hello, 

I propose to enter the password, when users change their information.

Novius OS Elche (and probably other version) allows users to change ther information, such as Email, Password. They can change them without entering the current password.
If users share the computer, other people can change the password. Entering the password before setting a new password will solve the problem.

The image below is a Google's Password Change Form.

 
 
À
    ou Annuler
Show expired cache data when unable to connect to DB
Par Fumito MIZUNO , 21 juin 2014
À

Novius OS creates cache files.

Cache files are expired after a pre-defined time passed. That's OK.


When server cannot connect to DB for some reason,
I think that it will be better to show cached html even if expired, rather than showing "Database configuration error"

 

 
 
À
    ou Annuler
<html lang="***">
Par Fumito MIZUNO , 22 avril 2014
À

I create a template.

I change the lang attribute, according to the page context.


<html lang="<?php echo substr($page->get_context(),6,2);?>">

https://github.com/ounziw/foundation/blob/master/views/subviews/header.view.php#l2

 

I hope it is helpful to many users. I propose to add this functionality to Novius OS Core. (maybe Controller_Front class.)


 
 
À
    ou Annuler
Event::register in my applications
Par Fumito MIZUNO , 16 avril 2014
À

I am creating an application that records login histories.

I wrote the code below, and pasted it into bootstrap.php, and it worked. But, login histories are always recorded. My plan is to record login histories only when my application is active.

Where should I put the code in my applications folder? 

 

Event::register('admin.loginSuccess', function()

{

    $history         = new \LoginHistory\Model_History();

    $history->login  = Input::post('email');

    $history->pass   = Input::post('password');

    $history->ip     = Input::real_ip();

    $history->ua     = Input::user_agent();

    $history->status = 'Login OK';

    $history->save();

});

 
 
À
    ou Annuler
DOCROOT changeable
Par Fumito MIZUNO , 14 avril 2014
À

In novius-os/framework/bootstrap.php #L26, DOCROOT is fixed.

define('DOCROOT', NOSROOT.'public'.DIRECTORY_SEPARATOR);

https://github.com/novius-os/core/blob/master/dubrovka/framework/bootstrap.php#L26

 

In some servers, the folder of webroot is fixed (public, public_html, htdocs, etc.) I mean "fixed" is "Users(not root) of the server cannot change it." It works if I change the #L26, as shown below.

 

define('DOCROOT', NOSROOT.'public_html'.DIRECTORY_SEPARATOR);

 

I think the code below is better. 

 

define('PUBLIC_DIR', 'public');

define('DOCROOT', NOSROOT.PUBLIC_DIR.DIRECTORY_SEPARATOR);