Author Topic: Release of 1.4.0  (Read 1186 times)

Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 232
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Release of 1.4.0
« on: December 06, 2009, 11:11:06 PM »
Hey all!

As some might know, CCMS 1.4 has been out for a couple of days already. I decided to keep relatively quiet about it, to see whether bugs and glitches would come up, before announcing the new release. None have - I haven't heard any critic yet. Although no critic worries me just a little, I currently have to focus on other projects I have lying around.

First things first: these are new core features in release 1.4.0...

    * Support for custom modules
    * New easy to use templating engine
    * Support for multi-lingual front-ends
    * Back-up feature to safeguard contents
    * Code editor for delicate programming
    * Optimized for speed and usability
    * Scores 96 on Yahoo's YSlow 2.0 guidelines (!)
    * Enhanced security (Digest)
    * Comes with default lightbox and guestbook modules

I decided that I had to make some significant changes to the way templating works to keep coding and design more separated. As of now you have to design your templates and put them in ./lib/templates/. The administration will read this directory and offer you the possibility to specify a unique theme to each page. This will be put to best use in combination with multi lingual sites (uk templates versus es template) or sites with categories. Another new important aspect is the option for modules. You can now easily create your own module that integrates well with the overall CCMS framework. Keeping all in one place.

Although not clear where this project will head to from this point on, hopefully I've been able to create an even better product for you to use with your site.

I'd love to hear any feedback, questions and/or comments you might have.

Let's stay in touch!

Cheers,
Xander.
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #1 on: December 07, 2009, 04:49:35 AM »
Hi Xander,

the file /lib/engine.inc.php begins with:

Code: [Select]
<?
/* ***

but fails on my windows/apache system. Replace with the following fixes it:

Code: [Select]
<?php
/* ***

I look forward to checking out the new features! I don't look forward to migrating my shop module into the new release! :(

PS. A file in the root directory called "readme.txt" which outlines how to install will be helpful for some...

Chris

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #2 on: December 07, 2009, 04:55:41 AM »
A couple bugs with the fresh install..

The guestbook shows this:

Code: [Select]
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ccms\content\guestbook.php on line 45
No posts yet!

... and the admin area renders "Edit" links like this:

Code: [Select]
?file=home&action=edit&restrict=N" onclick="return hs.htmlExpand(this,{objectType:'iframe',preserveContent:false,contentId:'home_ccms'})" class="sprite edit" id="home">Edit

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #3 on: December 07, 2009, 09:16:27 AM »
Well ok. On another test PC the opening php tag doesn't cause any issues and neither does the Edit link in the admin area. The guestbook still shows the same error though.

No doubt a php version / configuration issue.

Chris.

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #4 on: December 07, 2009, 09:43:13 AM »
Hi Xander,

there is one change I really think you have to get into the code: launch tinyMCE using relative URLs.

The problem is - you create a site on your local PC, you then move it onto your webhost - all the links and images break because the absolute URL was saved in the content.

Here is how to fix it:

in /admin/editor.php, about line 90, there is a function call which begins:

Code: [Select]
tinyMCE.init(
Find the argument:

Code: [Select]
relative_urls:false
and replace it with:

Code: [Select]
relative_urls:true,convert_urls:false
(This updates the value for relative_urls and adds one new argument, "convert_urls".

Chris.


youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #5 on: December 07, 2009, 10:10:38 AM »
A few more bits of feedback.

The file /lib/modules/modname/module.txt is read in order to get the name to display in the dropdown list in the admin area. The php function "file" is used, but the documentation says this retains the newline character at the end.

This results in HTML which looks like this:

Code: [Select]
<optgroup label="Additions">
<option value="Guestbook Test
">Guestbook Test
</option>
<option value="Lightbox
">Lightbox
</option>
</optgroup>

Rather than introducing a new syntax for the module.txt file, why not have a config file with some standard variables, for example, for storing the module's name?

The other bit of feedback, is that the "content item" for modules contains a significant amount of code. The presentation layer is not cleanly separated from the code logic. I can see why it's done this way though - it means all modules can implement the same files (frontend, backend) and "work in the same way". But it also means you can't get a web designer who knows HTML and CSS to implement a template (or set of templates) for your module unless they really know what they're doing with the php.

More thoughts to come..

Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 232
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Re: Release of 1.4.0
« Reply #6 on: December 07, 2009, 01:45:21 PM »
Hi Chris,

Thanks for the extensive feedback!

I've just uploaded a new archive of CompactCMS.zip (without further announcement).

Quote
[...] and the admin area renders "Edit" links like this
[...] but fails on my windows/apache system. Replace with the following fixes it


You are absolutely right about the incomplete '<?' tags. I'm used to using these instead of <?php, but earlier I already learnt that not all servers support short tags by default. So I converted them all, but with the new functions I fell back to my old habbit every now and then. And no one to correct me before the release.... You shouldn't need a short open tag no longer, but just in case you would like to change this on your local configuration: open up php.ini and set short_open_tag = On. As general indication:


// Officially
<?php echo "Hello world"?>

// Could also be (what I'm used to)
<?="Hello world"?>


Quote
Warning: mysql_num_rows(): supplied argument is not a valid MySQLresult resource in C:\Program Files\Apache SoftwareFoundation\Apache2.2\htdocs\ccms\content\guestbook.php on line 45


This is an actual bug. I forgot to set the $link as a globar variable for the ccmsContent() function. So although $link was set in sitemap.php, in some server configuration this variable then does not pass through to the content. It did on my local installation and remote host, but I'm actually suprised about this.. Cause it should not have gotten through.

Now that the $link variable is global, you should be able to use it everywhere. Thus making it a valid resource, thus not throwing the error you specified. If it doesn't work try changing (which I should have added originally already  :-[):


$result 
mysql_query("SELECT * FROM `ccms_guestbook` ORDER BY `gb_id` DESC");

// to

$result mysql_query("SELECT * FROM `ccms_guestbook` ORDER BY `gb_id` DESC"$link);


Quote
there is one change I really think you have to get into the code: launch tinyMCE using relative URLs.


I've done this. I haven't been able to test it myself, but I trust that you have :).

---

And that's it in regard to the quick fixes. Anyone now downloading the archive will have these by default. Others might read this post and try redownloading the latest built. Easiest is to use the SVN repository for an automatic update of the installation.

The whole module bit is something I've just worked on with my own subjectivity biasing the process :). To me this is the easiest way of working, but realized this is just an initial step towards a better overall product.

I don't really agree that the coding and designing is too intertwined. It is for sure in the back-end, but that shouldn't be a problem, since everyone working on a module is php-savvy. The front-end is completely free. I agree that the current two modules are very static, but it doesn't have to be. You could very easily just put your lay-out in a div with some id's and have the actual end-user use CSS to style those divs.

For example one could do this to show a result in the front-end:

<div id="result">
   <?php echo $row['result']; ?>
</div>

Any designer is now completely free to use CSS to style this result div.

It really depends on the developer of the module how flexible the front-end will be. You could even add a configuration to the back-end specifying the number of column in a product overview table. Also see the default structure archive.

What I do agree on is the module.txt option. I think you are right that this isn't the best way to do this. I haven't changed anything yet, because it does work, but is bound to cause trouble later on. Once we've got more experience with the development of 3rd party modules I'll start working on optimizing this. This could very well include a change to a single PHP file (module-config.inc.php) with variables ($ccms['mod']['MOD_NAME']['VAR']) that also allows the developer to have users customize behaviour.

Something to look forward to ;). If you run into anything else it goes without saying you should let me know :)! Hopefully I've been able to fix most of the initial "glitches" to your (and anyones) liking.

Cheers!
Xander.
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #7 on: December 10, 2009, 02:17:12 AM »
Thanks Xander,

I haven't downloaded the latest yet.

Regarding the "invalid resource". The only problem was I didn't have the database table for the guestbook. I found the SQL separately though and ran it, which removed that error.

I look forward to relative URLs in content!! :D

Chris.

youcantryreachingme

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +1/-0
    • View Profile
Re: Release of 1.4.0
« Reply #8 on: December 11, 2009, 02:58:09 PM »
Hi Xander,

a new issue.. you can't preview pages which are not live. The preview fails when you save changes (although the changes are saved), and obviously you can't preview through the front end. Maybe put an additional check on page rendering where if the page is hidden but the admin user is logged in, display the page but with a red bar at the top saying "this page is currently hidden". (Anyone else who is not logged in should get the 403 message).

I also received an error regarding rendering of the 403 page - something about the equals symbol, although I haven't sought to debug it yet. I think I fixed this once in an older version too.

Lastly, you have a redirection for bugs to the Google website. Do many people use that? As a system user I prefer the forums because it means you have one place to search for all discussion on every issue. I don't know as a developer though whether it really would be better to manage the bugs through Google's site. (Separately I have just finished developing an add-on module for the open source project management tool dotproject which can be used to manage bugs - but that's another conversation!)

Chris.


Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 232
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Re: Release of 1.4.0
« Reply #9 on: December 20, 2009, 04:19:06 PM »
Hi Chris,

I fixed the glitch you indicated. The preview after saving is now always shown (with a notification that its publication status is disabled if it is) and in regard to the front-end I've taken up a new variable in the configuration ($cfg['authcode']). Whenever the querystring ?preview=X (where X should be equal to $cfg['authcode']) it shows the contents no matter what the status. All links from the back-end to the front-end include this querystring by default and when the status is actually disabled, it will show a notification.

I've added the authcode, because I realized that simply doing ?preview=1 could enable anyone with CCMS knowledge to bypass this. An authcode is unique and personal. I could not combine this with the authorization (of logged-in), because not everyone uses the authentication that comes with CompactCMS. Some firm I know uses CCMS only for intranet and has disabled authentication all together. This would then cause this system not to function. The authcode could also be used for other purposes (verify ownership e.g.).

Finally: I like structuring bugs and glitches. A sort of todo list of what should be done with what priority. Instead of forum posts which can become very long, a tool like Googles can help to keep it short and to the point. However: it is currently not of much use, because most bugs and requests come through either forum or e-mail. I think I'll keep it just in case one day multiple developers are working on the same bit of code or when multiple reports come in each day. Currently I admit, it's not of much value, but users aren't using it anyway :)..

Cheers!
Xander.

P.s.: Just uploaded revision 9 on Google SVN with latest changes. YSlow score is now 99 (:D)
« Last Edit: December 20, 2009, 04:25:41 PM by Xander »
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!