Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - thunderstrike

Pages: 1 2 [3] 4 5 6 7
31
Hi,

I code new MOD-Plugin for ACP. Admin add SQL file in form and submit. SQL file is use for SQL command.
After upload file, file is delete auto.

So, if install MOD from someone and need to add SQL command - no more need for phpmyadmin. You can use from ACP. ;)
Note: Always use 4images_ for prefix. No matter if is no same for gallery you use (in publish MOD) - MOD is detect for right prefix use. This is test in 4images v1.74. ;)

// Step 1

In includes/constants.php file,

find:

Quote
define('DATABASE_DIR', 'data/database');

add after:

Code: [Select]
define('SQL_PATCHES_DIR', 'data/sql_patches');

// Step 1.1

In data folder, create folder: sql_patches . Set CHMOD 777 for write.

// Step 2

In lang/english/admin.php file,

find:

Quote
$lang['save_settings_success'] = "Settings saved";

add after:

Code: [Select]
//-----------------------------------------------------
//--- SQL Patches -------------------------------------
//-----------------------------------------------------
$lang['sql_patches_title'] = "SQL Patches";
$lang['sql_patches_could_not_load_message'] = "Could not load: ";
$lang['sql_patches_success_install'] = "<font color=\"green\">Success !</font> - <b>{success_install_file}</b> file has just been added into the database.";
$lang['sql_patches_select_sql_file'] = "<b>Select SQL file:</b> ";
$lang['sql_patches_go_back'] = "<span class=\"smalltext\">[ Go back ]</a>";
$lang['sql_patches_backup_database_message'] = "<span class=\"smalltext\">Use <b>Backup database</b> link first !</span>";
$lang['sql_patches_expert_add_command'] = "<span class=\"smalltext\">Add SQL command here:</span>";
$lang['sql_patches_expert_success_install'] = "<font color=\"green\">Done !</font>";
$lang['sql_patches_expert_mode_link'] = "[ Expert mode ]";

// Step 3

In admin/plugins folder, create file: sql_patches.php .

Add:

Code: [Select]
<?php // PLUGIN_TITLE: SQL Patches

$nozip 1;
define('IN_CP'1);
define('ROOT_PATH'"./../../");
require(
ROOT_PATH.'admin/admin_global.php');

show_admin_header();

if (
$action == "") {
    
$action "show_sql_patches";
}

if (
$action == "exec_sql_patches") {
    
    if (isset(
$HTTP_POST_FILES['sql_file']['tmp_name'])) {
        
$HTTP_POST_FILES['sql_file']['tmp_name'] = (stripslashes(trim($HTTP_POST_FILES['sql_file']['tmp_name'])));                
    }   
        
        if (!isset(
$HTTP_POST_FILES['sql_file']['tmp_name']) || empty($HTTP_POST_FILES['sql_file']['tmp_name'])) {            
            
$action "show_sql_patches";
        }
        
        if (!
preg_match("/\.sql$/"$HTTP_POST_FILES['sql_file']['name'])) {
            
unlink ($HTTP_POST_FILES['sql_file']['tmp_name']);
            unset (
$HTTP_POST_FILES['sql_file']['tmp_name']);
            
$action "show_sql_patches";
        }
        
        if (isset(
$HTTP_POST_FILES['sql_file']['tmp_name']) && !empty($HTTP_POST_FILES['sql_file']['tmp_name']) && $HTTP_POST_FILES['sql_file']['error'] == && preg_match("/\.sql$/"$HTTP_POST_FILES['sql_file']['name'])) {
            
            if (@
file_exists($HTTP_POST_FILES['sql_file']['tmp_name'])) {
                @
move_uploaded_file($HTTP_POST_FILES['sql_file']['tmp_name'], ROOT_PATH SQL_PATCHES_DIR "/" $HTTP_POST_FILES['sql_file']['name']);
            }
            
            include(
ROOT_PATH.'includes/db_utils.php');
            
            
$db_file ROOT_PATH SQL_PATCHES_DIR "/" get_file_name(basename($HTTP_POST_FILES['sql_file']['name']));
            
$cont = @fread(@fopen($db_file'r'), @filesize($db_file));
            if (empty(
$cont)) {
                
$error_log[] = $lang['sql_patches_could_not_load_message'] . $db_file;
            }
            
            
$flag false;
            if (empty(
$error_log)) {            
                
$cont preg_replace('/4images_/'$table_prefix$cont);
                
$pieces split_sql_dump($cont);
                for (
$i 0$i sizeof($pieces); $i++) {
                    
$sql trim($pieces[$i]);
                    if (!empty(
$sql) and $sql[0] != "#") {
                        if (!
$site_db->query($sql)) {
                            
$error_log[] = $sql;
                            
$flag false;
                        } else {
                            
$flag true;                            
                        }
                    }            
                }
            }
        
        if (
$flag == true) {
            
?>

            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td width="100%">    
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td width="100%" class="tableheader" />&nbsp;<?php echo $lang['sql_patches_title']; ?></td>
            </tr>
            <tr>
            <td width="100%" class="tablerow" /><a href="<?php echo $site_sess->url("sql_patches.php"); ?>" class="link" /><?php echo $lang['sql_patches_go_back']; ?></a></td>
            </tr>
            <tr>
            <td width="100%" class="tablerow" />&nbsp;</td>
            </tr>
            <tr>
            <td width="100%" align="center" class="tablerow" /><?php echo str_replace("{success_install_file}"format_text(trim($HTTP_POST_FILES['sql_file']['name']), 2), $lang['sql_patches_success_install']); ?></td>
            </tr>
            <tr>    
            <td width="100%" class="tablerow" />&nbsp;</td>
            </tr>
            <tr>
            <td width="100%" class="tableheader" />&nbsp;</td>
            </tr>    
            </table>    
            </td>            
            </tr>
            </table>
            <?php
            
@unlink(ROOT_PATH SQL_PATCHES_DIR $HTTP_POST_FILES['sql_file']['name']);
        
        } elseif (
$flag == false) {
            
            if (isset(
$error_log) && is_array($error_log) && !empty($error_log)) {
                foreach (
$error_log as $key => $val) {
                    echo 
$val "<br />";
                }
                
$action "show_sql_patches";
            }            
        }        
    }
}

if (
$action == "exec_sql_expert_patches") {
    
    if (isset(
$HTTP_POST_VARS['add_sql_expert_patches'])) {
        
$add_sql_expert_patches = (isset($HTTP_POST_VARS['add_sql_expert_patches'])) ? un_htmlspecialchars(trim((string)$HTTP_POST_VARS['add_sql_expert_patches'])) : "";
    } else {
        
$add_sql_expert_patches "";
    }
    
    if (!isset(
$add_sql_expert_patches) || empty($add_sql_expert_patches)) {
        
$action "show_sql_expert_patches";
    }
    
    if (isset(
$add_sql_expert_patches) && !empty($add_sql_expert_patches)) {        
        
        if (!
function_exists('check_sql_queries')) {
            function 
check_sql_queries($add_sql_expert_patches) {
                global 
$site_db$table_prefix$valid$split_sql_queries;  
                if (!isset(
$split_sql_queries)) {
                    
$ids trim($add_sql_expert_patches);                    
                    
$ids preg_replace("/[\n\r]/is"" "$ids);
                    
//$ids = str_replace(",", " ", $ids);
                    
$ids preg_quote($ids);
                    
$ids str_replace('/''\\/'$ids);                    
                    
$split_sql_queries preg_split("/\s+/"$ids);
                }
                
$valid true;
                foreach (
$split_sql_queries as $key => $val) {            
                    if (
$val == "CREATE" || $val == "ALTER" || $val == "DROP" || $val == "DELETE" || $val == "UPDATE" || $val == "REPLACE" || $val == "INSERT") {
                        
$val preg_replace("/4images_/"$table_prefix$val);                                                                      
                        if (!
$site_db->query(stripslashes(stripslashes($ids)))) {
                            
$valid false;
                            break;
                        }
                    }                    
                }        
            }
        }
        
        
check_sql_queries($add_sql_expert_patches);
        
        if (
$valid == true) {
            
?>

            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td width="100%">    
            <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td width="100%" class="tableheader" />&nbsp;<?php echo $lang['sql_patches_title']; ?></td>
            </tr>
            <tr>
            <td width="100%" class="tablerow" /><a href="<?php echo $site_sess->url("sql_patches.php"); ?>" class="link" /><?php echo $lang['sql_patches_go_back']; ?></a></td>
            </tr>
            <tr>
            <td width="100%" class="tablerow" />&nbsp;</td>
            </tr>
            <tr>
            <td width="100%" align="center" class="tablerow" /><?php echo $lang['sql_patches_expert_success_install']; ?></td>
            </tr>
            <tr>    
            <td width="100%" class="tablerow" />&nbsp;</td>
            </tr>
            <tr>
            <td width="100%" class="tableheader" />&nbsp;</td>
            </tr>    
            </table>    
            </td>            
            </tr>
            </table>
            <?php            
        
        
} elseif ($valid == false) {
            
$action "show_sql_expert_patches";            
        }
    }
}

if (
$action == "show_sql_expert_patches") {    
    
?>

    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%">
    <form action="<?php echo $site_sess->url("sql_patches.php"); ?>" method="post">
    <input type="hidden" name="action" value="exec_sql_expert_patches">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" class="tableheader" />&nbsp;<?php echo $lang['sql_patches_title']; ?></td>
    </tr>
    <tr>
    <td width="100%" class="tablerow" /><a href="<?php echo $site_sess->url("sql_patches.php"); ?>" class="link" /><?php echo $lang['sql_patches_go_back']; ?></a></td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="center" class="tablerow" />
    <?php echo $lang['sql_patches_expert_add_command']; ?><br />
    <textarea name="add_sql_expert_patches" rows="20" cols="60" class="textarea" /></textarea><br /><br />
    <input type="submit" name="submit" value="<?php echo $lang['submit']; ?>" class="button" />
    </form>    
    </td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" /><?php echo $lang['sql_patches_backup_database_message']; ?></td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tableheader" />&nbsp;</td>
    </tr>    
    </table>
    </form>
    </td>
    </tr>
    </table>
    <?php    
}

if (
$action == "show_sql_patches") {
    
?>

    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%">
    <form action="<?php echo $site_sess->url("sql_patches.php"); ?>" method="post" enctype="multipart/form-data">
    <input type="hidden" name="action" value="exec_sql_patches">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" class="tableheader" />&nbsp;<?php echo $lang['sql_patches_title']; ?></td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="right" class="tablerow" /><a href="<?php echo $site_sess->url("sql_patches.php?action=show_sql_expert_patches"); ?>" class="link" /><?php echo $lang['sql_patches_expert_mode_link']; ?></a>&nbsp;</td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="center" class="tablerow" /><?php echo $lang['sql_patches_select_sql_file']; ?><input type="file" name="sql_file" class="input" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="<?php echo $lang['submit']; ?>" class="button" /></td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" /><?php echo $lang['sql_patches_backup_database_message']; ?></td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tablerow" />&nbsp;</td>
    </tr>
    <tr>
    <td width="100%" align="center" class="tableheader" />&nbsp;</td>
    </tr>    
    </table>
    </form>
    </td>
    </tr>
    </table>
    <?php    
}

show_admin_footer();
?>


// Step 4

In includes/db_utils.php file,

find:

Quote
if (preg_match("/^CREATE/i", $line)) {

replace:

Code: [Select]
if (preg_match("/^CREATE/i", $line) || preg_match("/^ALTER/i", $line) || preg_match("/^INSERT/i", $line) || preg_match("/^UPDATE/i", $line) || preg_match("/^REPLACE/i", $line) || preg_match("/^DELETE/i", $line) || preg_match("/^DROP/i", $line)) {

// Step 5

Install this:

http://www.4homepages.de/forum/index.php?topic=19287.0

From step 3 - find:

Quote
if (!isset($add_sql_expert_patches) || empty($add_sql_expert_patches)) {
    $action = "show_sql_expert_patches";
}

add after:

Code: [Select]
if (function_exists('check_post_comment_valid_chars') && !check_post_comment_valid_chars($add_sql_expert_patches)) {
    $action = "show_sql_expert_patches";
}

Go in ACP - > SQL Patches link (in plugins tab) - and

Tala ! 8)

Again - is test in 4images v1.74 .

32
Feedback & Suggestions / [FIX] - includes/functions.php file
« on: October 31, 2007, 12:29:00 PM »
This is lower case output (file extension is same).

Find:

Quote
return isset($regs[1]) ? $regs[1] : $basename;

replace:

Code: [Select]
return isset($regs[1]) ? strtolower(trim($regs[1])) : strtolower(trim($basename));

After - find:

Quote
return strtolower($regs[2]);

replace:

Code: [Select]
return strtolower(trim($regs[2]));

33
Feedback & Suggestions / [FIX] - member.php file
« on: October 28, 2007, 03:31:19 PM »
For host security reason in email - is best for add from for send email with to ...

Find:

Quote
$validation_url = $script_url."/admin/index.php?goto=".urlencode("validateimages.php?action=validateimages");

$site_email->set_to($config['site_email']);

replace:

Code: [Select]
$validation_url = $script_url."/admin/index.php?goto=".urlencode("validateimages.php?action=validateimages");

$site_email->set_from(stripslashes(trim($config['site_email'])));
$site_email->set_to(stripslashes(trim($config['site_email'])));

34
This show right text format for keys in register (additional user fields).

Find:


$value 
= (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key])) : "";


replace:


$value 
= (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : "";

35
Feedback & Suggestions / [FIX] - top.php file
« on: October 21, 2007, 02:27:15 PM »
This output format text correct for top list.

Change all:

Quote
format_text($top_list[$i]['image_name'])

to:

Code: [Select]
format_text(trim($top_list[$i]['image_name']), 2)

36
Feedback & Suggestions / [FIX] - member.php lostpassword email
« on: October 20, 2007, 01:18:08 PM »
This show user name and site name with text format.

Find:

Quote
$site_email->register_vars(array(
        "user_name" => $checkuser[$user_table_fields['user_name']],
        "user_password" => stripslashes($user_password),
        "site_name" => $config['site_name']
));

Replace:

Code: [Select]
$site_email->register_vars(array(
        "user_name" => format_text(trim($checkuser[$user_table_fields['user_name']]), 2),
        "user_password" => stripslashes($user_password),
        "site_name" => format_text(trim($config['site_name']), 2)
));

37
Feedback & Suggestions / [FIX] - index.php
« on: October 15, 2007, 05:04:59 AM »
This check with right condition for new images with image and cat check.

Find:

Quote
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")

replace:

Code: [Select]
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

38
Feedback & Suggestions / [FIX] - includes/page_header.php file
« on: October 14, 2007, 03:07:06 AM »
This fix for site name title and admin site email for gallery.

Find:

Quote
"site_name" => $config['site_name'],
"site_email" => $config['site_email'],

replace:

Code: [Select]
"site_name" => format_text(trim($config['site_name']), 2),
"site_email" => (stripslashes(trim($config['site_email']))),

39
This is tweak for universal tag for {url_filename} . No more for need to go to includes/page_header.php file for add yourself. ;)

Find:

Quote
if (!empty($additional_urls)) {

add before:

Code: [Select]
// Auto-use of {url_filename} uppon PHP ROOT files detection in HTML template files.
        if (defined('ROOT_PATH') && @is_dir(ROOT_PATH) && @is_readable(ROOT_PATH)) {
            $files_array = array("categories.php", "config.php", "config.new.php", "details.php", "index.php", "lightbox.php", "login.php", "logout.php", "member.php", "captcha.php", "register.php", "search.php", "top.php", "global.php", "download.php", "rss.php", "postcards.php");
            $handle = @opendir(ROOT_PATH);
            while (false !== ($file = @readdir($handle))) {
                $content = @file_get_contents($file);
                if ($file != "." && $file != ".." && $file != $files_array[0] && $file != $files_array[1] && $file != $files_array[2] && $file != $files_array[3] && $file != $files_array[4] && $file != $files_array[5] && $file != $files_array[6]
                 && $file != $files_array[7] && $file != $files_array[8] && $file != $files_array[9] && $file != $files_array[10] && $file != $files_array[11] && $file != $files_array[12] && $file != $files_array[13]
                 && $file != $files_array[14] && $file != $files_array[15] && $file != $files_array[16]
                 && preg_match("/\.php$/", $file) && preg_match("/(.+)\.(.+)/", $file) && preg_match("/<[\?|%]+(php|=)?(.*)[\?|%]+>/siU", $content)) {
                    $file1 = substr($file, 0, -4);            
                    $site_template->register_vars("url_" . $file1, (@file_exists(ROOT_PATH . $file1 . ".php")) ? $site_sess->url(ROOT_PATH . get_file_name(basename($file))) : "");
                }                
            }
            @closedir($handle);
            unset ($files_array);
            unset ($handle);
         }

This is no affect core ROOT PHP files of 4images. If upload new PHP file in ROOT_PATH, you can use: {url_your_new_file} in HTML template. No PHP skill need for add URL tag in template now. ;)

40
Feedback & Suggestions / [FIX] - member.php file.
« on: October 13, 2007, 07:58:57 PM »
This is fix for email.

Find:

Quote
"image_name" => stripslashes($image_name),
"file_name" => $new_name,
"cat_name" => $cat_cache[$cat_id]['cat_name'],
"validation_url" => $validation_url,
"site_name" => $config['site_name']

replace:

Code: [Select]
"image_name" => format_text(trim($image_name), 2),
"file_name" => format_text(trim($new_name), 2),
"cat_name" => format_text(trim($cat_cache[$cat_id]['cat_name']), 2),
"validation_url" => $validation_url,
"site_name" => format_text(trim($config['site_name']), 2)

41
Feedback & Suggestions / [FIX] - admin/checkimages.php file
« on: October 08, 2007, 03:39:03 PM »
This check for all extension in mime type match of includes/upload_definitions.php file and some condition fix include.

Find:

Quote
$thumb_file = 0;
    if (file_exists(THUMB_PATH.$cat_path."/".$image_name.".jpg")) {
      $thumb_file = $image_name.".jpg";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".JPG")) {
      $thumb_file = $image_name.".JPG";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".jpeg")) {
      $thumb_file = $image_name.".jpeg";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".JPEG")) {
      $thumb_file = $image_name.".JPEG";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".gif")) {
      $thumb_file = $image_name.".gif";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".GIF")) {
      $thumb_file = $image_name.".GIF";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".png")) {
      $thumb_file = $image_name.".png";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".PNG")) {
      $thumb_file = $image_name.".PNG";
    }

replace:

Code: [Select]
@include_once(ROOT_PATH . "includes/upload_definitions.php");
    if (isset($mime_type_match) && is_array($mime_type_match) && !empty($mime_type_match)) {
        foreach ($mime_type_match as $key) {
            if (strtolower($key) == $file_type || strtoupper($key) == $file_type && @file_exists(THUMB_PATH.$cat_path."/".$image_name.".".$file_type)) {
                $thumb_file = get_basefile(trim($image_name . "." . $file_type));
            }
        }
    }

Find (2 time):

Quote
if ($thumb_file) {

replace:

Code: [Select]
if (isset($thumb_file) && !empty($thumb_file)) {

Find:

Quote
show_form_footer($lang['add'], $lang['reset'], $colspan);
  }
  else {
    show_table_footer();
  }

add after:

Code: [Select]
unset ($thumb_file);

42
Feedback & Suggestions / [FIX] - includes/sessions.php file
« on: October 07, 2007, 07:11:47 PM »
[edit] - Fix cancel. PHP is check for array default if variable in function is self.

43
Feedback & Suggestions / [FIX] - global.php file
« on: October 07, 2007, 02:00:48 PM »
/* This is very important fix */

This is fix for no access global.php file if no access from root file include ROOT_PATH for define.

find:

Quote
<?php

add after:

Code: [Select]
if (!defined('ROOT_PATH')) {
    die ("Security violation");
}

I test and is work.

44
Feedback & Suggestions / [FIX] - includes/template.php file
« on: October 03, 2007, 05:15:16 AM »
Quote
- Added support for {ifno ..} tags in addition to {ifnot ..}

http://www.4homepages.de/forum/index.php?topic=13732.msg73906#msg73906

If so, {ifno ... and {endifno ... is no clean in clean_template method.

in includes/template.php file,

find:

Quote
'='.preg_quote($this->start).'if(not?)?\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',
'='.preg_quote($this->start).'endif(not?)?\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',

replace:

Code: [Select]
'='.preg_quote($this->start).'if(not|no?)?\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',
'='.preg_quote($this->start).'endif(not|no?)?\s+([A-Z0-9_]+)'.preg_quote($this->end).'=Usi',

45
Quote
when somebody add a comment with the "ñ", an accent "áéíóúàèìùòù", the "¿" or the "¡", the comment does not appear. 

Inexplicably, once sent the comment, it is possible to edit and add these symbols.

http://www.4homepages.de/forum/index.php?topic=18929

This is for fix spanish and french chars in comments and forms.

In includes/functions.php file,

find:

Quote
$text = str_replace("\\'", "'", $text);

add after:

Code: [Select]
$text = str_replace("á", "&aacute;", $text);
$text = str_replace("Á", "&Aacute;", $text);
$text = str_replace("é", "&eacute;", $text);
$text = str_replace("É", "&Eacute;", $text);
$text = str_replace("í", "&iacute;", $text);
$text = str_replace("Í", "&Iacute;", $text);
$text = str_replace("ó", "&oacute;", $text);
$text = str_replace("Ó", "&Oacute;", $text);
$text = str_replace("ú", "&uacute;", $text);
$text = str_replace("Ú", "&Uacute;", $text);
$text = str_replace("à", "&agrave;", $text);
$text = str_replace("À", "&Agrave;", $text);
$text = str_replace("è", "&egrave;", $text);
$text = str_replace("È", "&Egrave;", $text);
$text = str_replace("ì", "&igrave;", $text);
$text = str_replace("Ì", "&Igrave;", $text);
$text = str_replace("ù", "&ugrave;", $text);
$text = str_replace("Ù", "&Ugrave;", $text);
$text = str_replace("ò", "&ograve;", $text);
$text = str_replace("Ò", "&Ograve;", $text);
$text = str_replace("¡", "&iexcl;", $text);
$text = str_replace("¿", "&iquest;", $text);
$text = str_replace("ñ", "&ntilde;", $text);
$text = str_replace("Ñ", "&Ntilde;", $text);

Pages: 1 2 [3] 4 5 6 7