9.1.2.8 (also applicable to 9.2.x)
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCVS Info
Author Message
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3678
Location: Melbourne, AU

PostPost subject: 9.1.2.8 (also applicable to 9.2.x)
Posted: Sun Sep 02, 2007 2:23 pm
Reply with quote

Be warned, it will break all themes and very few modules.

Below there are infos and all instructions about upgrading your themes and modules, very small changes but required.
PHP:
# CVS is now at the revision number 9.1.2.8
P3P editor wrote:
  • will be found in admin -> main settings
Classes wrote:
    blocks.php
  • A new Block class have been written to replace many functions found in includes/functions/display.php.
  • It fixes few minor bug always present since 9.0.6.1.
  • It is suppose to speed up the blocks display process.
    menu.php
  • A new Menu static class have been created to reduce I/O disk access by saving images paths in the visitor Session and it does reduce, site-wide, generation page time. A cached version will probably come later on.
    rss.php
  • Have a new public function format()
Deprecated functions wrote:
  • MEMBER_BLOCK, themesidebox(), themecenterbox(), blocks(), rss_content(), blocks_visible(), render_blocks(), blockfileinc(), headlines(), userblock() and hideblock() are now deprecated.
  • By activating CPG_DEBUG (a must in this case) will link old functions to the new class and appropriate warnings will shows up in the footer.

Themes changes wrote:
PHP:
<?php
# add to themeheader() and themefooter() globals
$Blocks

# replace
blocks_visible('l/r');
# with
$Blocks->l;
$Blocks->r;

# replace
hideblock('N');
# with
$Blocks->hideblock('N');

# replace
blocks('left/right/center/down')
# with
$Blocks->display('l');
$Blocks->display('r');
$Blocks->display('c');
$Blocks->display('d');

/*
Make sure your theme/templates/block.html works properly since it will be now finally used by $Block->preview() in admin -> blocks and wherever a developer wants to display a preview of a block.
*/

# header.html, footer.html and blocks.html add minus/plus image file extension like
src="{leftblock.S_IMAGE}.gif"


Modules changes wrote:
PHP:
/*
Only if your module use MEMBER_BLOCK or you as developer want to add a user custom "tools" block like Your_Account and Coppermine does.
*/
$block = array(
'bid' = 10000,
'view' = 1, # 0 all, 1 user, 2 admin, 3 admins, >3 bbgroups
'side' => 'l', # l, r, c, d
'title' => _MULTILANG_ALLOWED,
'content' => 'a string or a callback function()'
);
$Blocks->custom($block);
# just free up some memory
$block = NULL;

Templates files wrote:
  • themes/default/admin/settings.html

I'll invite all module developers to use install/sql/tables/ and install/sql/data/ standards for future developments.
9.1.2.8 core support already this and will be soon the new install way. An example is found in cvs/modules/Blogs/

Why?
In case that users wants to upgrade DragonflyCMS and any 3rd party modules on the same time it will be then possible.
Also the module installer will be able to 'clearly' use all db_check functions/converters ... eg if you add a new fields you only need to add the field to the table structure, change version number to your module and db_check will do the rest.

Another example is if you want to convert a varchar field that contains IPs to a varbinary field type. Just change the field type in the module table structure and db_check will think to make the conversion possible in all DragonflyCMS supported databases.

In other words will make your module install/upgrade compatible with all supported databases.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()


Last edited by NanoCaiordo on Fri Sep 14, 2007 3:57 pm; edited 3 times in total
Back to top
View user's profile Visit poster's website
BrokenCrust
500+ Posts Club


Joined: Sep 06, 2004
Posts: 503

PostPost subject: Re: 9.1.2.8
Posted: Sun Sep 02, 2007 3:46 pm
Reply with quote

Quote:
I'll invite all module developers to use install/sql/tables/ and install/sql/data/ standards for future developments.
9.1.2.8 core support already this and will be soon the new install way. An example is found in cvs/modules/Blogs/

Can you expand on this with a bit more detail? The blogs example isn't totally clear.


BrokenCrust's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.17/5.0.91/5.2.16/9.2.1
Back to top
View user's profile
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3678
Location: Melbourne, AU

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 12:42 am
Reply with quote

I do always promise my self to update our SDR ...

For example the cvs Blogs path includes an sql directory.
The sql directory includes cpg_inst.php and Blogs.inc.

cpg_inst.php works almost like the current way.
Use ModuleName class, use ModuleName constructor and updated all $var(iables) with your infos.

install() can be left empty (as it is in Blogs): when installing a module the core will look for Blogs.inc, read $tables data, tables $indexes and tables $records and any SQL query will be MySQL4 / 5 (even if running in strict mode), PostgreSQL 7 / 8 compatible.

unistall() just copy and past.

upgrade(), thats the nice part: still works as the old way by using $this->version to compare. But if you only want to add new fields or change field type, then you only need to update Blogs.inc and $version in your cpg_inst.php. The installer will convert the data, if needed, taking care of database compatibility or add the new fields.

Hypothetically if a new DragonflyCMS version will break some module compatibility the user then will need to 'disable' every module, upgrade DragoflyMCS, upgrade every module and then 'activate' them.

In future Users might activate the Maintenance mode, upload new core and new modules, upgrade the core and the core it self will automatically upgrade, if needed, any modules using the new tables data structure and 'disable?' it.

However every DragonflyCMS upgrade, even if the module doesn't need to be upgraded, the installer will still "check" the module table structure for integrity.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
scetter
Nice poster


Joined: Oct 12, 2005
Posts: 124

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 1:28 am
Reply with quote

So what you are saying is we need to include an sql directory with Modname.inc and cpg_inst.php so whenever DF is upgraded it can also check the modules table structures? Or is this just for module upgrading?

Is there going to be more details on this put in the Docs?

_________________
Skpdev.com
HundredProofHosting.com

scetter's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.6.18.1/4.1.22/4.4.7/9.1.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3678
Location: Melbourne, AU

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 2:09 am
Reply with quote

Tables structure will be checked in both cases. This is why if you alter Modname.inc table structure you do not need to specify any query at all. The installer will performs all query by comparing whats on the database and what is specified in Module.inc.

Yes more details will be avail in our SDR including all "compare" options.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3678
Location: Melbourne, AU

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 4:14 am
Reply with quote

However i need to add that modules install/uninstall/upgrade is still backward compatible.
_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
Phoenix
Site Admin


Joined: Apr 19, 2004
Posts: 8729
Location: Netizen

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 12:36 pm
Reply with quote

Confirmed - existing modules/blocks work just fine.

Theme modifications are trivial.

Congratz Smile


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Beldak
Nice poster


Joined: Jun 15, 2005
Posts: 78
Location: Edwards AFB, CA

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 7:00 pm
Reply with quote

How do you pull in the blockid (bid) with this new method?

Before, in a block, $bid would be passed into each block and you could run db queries off of the $bid variable.


Beldak's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux 2.4.32 / Apache 1.3.37 / MySQL 5.0.16 / PHP 5.2.2 / Dragonfly CVS
Back to top
View user's profile Visit poster's website
darkgrue
Developer


Joined: Apr 20, 2004
Posts: 536
Location: Lancaster, CA

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 8:30 pm
Reply with quote

Quote:
Fatal error: Call to undefined function blocks_visible() in /usr/local/apache2/htdocs.tcf/themes/PH2_Blue/theme.php on line 57

The change is blocks as implemented doesn't appear to be theme backward-compatible?

_________________
It is pitch black. You are likely to be eaten by a grue.

darkgrue's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu 11.04, Atom D525/Apache 2.2.17/MySQL 5.1.54/PHP 5.3.5/Dragonfly 10.0.04 CVS
Back to top
View user's profile Visit poster's website
Dizfunkshunal
Platinum Supporter


Joined: Mar 23, 2006
Posts: 2079

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 9:07 pm
Reply with quote

change

Code:
 if (blocks_visible('l')) {

to

Code:
 if ($Blocks->l) {

_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
Back to top
View user's profile Send e-mail Visit poster's website Yahoo Messenger
darkgrue
Developer


Joined: Apr 20, 2004
Posts: 536
Location: Lancaster, CA

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 9:57 pm
Reply with quote

Dizfunkshunal wrote:
change

Code:
 if (blocks_visible('l')) {

to

Code:
 if ($Blocks->l) {

No, I understood that, and I got the theme in question fixed for those changes. But this change means that all themes would have to be updated for 9.1.2.8?

darkgrue wrote:
I also note that there's a lot of "standard" stuff that's not working now...

Quote:
Fatal error: Call to undefined function themesidebox() in /usr/local/apache2/htdocs.tcf/modules/Your_Account/functions.php on line 139

Looks like themesidebox() was removed too early before all the changes were propagated into affected core modules?

EDIT: My mistake, I apparently somehow missed updating those files. Embarassed

Quote:
CMS Warning line 171: block-Today_in_History.php
There appears to be a problem with this block

I'm guessing that the new block class doesn't yet handle blocks that are intended to return no content and "self-hide" like Today in History does in the same way the old system did?

Doesn't really feel like a minor point release, there's a lot that changing in terms of fundamental assumptions about the operation of the system. Breaking theme compatibility isn't a minor point release, I'd think?

_________________
It is pitch black. You are likely to be eaten by a grue.

darkgrue's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu 11.04, Atom D525/Apache 2.2.17/MySQL 5.1.54/PHP 5.3.5/Dragonfly 10.0.04 CVS


Last edited by darkgrue on Mon Sep 03, 2007 10:44 pm; edited 2 times in total
Back to top
View user's profile Visit poster's website
Dizfunkshunal
Platinum Supporter


Joined: Mar 23, 2006
Posts: 2079

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 10:17 pm
Reply with quote

out of my league lol sorry
_________________
Diz Web Design Status: Open (Use of resources requires registration.)

Dizfunkshunal's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Multiple Setups
Back to top
View user's profile Send e-mail Visit poster's website Yahoo Messenger
Phoenix
Site Admin


Joined: Apr 19, 2004
Posts: 8729
Location: Netizen

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 11:02 pm
Reply with quote

darkgrue wrote:
Quote:
CMS Warning line 171: block-Today_in_History.php
There appears to be a problem with this block

I'm guessing that the new block class doesn't yet handle blocks that are intended to return no content and "self-hide" like Today in History does in the same way the old system did?
Confirmed - it still provides the no entries message but the extra error needs fixing.
Quote:
blocks/block-Today_in_History.php

* CMS Notice line 35: There are no entries for today
@darkgrue - it's only a 1 point version change in cvs - public release version will be different.


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
darkgrue
Developer


Joined: Apr 20, 2004
Posts: 536
Location: Lancaster, CA

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 11:06 pm
Reply with quote

Phoenix wrote:
darkgrue - it's only a 1 point version change in cvs - public release version will be different.

Ah, no sweat. Just didn't anticipate the changes would be so sweeping this time around. Was a little traumatic. Very Happy

_________________
It is pitch black. You are likely to be eaten by a grue.

darkgrue's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Ubuntu 11.04, Atom D525/Apache 2.2.17/MySQL 5.1.54/PHP 5.3.5/Dragonfly 10.0.04 CVS
Back to top
View user's profile Visit poster's website
Phoenix
Site Admin


Joined: Apr 19, 2004
Posts: 8729
Location: Netizen

PostPost subject: Re: 9.1.2.8
Posted: Mon Sep 03, 2007 11:35 pm
Reply with quote

Laughing can't make gourmet omelettes without breaking eggs.

The themes Mountain Rush and Fiblack3d are now updated for release v9.1.2.1 and CVS v9.1.2.8+ in the Themes cvs area and are also available in the Downloads system.


Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexCVS Info All times are GMT
Go to page 1, 2, 3, 4  Next
Page 1 of 4


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.713 seconds with 19 DB Queries in 0.1632 seconds
Memory Usage: 3.05 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy