Advertisement:

Author Topic: no puedo instalar los plugins me sale error  (Read 6232 times)

#creative#

  • Newbie
  • *
  • Posts: 28
no puedo instalar los plugins me sale error
« on: November 09, 2011, 03:38:25 am »
el error que me sale es este

Ha habido un error fatal y el plugin no se ha instalado.
Error: \"preg_replace() [function.preg-replace]: Compilation failed: missing ) at offset 10\" Línea: 96
Fila: /home/scanners/public_html/ventas/oc-includes/osclass/model/Rewrite.php

y este es mi rewite.php

Code: [Select]
<?php if ( ! defined('ABS_PATH')) exit('ABS_PATH is not loaded. Direct access is not allowed.');

    
/*
     *      OSCLass â€“ software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2010 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

    
class Rewrite extends DAO
    
{
        private static 
$instance ;
        private 
$rules;
        private 
$request_uri;
        private 
$uri;
        private 
$location;
        private 
$section;

        public function 
__construct()
        {
            
$this->rules $this->getRules();
            
$this->request_uri '';
            
$this->uri '';
            
$this->location '';
            
$this->section '';
            
parent::__construct() ;
        }

        public static function 
newInstance()
        {
            if(!
self::$instance instanceof self) {
                
self::$instance = new self ;
            }
            return 
self::$instance ;
        }

        public function 
getTableName() {}

        public function 
getRules()
        {
            return 
unserialize(osc_rewrite_rules()) ;
        }

        public function 
setRules()
        {
            
Preference::newInstance()->update(
                    array(
's_value' => serialize($this->rules))
                    ,array(
's_name' => 'rewrite_rules')
            );
        }

        public function 
listRules()
        {
            return 
$this->rules;
        }

        public function 
addRules($rules)
        {
            if(
is_array($rules)) {
                foreach(
$rules as $rule) {
                    if(
is_array($rule) && count($rule)>1) {
                        
$this->addRule($rule[0], $rule[1]);
                    }
                }
            }
        }

        public function 
addRule($regexp$uri)
        {
            
$regexp trim($regexp);
            
$uri trim($uri);
            if(
$regexp!='' && $uri!='') {
                if(!
in_array($regexp$this->rules)) {
                    
$this->rules[$regexp] = $uri;
                }
            }
        }

        public function 
init()
        {
            
// $_SERVER is not supported by Params Class... we should fix that
            
if(isset($_SERVER['REQUEST_URI'])) {
                
$request_uri urldecode(preg_replace('@^' REL_WEB_URL '@'""$_SERVER['REQUEST_URI']));
                if(
osc_rewrite_enabled()) {
                    
$this->extractParams($request_uri);
                    
$tmp_ar explode("?"$request_uri);
                    
$request_uri $tmp_ar[0];
                    foreach(
$this->rules as $match => $uri) {
                        
// UNCOMMENT TO DEBUG
                        //echo 'Request URI: '.$request_uri." # Match : ".$match." # URI to go : ".$uri." <br />";
                        
if(preg_match('#'.$match.'#'$request_uri$m)) {
                            
$request_uri preg_replace('#'.$match.'#'$uri$request_uri);
                            break;
                        }
                    }
                }
                
$this->extractParams($request_uri);
                
$this->request_uri $request_uri;

                if(
Params::getParam('page')!='') { $this->location Params::getParam('page'); };
                if(
Params::getParam('action')!='') { $this->section Params::getParam('action'); };
            }
        }

        public function 
extractURL($uri '')
        {
            
$uri_array explode('?'str_replace('index.php'''$uri));
            if(
substr($uri_array[0], 01)=="/") {
                return 
substr($uri_array[0], 1);
            } else {
                return 
$uri_array[0];
            }
        }

        public function 
extractParams($uri '')
        {
            
$uri_array explode('?'$uri);
            
$url substr($uri_array[0], 1);
            
$length_i count($uri_array);
            for(
$var_i 1;$var_i<$length_i;$var_i++) {
                if(
preg_match_all('|&([^=]+)=([^&]*)|''&'.$uri_array[$var_i].'&'$matches)) {
                    
$length count($matches[1]);
                    for(
$var_k 0;$var_k<$length;$var_k++) {
                        
Params::setParam($matches[1][$var_k], $matches[2][$var_k]);
                    }
                }
            }
        }

        public function 
removeRule($regexp)
        {
            unset(
$this->rules[$regexp]);
        }

        public function 
clearRules()
        {
            unset(
$this->rules);
            
$this->rules = array();
        }

        public function 
get_request_uri()
        {
            return 
$this->request_uri;
        }

        public function 
set_location($location)
        {
            
$this->location $location;
        }

        public function 
get_location()
        {
            return 
$this->location;
        }

        public function 
get_section()
        {
            return 
$this->section;
        }
    }

?>

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #1 on: November 09, 2011, 03:44:21 pm »
la linea es esta $request_uri = urldecode(preg_replace('@^' . REL_WEB_URL . '@', "", $_SERVER['REQUEST_URI']));

Sphinx

  • Newbie
  • *
  • Posts: 35
Re: no puedo instalar los plugins me sale error
« Reply #2 on: November 09, 2011, 04:18:39 pm »
@Creative:
Me parece que no tenés permisos para crear carpetas en el servidor, o algo por el estilo. A lo mejor no tenés habilitado MOD REWRITE tampoco. Pero me da que es un tema de configuración del servidor.

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #3 on: November 09, 2011, 05:56:26 pm »
sabes como activar el mod_rewitre o se lo pido a los del servidor

Sphinx

  • Newbie
  • *
  • Posts: 35
Re: no puedo instalar los plugins me sale error
« Reply #4 on: November 09, 2011, 06:28:09 pm »
@Creative:
Si tu servidor es compartido tenés que pedirlo.

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #5 on: November 09, 2011, 06:29:41 pm »
me han comentado que están activados en todos sus servidores, es de pago pero no se si sera compartido supongo que si no es un dedicado

Sphinx

  • Newbie
  • *
  • Posts: 35
Re: no puedo instalar los plugins me sale error
« Reply #6 on: November 09, 2011, 06:35:48 pm »
poné los permisos de la carpeta "plugins" en 775 a ver que onda

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #7 on: November 09, 2011, 06:39:20 pm »
la he pusto incluso en 777 y nada, me han dicho en el serrvidor que es un fallo del scrip que pregunte aqui o que cambie de scrip jajaj

Sphinx

  • Newbie
  • *
  • Posts: 35
Re: no puedo instalar los plugins me sale error
« Reply #8 on: November 09, 2011, 07:24:46 pm »
Pero el sitio, más allá de no poder instalar plugins... se ve??? anda??? Que dirección tiene???

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #9 on: November 09, 2011, 09:10:20 pm »
Code: [Select]
www.tucocheytu.com/ventas   lo unico es

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #10 on: November 09, 2011, 09:13:49 pm »
Code: [Select]
www.tucocheytu.com/ventas   lo unico es que tiene ne dos index uno es .html para que lo llame primero y el otro es php que es el original, pero esto antes no me daba ningun problema y realize una modificacion aqui en el .header para no llame a ventas/index.html sino a esta direccion
Code: [Select]
<div id="header">    [color=red]<a id="logo" href="http://tucocheytu.com/ventas/index.php"><strong>[/color]<?php echo osc_page_title() ; ?></strong></a>    <div id="user_menu">        <ul>            <?php if( 

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #11 on: November 10, 2011, 03:37:24 am »
he probado poniendo nuevamente el header.php donde hiba i ndada, alguien puede pasarme su mod_rewrite a ver que falla, o mas que sea esa linea la 96

#creative#

  • Newbie
  • *
  • Posts: 28
Re: no puedo instalar los plugins me sale error
« Reply #12 on: November 12, 2011, 04:29:26 pm »
a nadie se le ocurre algo tendre que instalar de nuevo y perder todo

Sphinx

  • Newbie
  • *
  • Posts: 35
Re: no puedo instalar los plugins me sale error
« Reply #13 on: November 15, 2011, 03:26:30 pm »
@Creative:
Pudiste solucionar el tema este???
Si aún no pudiste deberías instalar el index.html en www.tucocheytu.com/ventas
Y luego instalar tu OSClass en www.tucocheytu.com/ventas/anuncios

En síntesis, tu index.html debería llamar a OSClass, pero que este último esté en otro directorio.

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: no puedo instalar los plugins me sale error
« Reply #14 on: November 16, 2011, 03:52:00 am »
Antes de intentar reinstalar OSClass... puedes probar a sustituir tu fichero Rewrite.php por este: https://github.com/osclass/OSClass/blob/v2.2.3/oc-includes/osclass/model/Rewrite.php