# WeSQL Upgrade Path

v0.51 -> v0.52:
8. If you are using MySQL, remove the Msql-Mysql perl modules from your system, and switch to DBD-Mysql (available from CPAN). Msql-Mysql is buggy! In MySQL, execute: alter table sessiondata change value text default '' not null; In the file(s) details.cf, replace all occurencies of $key by $data{key}. I've removed this extra bit of syntactic sugar to simplify things (and to sanitize them, as it only worked in details.cf, and not in the other .cf files). In the file(s) details.cf, replace all occurencies of $Apache::WeSQL::params{...} by $params{...}. I've removed this extra bit of syntactic sugar to simplify things (and to sanitize them, as it only worked in details.cf, and not in the other .cf files). Change all occurrencies of replace:select(something) to form:select(something) in details.cf and list.cf Change all occurrencies of formfooter: to append: in details.cf, form.cf and list.cf Replace your old copies of AppHandler.pm files with new ones from this version. This is necessary for the multi-language support, and for a session-support bugfix. Update your WeSQL.pl file as follows:
       @commandlist = (
             'dolayouttags($body)',
             'dolanguages($body)',					<<<<< Add this line
             'dosubst($body,"PR_",%params)',
             'dosubst($body,"ENV_",%ENV)',
   And add this line too:
       $defaultlanguage='';
9. Change the value to something else if you have a multi-language site. In that case, set it to the language you would like to be the default. In your layout.cf file, add the following lines:
       listrowstart
       <tr>

       listrowstop
       </tr>

       listcolumnstart
       <td$align[$cnt]>

       listcolumnstop
       </td>

       listappendstart
       <tr><td colspan=$visiblecols>

       listappendnoresultsstart
       <tr><td align=center>

       formrowstart
       <tr>

       formrowstop
       </tr>

       formkeycolumnstart
       <td$alignkey>

       formvalcolumnstart
       <td$alignval>

       formcolumnstop
       </td>

       formboldstart
       <b>

       formboldstop
       </b>

       formnoresults
       <tr>
       <td colspan=2><center>No results found.</center></td>
       </tr>

       formupdatebutton
       Update

       formaddbutton
       Add

       formappendcolumnstart
       <td colspan=2 align=center>

       formtablestop
       </table>

       detailscenterstart
       <center>

       detailscenterstop
       </center>

       detailsdeletemessage
        <br>
       Are you <b>sure</b> you want to delete this entry?
       <br>

       detailskeycolumnstart
       <td$alignkey>

       detailsvalcolumnstart
       <td$alignval>

       detailscolumnstop
       </td>

       detailsboldstart
       <b>

       detailsboldstop
       </b>

       detailsappendcolumnstart
       <td colspan=2 align=center>

       detailsrowstart
       <tr>

       detailsrowstop
       </tr>
10. In your layout.cf file, update liststarttable1, liststarttable2 and liststoptable to:
        liststarttable1
        <hr width=760>
        <center>
        <table width="752" border="0" cellspacing="0" cellpadding="1">
        <tr><td bgcolor="#000000">
        <table width="750" border="0" cellspacing="2" cellpadding="1" bgcolor="#000000">
        <tr>
        <td align=left valign=top width=200>
        <a href="index.wsql">Home</a>
        </td>
        <td align=center width=350><font color="#FFFFFF"><b>

        liststarttable2
        </b></font></td>
        <td width=200 valign=top align=right><a href="viewcart.wsql">View cart</a></td>
        </tr>
        </table>
        </td></tr>
        </table>
        <center>

        <table width="752" border="0" cellspacing="0" cellpadding="1">
        <tr><td bgcolor="#000000">
        <table width="750" border="0" cellspacing="0" cellpadding="5" bgcolor="#e8e8e8">
        <tr>
        <td><table align=center cellpadding="2" cellspacing="1">
        <tr>

        liststoptable
        </table>
        </td></tr>
        </table>
        </td></tr>
        </table>
        <hr width=760>
v0.50 -> v0.51:
In your database, add (MySQL definition, see the Addressbook application for a PostgreSQL definition): create table sessions ( pkey bigint(20) unsigned not null auto_increment, id bigint(20) unsigned not null, uid bigint(20) unsigned not null, suid bigint(20) unsigned not null default '0', epoch bigint unsigned not null, status tinyint default '1' not null, hash varchar(16) default '' not null, primary key (pkey) ); And execute: alter table sessiondata change loginid sessionid bigint(20) unsigned not null; Also, don't forget to make new copies for any copies of AppHandler.pm you have made!! In the file(s) details.cf, replace all occurencies of $key by $data{key}. I've removed this extra bit of syntactic sugar to simplify things (and to sanitize them, as it only worked in details.cf, and not in the other .cf files). Make sure to add something sensible for the following keys in the layout.cf file(s): loginform1 loginform2 loginform3 These are used in the login forms. The default values are: loginform1 <tr> <td align=center valign=top> <br> <center> <form action="jlogin.wsql" method=post> <table width=400> <tr><td align=right><b>Login:</b></td><td><INPUT name="login"></td></tr> <tr><td align=right><b>Password:</b></td><td><INPUT name="passwd" type=password></td></tr> <tr><td colspan=2 align=center> loginform2 <input type="submit" value="Log in"></td></tr> loginform3 </table> </form> </td></tr> <tr> <td align=center> <b>If you get this page time and again, your browser does not support cookies.<br>Enable cookies and try again!</b> </td> </tr> </form>