desde ahi me salen varios errores uno de ellos es este:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/xxxxxxxx/public_html/admin/includes/Pagina.php on line 5
el codigo es el siguiente:
Código PHP:
<?php
class Pagina
{
protected static $table_name = "paginas";
protected static $db_fields = array('id', 'seccion', 'titulo_es', 'titulo_en', 'contenido_es', 'contenido_en', 'tags_es', 'tags_en', 'titulo_general_es', 'titulo_general_en', 'descripcion_es', 'descripcion_en', 'url_es', 'url_en', 'orden');
public $id;
public $seccion;
public $titulo_es;
public $titulo_en;
public $contenido_es;
public $contenido_en;
public $tags_es;
public $tags_en;
public $titulo_general_es;
public $titulo_general_en;
public $descripcion_es;
public $descripcion_en;
public $url_es;
public $url_en;
public $orden;
public function __construct()
{
$this->database = new MySQLDatabase();
}
// Database Methods
public static function find_all()
{
return self::find_by_sql("SELECT * FROM " . self::$table_name);
}
public static function find_by_id($id=0)
{
$database = new MySQLDatabase();
$result_array = self::find_by_sql("SELECT * FROM ". self::$table_name ." WHERE id=".$database->escape_value($id)." LIMIT 1");
return !empty($result_array) ? array_shift($result_array) : false;
}
public static function find_by_sql($sql="")
{
$database = new MySQLDatabase();
$result_set = $database->query($sql);
$object_array = array();
while($row = $database->fetch_array($result_set)){
$object_array[] = self::instantiate($row);
}
return $object_array;
}
public static function count_all(){
$database = new MySQLDatabase();
$sql = "SELECT COUNT(*) FROM ".self::$table_name;
$result_set = $database->query($sql);
$row = $database->fetch_array($result_set);
return array_shift($row);
}
private static function instantiate($record){
$object = new self;
foreach($record as $attribute=>$value){
if($object->has_attribute($attribute)){
$object->$attribute = $value;
}
}
return $object;
}
private function has_attribute($attribute){
$object_vars = $this->attributes();
return array_key_exists($attribute, $object_vars);
}
protected function attributes(){
$attributes = array();
foreach(self::$db_fields as $field){
if(property_exists($this, $field)){
$attributes[$field] = $this->$field;
}
}
return $attributes;
}
}
?>
asi declaraba antes:
Código PHP:
<?php
define (TEL, "Tel: ");
define (FAX, "Fax: ");
define (FOTOS, "Fotos");
define (VIDEOS, "Videos");
define (HOME, "Inicio");
define (COMPARTIR, "Compartir en");
define (DESCARGA, "Descargar");
define (SIGUIENTE, "Siguiente");
define (ANTERIOR, "Anterior");
?>