Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS
#61

[eluser]sshz[/eluser]
Phil, url_title() and humanize() are lacking non-english character support, so my news with "Весеннее предложение" title end up with http://localhost/pyrocms/news/-.html url.
#62

[eluser]sshz[/eluser]
fatdog, strange that you have this issues, pyrocms works fine with "out of the box" XAMMP installation.
#63

[eluser]Phil Sturgeon[/eluser]
I noticed an issue with assets loading using Windows (XAMPP) when the folder was outside of the directory root. That has now been fixed.

I have just pushed that to master (means the new files are uploaded ;-)), along with the broken link found by Yorick Peterse.
#64

[eluser]NightLion[/eluser]
hi, i'm from brazil, yesterday i'v downloaded ur system, and i played it a several minutes.

then i saw few improvements that could be done, the principal:

E.g: i have a website with a blog, then i have some people responsable to write on that blog, then i'v created a role to them, but, they need the url of the news admin to create posts, then i've made a function that verifies whats modules admin that role can access. then it shows on cpanel only the modules that they have access.
(unfortunately, i had to disable the module cache ;/ )

in User_lib.php:
Code:
function check_admin_access()
    {
        if (isset($this->user_data->role))
        {
            return (bool)$this->CI->users_m->getAdminAccess($this->user_data->role);
        }
        else
        {
            return FALSE;
        }
    }

in User_m.php
Code:
function getAdminAccess($role = 'user', $module = NULL)
    {
        $query = $this->db->getwhere('permission_roles', array('abbrev'=>$role));
        $row = $query->row();
        $role_id = $row->id;
        $this->db->where('permission_role_id',$role_id);
        $this->db->where('controller','admin');
        $this->db->where('method','*');
        if ($module)
            $this->db->where('module',$module);
        return $this->db->get('permission_rules')->num_rows();
    }

inside of getModules function in modules_m.php:
Code:
if (($this->users_m->getAdminAccess($this->user_lib->user_data->role, basename($module_name))) or ($this->user_lib->user_data->role == "admin"))
{
$modules[] = $module;
}

inside of the theme with the link with the Admin panel:
Code:
<? if( $this->user_lib->check_admin_access() ): ?>
| <?=anchor('admin', 'Admin Panel', 'target="_blank"'); ?>
<? endif; ?>

put if u want in PyroCMS, i dont know if u think useful, but i did.

Hugs from Brazil Big Grin

edit:I think its better create a forum/site/whatever to PyroCMS, then the "community" can help developing modules, fixing bugs, developing funcions, etc.
edit2:An improvement that could be done too it's a system of blocks, u said that u'll allow theme changes inside of the cpanel, then could be done a module to manage blocks of news/pool/whatever Big Grin
#65

[eluser]Phil Sturgeon[/eluser]
[quote author="NightLion" date="1241410789"]An improvement that could be done too it's a system of blocks, u said that u'll allow theme changes inside of the cpanel, then could be done a module to manage blocks of news/pool/whatever Big Grin[/quote]

Got a ticket for that but the system is still not fully planned out in my head. Not 100% on how it would work, but have an idea.

As for only showing available modules, that is a great idea. It was originally pulled based on files as I have been trying to keep the CMS almost "plug n play" with its module content. I will have to see how I can keep that with your new suggestion. I just added a new ticket to take care of this suggestion.
#66

[eluser]sshz[/eluser]
Phil, I can post here an updated url_title() function with non-english characters support if you want to. Fully working with cyrillic letters.
#67

[eluser]Phil Sturgeon[/eluser]
[quote author="sshz" date="1241454687"]Phil, I can post here an updated url_title() function with non-english characters support if you want to. Fully working with cyrillic letters.[/quote]

Sure thing, pastebin them over and I will add them into MY_url_helper.php. Thanks for the fix.
#68

[eluser]sshz[/eluser]
url_title() function with non-english characters support

Code:
if ( ! function_exists('url_title'))
{
    function url_title($str, $separator = 'dash', $lowercase = FALSE)
    {
        if ($separator == 'dash')
        {
            $search        = '_';
            $replace    = '-';
        }
        else
        {
            $search        = '-';
            $replace    = '_';
        }

        $trans = array(
                        '&\#\d+?;'                => '',
                        '&\S+?;'                => '',
                        '\s+'                    => $replace,
                        '[^a-zАБВГҐДЕЄЁЖЗИІЫЇЙКЛМНОПРСТУФХЦЧШЩЮЯЬЪабвгґдеєёжзиіыїйклмнопрстуфхцчшщюяьъ0-9\-\._]'        => '',
                        $replace.'+'            => $replace,
                        $replace.'$'            => $replace,
                        '^'.$replace            => $replace,
                        '\.+$'                    => ''
                      );

        $str = strip_tags($str);

        foreach ($trans as $key => $val)
        {
            $str = preg_replace("#".$key."#i", $val, $str);
        }

        if ($lowercase === TRUE)
        {
            $str = mb_convert_case($str, MB_CASE_LOWER, "UTF-8");
        }
        
        return trim(stripslashes($str));
    }
}
#69

[eluser]Référencement Google[/eluser]
This is probably neater and should work also with all chars (at least all latin chars) :

Code:
function url_title($str, $separator = 'dash')
    {
        $separator = ($separator == 'underscore') ? '_' : '-';
        $str = strtolower(htmlentities($str, ENT_COMPAT, 'UTF-8'));
        $str = preg_replace('/&(.)(acute|cedil|circ|grave|ring|tilde|uml);/', "$1", $str);
        $str = preg_replace('/([^a-z0-9]+)/', $separator, html_entity_decode($str, ENT_COMPAT, 'UTF-8'));
        $str = trim($str, $separator);
        return $str;
    }
#70

[eluser]Référencement Google[/eluser]
And if that can help, it's taken from Wordpress: http://toopixel.pastebin.com/f22711806




Theme © iAndrew 2016 - Forum software by © MyBB