Yii Framework Forum: Bugs in Web3CMS 1.0.7.r6 (User) - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Bugs in Web3CMS 1.0.7.r6 (User) Rate Topic: ***** 1 Votes

#1 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 19 July 2009 - 02:44 PM

Web3CMS 1.0.7.r6 (User) is released.
It is still too far from being called 'CMS'... so, if you don't have free time, please ignore it.
Currently only Index, Contact and Login/Logout are available.
In the next version we will add user registration and hopefully backend.

Thanks, and if you find any bugs, please post it here.
1

#2 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 19 July 2009 - 04:20 PM

What are your long term goals with this?
0

#3 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 20 July 2009 - 01:43 AM

View Postpestaa, on 19 July 2009 - 04:20 PM, said:

What are your long term goals with this?

To create a content management system like joomla with a set of official (built-in) components like posts, photos, videos, forum and so on.
It should by default go with a set of themes (currently done) and at least 2 languages (multilingual).
The difference with Wordpress, Joomla, Drupal and so on - we are focusing on the CMS itself while qiang and the Yii team are taking care of the MVC Framework.

We hope to add posts/tags by date of release of Yii 1.1.0.
Thanks for your interest.
1

#4 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 20 July 2009 - 06:09 AM

I will definitely look at it. Thanks for sharing.

Please note that Yii 1.1 will not have backward compatibility, so you may end up with a lot more work if you want to put this cms into 1.0.

I also suggest you to take heavy advantage of ajax, as that is very expected in recent systems for sure. "Web3" implies that your software will also be capable of supporting facebook/twitter/delicious/linkedin/etc.
0

#5 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 20 July 2009 - 08:26 AM

Thanks for your input.
We know about backward compatibility issue. Move this CMS from Yii 1.0 to 1.1 branch should not take more than 1 week of work (probably only 2-3 days).
We will make this CMS mostly AJAX driven with native support of jquery-ui.
0

#6 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 24 August 2009 - 02:13 AM

Web3CMS 1.0.8.r7 (i18n) have been released.
We did it multilingual (currently only 2 languages).
Also expanded on User functionality (register, confirmEmail, show, update).

Start working on backend (admin). Next release should be 1 week earlier than usual (in 1 week after release of genius Yii).

Thanks for your interest!
0

#7 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 20 September 2009 - 07:34 AM

Web3CMS 1.0.9.r8 (backend) have been released.
Added backend - administrator area.
Also created User updateInterface, 1 fix and multiple improvements in the code.

Thanks for your interest!
0

#8 User is offline   Maxximus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 146
  • Joined: 24-November 08
  • Location:Spain

Posted 23 September 2009 - 07:12 AM

Hi, have had a look at Web3CMS, and see some nice ideas there. Maybe you could fill some of the Wiki pages with some additional stuff, would make a difference ;).

I would suggest that you move more text stuff to the params.php, especially all the default values (MParams component), languages.

I see you're using the backend construction to create some separation between front and back, a good choice in my opinion. Maybe you can consider this to avoid redundancy in the config files (error prone):

/backend/config/main.php:
<?php

$backend=dirname(dirname(__FILE__));
$frontend=dirname($backend);
Yii::setPathOfAlias('backend', $backend);

$frontendarray = require($frontend.'/config/main.php');

// This is the main Web application backend configuration. Any writable
// CWebApplication properties can be configured here.
$backendarray = array(
    'basePath' => $frontend,

    'controllerPath' => $backend.'/controllers',
    'viewPath' => $backend.'/views',
    'runtimePath' => $backend.'/runtime',

    // autoloading model and component classes
    'import'=>array(
        'backend.models.*',
        'backend.components.*',
        'application.models.*',
        'application.components.*',
        'application.extensions.*',
    ),

    // alternate layoutPath
    'layoutPath'=>dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'_layouts'.DIRECTORY_SEPARATOR,

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName'] and MParams class
    'params'=>require(dirname(__FILE__).'/params.php'),

    // application components
    'components'=>array(
	'urlManager'=>array(
		'urlFormat'=>'path',
		'caseSensitive'=>false,
	        'showScriptName'=>true,
		'urlSuffix'=>'.html',
		'rules'=>require(dirname(__FILE__).'/routes.php'),
	),
    ),
);

return (array_merge($frontendarray, $backendarray));


This way all the settings done in the frontend are available, and you can redefine what's nessesary for the backend.
Hope you will include your user admin in the next version soon. Besides that, it might be a good idea to start a discussion in extensions too.
0

#9 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 24 September 2009 - 10:03 AM

Hi, thanks for the reply!

I find your array_merge() idea very useful, it will be implemented in the coming release. routes.php will be implemented in the front-end as well. All is great except that array_merge() cuts off 'db' of 'components' of the front-end array, so I've had to modify this as follows:
<?php

$backend=dirname(dirname(__FILE__));
$frontend=dirname($backend);
Yii::setPathOfAlias('backend', $backend);

$frontendArray=require($frontend.'/config/main.php');

// This is the main Web application backend configuration. Any writable
// CWebApplication properties can be configured here.
$backendArray=array(
    'basePath' => $frontend,

    'controllerPath' => $backend.'/controllers',
    'viewPath' => $backend.'/views',
    'runtimePath' => $backend.'/runtime',

    // autoloading model and component classes
    'import'=>array(
        'backend.models.*',
        'backend.components.*',
        'application.models.*',
        'application.components.*',
        'application.extensions.*',
    ),

    // main is the default layout
    'layout'=>'main',
    // alternate layoutPath
    'layoutPath'=>dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'_layouts'.DIRECTORY_SEPARATOR,
    
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName'] and MParams class
    'params'=>require(dirname(__FILE__).'/params.php'),

    // application components
    'components'=>array(
        'urlManager'=>array(
            'rules'=>require(dirname(__FILE__).'/routes.php'),
        ),
    ),
);

if(!function_exists('w3_array_union_recursive'))
{
    /**
     * This function does similar work to $array1+$array2,
     * except that this union is applied recursively.
     * @param array $array1 - more important array
     * @param array $array2 - values of this array get overwritten
     * @return array
     */
    function w3_array_union_recursive($array1,$array2)
    {
        $retval=$array1+$array2;
        foreach($array1 as $key=>$value)
        {
            if(is_array($array1[$key]) && is_array($array2[$key]))
                $retval[$key]=w3_array_union_recursive($array1[$key],$array2[$key]);
        }
        return $retval;
    }
}

return w3_array_union_recursive($backendArray,$frontendArray);


Please to all: share your ideas here, we are looking to make this app more universal to fit everyone's needs.

Quote

Maybe you could fill some of the Wiki pages with some additional stuff, would make a difference ;).

I currently don't have much free time for documentation, but hope to start Wiki in October (this year ;)). We hope that someone will help us with some aspects of this project, or at least with finding bugs and bringing some better ideas, like you did, thank you.

Quote

I would suggest that you move more text stuff to the params.php, especially all the default values (MParams component), languages.

All the default values in MParams component already are in config/params.php, e.g.
const defaultLanguage='en';
in MParams is nothing more than a repeat of
'language'=>'en', //en
in params.php. The purpose of MParams default constants is to keep the app alive even if developer will do something wrong in config/params.php. Default values in MParams are fired ONLY if corresponding config in params.php is missed. The end goal is to make app working even if params.php returns an empty array ;) (this should be finished in the next release) I will try to simplify this component.

Quote

Besides that, it might be a good idea to start a discussion in extensions too.

Good idea. I like markitup as simplified editor (with different types of markup), and CKEditor as WYSIWYG editor. Also we are going to use jqGrid for grids of data. But, all pages should be 100% working with javascripts disabled.


// WORKING WITH DATES
Also, currently we are going to switch from
`createDate` DATETIME NOT NULL,
`createGmtDate` DATETIME NOT NULL,
to
`createTime` INTEGER(10) UNSIGNED NOT NULL,
The purpose of Gmt field was to convert dates from db to visitor's timezone. With time() we can still convert it to timezones (because time() in the same moment in all timezones is the same value) and using FROM_UNIXTIME(createTime) we can work with field as if it would be datetime. So, we can use 1 field instead of 2. The cost is less human readability when you look at it in phpMyAdmin.
But this approach will be applied to fields auto-filled in by app only. Those that are filled in by human will be of type DATETIME (like `startDate`,`endDate`), so it can be any date, even before Unix Epoch (January 1 1970 00:00:00 GMT)
, see http://www.yiiframew...eed-your-input/ for reference
// END WORKING WITH DATES


Please, share your thoughts.
0

#10 User is offline   Maxximus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 146
  • Joined: 24-November 08
  • Location:Spain

Posted 25 September 2009 - 08:19 AM

Ah yeah, didn't look to the deeper nested arrays, this is way better.

About the docs, I know this is one of the hard parts, but perhaps adding some sample pages would do the trick.

About the params: I would personally prefer a warning when some needed param is not set in params.php, so I don't have to go through MParams to find out what I need to change for my app (like email adresses , titles, metatags etc.). Perhaps a unified param test will save a lot of the setters/getters there.

The new dates makes sense!
0

#11 User is offline   Maxximus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 146
  • Joined: 24-November 08
  • Location:Spain

Posted 25 September 2009 - 03:54 PM

I'm using an extension class for CController myself, and I understood it was better to use:
function __construct($id,$module=null)
{
     parent::__construct($id,$module);
}

instead of init()

I also use the extension for common filter setup, and in these filters I also load the scipts and CSS files I use. Perhaps it is of any use for you.
0

#12 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 525
  • Joined: 10-October 08
  • Location:European Union

Posted 26 September 2009 - 03:05 AM

Keep up the good work ;)
Yii user #37
0

#13 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 28 September 2009 - 08:04 AM

View PostMaxximus, on 25 September 2009 - 03:54 PM, said:

I'm using an extension class for CController myself, and I understood it was better to use:
function __construct($id,$module=null)
{
     parent::__construct($id,$module);
}

instead of init()


Is __construct() a more safe way to initialize the app? As for right now, CController::init() does excellent work about app initialization and requires no params (like $id,$module)... Found at http://www.yiiframew...api/CController about init():

Quote

Initializes the controller. This method is called by the application before the controller starts to execute. You may override this method to perform the needed initialization for the controller.


Quote

I also use the extension for common filter setup, and in these filters I also load the scipts and CSS files I use. Perhaps it is of any use for you.

We currently don't have much of js and css files, but this will change soon. I thought to combine all js/css by type, e.g. all jquery plugins/scripts in css/jquery-1.3.x.plugins.css and js/jquery-1.3.x.plugins.js. Is this what you are talking about? Is there a better way than the manually merge of js & css?

In general, our current politics is to minimize use of third party applications (extensions) as our core code. Our main goal is to create an extremely secure app, so when it's possible, we will convert extensions into components (and will test it). From the point of view of a developer, using extensions or components will be of the same ease.

Also Yii Cookbook is very very useful. Thanks to the Yii Team for their great work!!
0

#14 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 525
  • Joined: 10-October 08
  • Location:European Union

Posted 03 October 2009 - 10:01 AM

I've also found this http://code.google.com/p/dotplant/ but it's GPLv3 and not BSD
Yii user #37
0

#15 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 358
  • Joined: 23-July 09

Posted 10 October 2009 - 01:48 AM

The theme select is really nice... well done!

I am curious as to why you are doing the back end as /protected/backend/ with a backend.php entry script and second config file rather than as a module?
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#16 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 10 October 2009 - 02:29 AM

View PostBackslider, on 10 October 2009 - 01:48 AM, said:

I am curious as to why you are doing the back end as /protected/backend/ with a backend.php entry script and second config file rather than as a module?

The answer is in the Yii Cookbook http://www.yiiframew...oc/cookbook/33/

We are going to release the next version very soon. Backend config in it is very optimized.

If you have a working example with backend in module, please compress it and upload here.
Is there any benefits of using module rather than in Yii Cookbook above?
0

#17 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 358
  • Joined: 23-July 09

Posted 10 October 2009 - 03:26 AM

I don't know if there are benefits, since I haven't had time to look at your backend code.

How do you go with the shell script on the backend?

Modules are very simple to create using the shell script:

module admin

exit


Then import the module in /protected/config/main.php:

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.admin.*',
	),


and:

'modules'=>array('admin'),


Then you can continue with creating models and crud:

model admin.models.Users
crud admin.models.Users


You can adjust user authentication in the admin DefaultController.php

admin is accessed using index.php?r=admin

You can have the admin use its own template by adjusting AdminModule.php:

public $layout = 'admin';


Then place the main layout file as /protected/modules/admin/views/layouts/admin.php

Thats about all there is to it.

PS. Talking about editors, I am currently using a modified Wymeditor (allows embedded Flash), which uses jQuery. This editor stops people from junking the pages with bad markup.
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#18 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 10 October 2009 - 07:15 AM

Modules is great. Yii is even better than our most expectations!

I thought to create model and crud in yiic shell the usual way (yiic shell ../index.php), then copy-paste it from protected/* to protected/backend/*
The formal release of Yii 1.1 is closer, it should have web based yiic shell, even more powerful than the current one, so I think it should be the same easy to create model&crud for "index.php", "module" and "backend.php".

Wymeditor is great (but in my opinion it would be good to have Underline and Strike Through buttons). I like it for standarts-compliant XHTML and jQuery.

Our current idea with editors is to allow for different types of markup, like wiki, markdown and so on. And if in config you allow for any type of markup, then let user decide which one to use. markItUp should be able to handle this.
The difficult part of this idea is to clean the code before save in db, and convert from selected markup to html on display. First part is hardest, especially if markup is html itself. We hope Yii will let us do this.

Why do we need a way to clean the code before save in db? Because even with Wymeditor which is cleaning the code, user can disable the javascripts and get an usual textarea, then type in any html code, even css and javascripts.
0

#19 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 10 October 2009 - 07:19 AM

View PostBackslider, on 10 October 2009 - 03:26 AM, said:

I don't know if there are benefits, since I haven't had time to look at your backend code.

How do you go with the shell script on the backend?

Modules are very simple to create using the shell script:

module admin

exit


Then import the module in /protected/config/main.php:

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.modules.admin.*',
	),


and:

'modules'=>array('admin'),


Then you can continue with creating models and crud:

model admin.models.Users
crud admin.models.Users


You can adjust user authentication in the admin DefaultController.php

admin is accessed using index.php?r=admin

You can have the admin use its own template by adjusting AdminModule.php:

public $layout = 'admin';


Then place the main layout file as /protected/modules/admin/views/layouts/admin.php

Thats about all there is to it.

PS. Talking about editors, I am currently using a modified Wymeditor (allows embedded Flash), which uses jQuery. This editor stops people from junking the pages with bad markup.


I also did my backend as a module. when you use a second entry script it's like your backend and frontend are two separate applications.
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#20 User is offline   phpdevmd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 16-April 09

Posted 12 October 2009 - 06:16 AM

Please vote on Best Rich Text Editor. Thank you.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users