Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/08/2010, 14:04
Avatar de falillista
falillista
 
Fecha de Ingreso: agosto-2008
Mensajes: 101
Antigüedad: 15 años, 8 meses
Puntos: 4
carácteres raros

carácteres "raros" en un sistema que ando modificando.

Ayer hablé sobre un sistemilla de blogs y demás que tuve problema,le di de lado y ahora encontré otro.Lo ando modificando.Lo tengo la listo todo,pero me salen carácteres raros al crear un post.Un ejemplo:

http://www.subirimagenes.com/imagen-12s-4964842.html

la bd está así:


Tengo por ejemplo la plantilla de los posts separado como "plantilla_posteo.php"

Código PHP:
<div class="post" id="post-$postid$">
    <
h2><img src=$imgruta$/noticias.png> - <a href="$posturl$">$posttitle$</a></h2>
        <
br>
    <
div class="post-content">
        
$postcontent$    
    </
div>
        <
br>
    <
span class="date">($postdate$) - <b>Posteado por:</b$posteado$</span><br>
        <
hr>
</
div
Código:
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 12-08-2010 a las 17:31:05
-- Versión del servidor: 5.0.91
-- Versión de PHP: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Base de datos: `rafaj695_portal`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `entradas`
--

CREATE TABLE IF NOT EXISTS `entradas` (
  `post_id` int(20) NOT NULL auto_increment,
  `post_slug` varchar(255) NOT NULL default '',
  `post_title` varchar(255) NOT NULL default '',
  `post_content` longtext NOT NULL,
  `date` int(20) NOT NULL default '0',
  `published` int(1) NOT NULL default '0',
  PRIMARY KEY  (`post_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Volcar la base de datos para la tabla `entradas`
--

INSERT INTO `miniblog` (`post_id`, `post_slug`, `post_title`, `post_content`, `date`, `published`) VALUES
(1, 'bienvenidos-a-pdh-', '¡Bienvenidos a PDH! ;)', '<p>Bienvenidos a PDH... y al portal...desde aquí se actualizará todo.</p>', 1281644373, 1);

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `config_web`
--

CREATE TABLE IF NOT EXISTS `miniblog_config` (
  `config_name` varchar(255) NOT NULL default '',
  `config_value` varchar(255) NOT NULL default '',
  `config_explain` longtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Volcar la base de datos para la tabla `config_web`
--

INSERT INTO `config_web` (`config_name`, `config_value`, `config_explain`) VALUES
('posts-per-page', '5', 'Posts displayed each page'),
('date-format', 'F d, Y', 'Date format as per the PHP date function <a href="http://www.php.net/date">here</a>'),
('password', '-->ESTA ZONA ES LA PW,EN MD5', 'Admin password'),
('miniblog-filename', 'index.php', 'Name of the file which miniblog.php is included into'),
('use-modrewrite', '0', 'Use modrewrite for post URLs - use 1 for yes, 0 for no.');
=>

y este el archivo sistema.php:

Código PHP:
<?php
if(!defined('IN_BLOG'))
{
    exit;
}

include(
PATH "$sistema/includes/config.php");
include(
PATH "$sistema/includes/functions.php");

$link mb_connect($sqlconfig);
unset(
$sqlconfig);

if(!
$link)
{
    die(
"Could not connect to MySQL database, check the settings in config.php");
}

$config mb_config();

$post    = (string) mysql_real_escape_string($_GET['post']);
$page    = (int) mysql_real_escape_string(intval($_GET['page']));
$ppp    = (int) intval($config['posts-per-page']);
$from    = (int) intval($ppp $page);


$sql = ($post == '') ? 'SELECT * FROM `miniblog` WHERE `published` = 1 ORDER BY `date` DESC LIMIT ' $from ', ' $ppp "SELECT * FROM `miniblog` WHERE `post_slug` = '{$post}' AND `published` = 1";

$result mysql_query($sql);
$total  mysql_result(mysql_query("SELECT COUNT(*) FROM `miniblog` WHERE `published` = 1"), 0);

if(
mysql_num_rows($result) > 0)

    while(
$posts mysql_fetch_array($result))
    {

        
$vars = array(
            
'$postid$'        => $posts['post_id'],
            
'$posturl$'        => ($config['use-modrewrite'] == 1) ? $posts['post_slug'] : $config['miniblog-filename'] . '?post=' $posts['post_slug'],
            
'$posttitle$'    => stripslashes($posts['post_title']),
            
'$postdate$'    => date($config['date-format'], $posts['date']),
            
'$postcontent$'    => stripslashes($posts['post_content']),
            
'$posteado$'    => stripslashes($posteadopor),
            
'$imgruta$'    => stripslashes($img_rute),
        );
        
        
$template_vars        array_keys($vars);
        
$template_values    array_values($vars);
        
        
$output file_get_contents(PATH "$sistema/includes/plantilla_posteo.php");
        
$output str_replace($template_vars$template_values$output);
        
        
$miniblog_posts .= $output;
    }
}

$single = ($post == '') ? false true;

if(
$total > ($from $ppp))
{
    
$miniblog_previous '<a href="' $config['miniblog-filename'] . '?page=' . ($page 1)  . '">&laquo; Antiguos posts</a>';
}
if(
$from 0)
{
    
$miniblog_next '<a href="' $config['miniblog-filename'] . '?page=' . ($page 1)  . '">Posts m&aacute;s nuevos &raquo;</a>';
}
?>
El archivo contenido.php:

Código PHP:
<?php
define
('IN_BLOG'true);
define('PATH''');
include(
"$sistema/includes/sistema.php");
?>

<?=$miniblog_posts?>
<? 
if(!$single) { ?>
<? 
if($miniblog_previous) {    ?> <p class="previous-link"><?=$miniblog_previous?></p>    <? ?>
<? 
if($miniblog_next) {    ?>    <p class="next-link"><?=$miniblog_next?></p> <? ?>
<? 
?>
<? 
if($single) { ?>
<p class="previous-link"><a href="<?=$config['miniblog-filename']?>">&laquo; volver a los posts</a></p>
<? ?>
<div class="clear"></div>
y el index.php donde con un include,lo incluyo en la página principal.

Código PHP:
<?php
/**************************
 * Portal by PDH v1 ;)
 **************************/
include("configurar.php"); ?>

<title><? echo $nombre ?></title>

<?php include("$ruta/arriba.php"); ?>

<!--- CONTENIDO --->
<div id="pdh">
<div id="pdh2">
<div class="pdh3">

<?php include("$sistema/contenido.php"); ?>

</div></div>
<!--- FIN CONTENIDO --->

<?php include("$ruta/abajo.php"); ?>
</body>
el sistema es Miniblog,solo que le edité cosas,lo puse sobretodo a mi gusto,para adaptarlo a cualquier plantilla,o sitio.

si alguien me sabe responder,se lo agradeceré...

pd esos archivos son PRINCIPALES,los que muestran los posts.