Welcome Guest, Not a member yet? Register   Sign In
BackendPro 0.6.1
#51

[eluser]adamp1[/eluser]
@CARP: The issue you found has now been fixed. I have not released a new version yet since I need to fix some other things, but for a temp fix until the next release just save the following over what's already in system/application/models/base_model.php

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* BackendPro
*
* A website backend system for developers for PHP 4.3.2 or newer
*
* @package     BackendPro
* @author        Adam Price
* @copyright    Copyright (c) 2008
* @license        http://www.gnu.org/licenses/lgpl.html
* @tutorial    BackendPro.pkg
*/

// ---------------------------------------------------------------------------

/**
* Base_model
*
* Sets up basic model functions. All user created model classes should
* extend this to gain access to its basic database model functions.
*
* @package            BackendPro
* @subpackage        Models
*/
    class Base_model extends Model
    {          
        /**
         * Constructor
         */
        function Base_model()
        {
            // Inherit from parent class
            parent::Model();

            // Create empty function array
            $this->_TABLES = array();

            log_message('debug','Base_model Class Initialized');
        }

        /**
         * Fetch
         *
         * Fetch table rows from table related to $name. Check no custom
         * fetch method exists before hand.
         *
         * @access public
         * @param string $name Table Name
         * @param mixed $fields Fields to return from table
         * @param array $limit Rows to limit search to
         * @param mixed $where Return rows that match this
         * @return Query Object
         */
        function fetch($name, $fields=null, $limit=null, $where=null)
        {
            $func = '_fetch_'.$name;
            if(method_exists($this,$func))
            {
                // There is an overide function
                return call_user_func_array(array($this,$func), array($fields,$limit,$where));
            }
            else
            {
                // No override function, procede with fetch
                ($fields!=null) ? $this->db->select($fields) : '';
                ($where!=null) ? $this->db->where($where) : '';
                ($limit!=null) ? $this->db->limit($limit['rows'],$limit['offset']) : '';

                return $this->db->get($this->_TABLES[$name]);
            }
        }

        /**
         * Insert
         *
         * Insert new table data into table related to by $name
         * Check no custom insert method exists before hand.
         *
         * @access public
         * @param string $name Table Name
         * @param array $data Data to insert
         * @return Query Object
         */
        function insert($name, $data)
        {
            $func = '_insert_' . $name;
            if(method_exists($this,$func))
            {
                // There is an overide function
                return call_user_func_array(array($this,$func), array($data));  
            }
            else
            {
                // No override function, procede with insert
                return $this->db->insert($this->_TABLES[$name],$data);
            }
        }

        /**
         * Update
         *
         * Update data in table related to by $name
         * Check no custom update method exists before hand.
         *
         * @access public
         * @param string $name Table Name
         * @param array $values Data to change
         * @param mixed $where Rows to update
         * @return Query Object
         */
        function update($name, $values, $where)
        {
            $func = '_update_' . $name;
            if(method_exists($this,$func))
            {
                // There is an overide function
                return call_user_func_array(array($this,$func), array($values,$where));  
            }
            else
            {
                // No overside function, procede with general insert
                $this->db->where($where);
                return $this->db->update($this->_TABLES[$name],$values);
            }
        }

        /**
         * Delete
         *
         * Delete rows from table related to by $name
         * Check no custom delete method exists before hand.
         *
         * @access public
         * @param string $name Table Name
         * @param mixed $where Rows to delete
         * @return Query Object
         */
        function delete($name, $where)
        {            
            $func = '_delete_' . $name;
            if(method_exists($this, $func))
            {
                // There is an overide function
                return call_user_func_array(array($this,$func), array($where));    
            }
            else
            {
                // No overside function, procede with general insert
                $this->db->where($where);
                return $this->db->delete($this->_TABLES[$name]);
            }
        }
    }
?>

Can you let me know if this solves the problem.
#52

[eluser]Unknown[/eluser]
Hi Adam.
Interesting project. I ran in to some problems installing, though.
The Installation routine broke the first time I tried to install, because it couldnt locate the recaptcha directory for writing config file. After duplicating the modules directory from inside the system directory to the root htdocs folder the installation script succeeded.

Now, when trying to go to the login page, the following error shows up:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Userlib::$_container
Filename: libraries/Userlib.php
Line Number: 210
An Error Was Encountered
Unable to load the requested file: .php


CodeIgniters Log says:
ERROR - 2008-04-14 11:14:18 --&gt; Severity: Notice --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Applications/MAMP/htdocs/modules/preferences/models/preference_model.php 66
ERROR - 2008-04-14 11:14:18 --&gt; Severity: Notice --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Applications/MAMP/htdocs/modules/preferences/models/preference_model.php 66
ERROR - 2008-04-14 11:14:18 --&gt; Severity: Notice --&gt; unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 1 bytes /Applications/MAMP/htdocs/modules/preferences/models/preference_model.php 66
ERROR - 2008-04-14 11:14:18 --&gt; Severity: Notice --&gt; Undefined property: Userlib::$_container /Applications/MAMP/htdocs/modules/auth/libraries/Userlib.php 210
#53

[eluser]nikolaaa[/eluser]
I changed base_model.php

and still have error:
[14-Apr-2008 12:17:14] PHP Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /Applications/MAMP/htdocs/backendpro/system/application/libraries/MY_Controller.php on line 26
[14-Apr-2008 12:17:14] PHP Stack trace:
[14-Apr-2008 12:17:14] PHP 1. {main}() /Applications/MAMP/htdocs/backendpro/index.php:0
[14-Apr-2008 12:17:14] PHP 2. require_once() /Applications/MAMP/htdocs/backendpro/index.php:117
[14-Apr-2008 12:17:14] PHP 3. load_class() /Applications/MAMP/htdocs/backendpro/system/codeigniter/CodeIgniter.php:137
#54

[eluser]adamp1[/eluser]
Yes there is an issue with using Static variable declarations in PHP4 which I forgot about. I am in the process of fixing this now, a new version should be up soon.
#55

[eluser]adamp1[/eluser]
Right new build is out:

ChangeLog:
* Changed the way the view file container was passed from the Controller to the Userlib library. It is now passed as a function parameter instead of by using static variables which were not PHP4 compatible.
* Updated the install script to take note of new modules folder from Version 0.2 alpha 20080413
* Replaced call_user_method_array with call_user_func_array in base_model.php due to original being deprecated.

Can get it from my GoogleCode page.
#56

[eluser]CARP[/eluser]
Hi Adam
Yes, it fixed, now I have to solve why it is showing very ugly, without css
Will let u know if I solve something about this
#57

[eluser]nikolaaa[/eluser]
I can login to admin panel now, but there are new errors.
If I open members modify - /backendpro/index.php/auth/admin/members/form/1.html
or any other links iside admin panel here is error:

Code:
[14-Apr-2008 14:48:21] PHP Parse error:  syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /Applications/MAMP/htdocs/backendpro/system/application/models/Nested_sets_model.php on line 35
[14-Apr-2008 14:48:21] PHP Stack trace:
[14-Apr-2008 14:48:21] PHP   1. {main}() /Applications/MAMP/htdocs/backendpro/index.php:0
[14-Apr-2008 14:48:21] PHP   2. require_once() /Applications/MAMP/htdocs/backendpro/index.php:117
[14-Apr-2008 14:48:21] PHP   3. call_user_func_array() /Applications/MAMP/htdocs/backendpro/system/codeigniter/CodeIgniter.php:224
[14-Apr-2008 14:48:21] PHP   4. members->form() /Applications/MAMP/htdocs/backendpro/system/codeigniter/CodeIgniter.php:0
[14-Apr-2008 14:48:21] PHP   5. members->model() /Applications/MAMP/htdocs/backendpro/modules/auth/controllers/admin/members.php:180
[14-Apr-2008 14:48:21] PHP   6. require_once() /Applications/MAMP/htdocs/backendpro/system/application/libraries/Loader.php:337
#58

[eluser]PedroGrilo[/eluser]
[quote author="adamp1" date="1208175578"].....
@PedroGrilo: Can you give me the error message you get? I think even if you don't supply recaptcha keys it will still copy the file to its new location. Also are you on windows/linux?[/quote]
Thanks for your reply.

the error:
Code:
Could not open file: /cifiles/recaptcha.dat
Please note that it is missing a slash / between ci an files, (and the install folder?). But I've edited the install.php file to make it point to the right path, moved the files folder to the site root, edited basepath to include localhost:8888, moved the whole site file to the server root and this always happens. And the config files, database files, etc turns out blank..

Also, when I try to install manually I get the UserLib error that j4k3 mentions here.

Thanks for your attention.

ps: MacOS X, MAMP, PHP5
#59

[eluser]nikolaaa[/eluser]
Ok. I just comented

Code:
/*
    public function Nested_sets_model()
    {        
        // Call the parent constructor
        parent::Model();
    }
*/

and it's working now.
#60

[eluser]adamp1[/eluser]
@nikolaaa: The issue I think there is the library used "Thunder UK's Nested Sets library" seems to have a mix of PHP4 and PHP5, instead of commenting out that block, just delete the public bit (I have updated my source for the future also).

@CARP: Make sure the css files are being included in the document. Also turn of asset caching if you have it on till you can figure out why, do get back to me on the reason (I like to keep in touch with problems people have)

@PedroGrilo: Right first thing, the error in Userlib, it was a issue with PHP4, I have no fixed this and uploaded the new release, so this should be fixed. To do with the install problem, I think the error message is not very helpful. It actual means it cannot open the file it wants to write the new data to. This was due to me not updating the file path after moving the modules folder. Please can you download the newest release and try agian.




Theme © iAndrew 2016 - Forum software by © MyBB