4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 19, 2018, 12:44:11 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Issues / Ausgaben
| |-+  Feedback & Suggestions
| | |-+  4images 1.8 - Feedback (Moderator: Acidgod)
| | | |-+  Message #166615
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 » »» Print
Author Topic: 4images 1.8 - Feedback  (Read 8473 times)
Sumale.my
Addicted member
******
Offline Offline

Posts: 1768

Thank You
-Given: 167
-Receive: 83

Neverdie


View Profile
« on: November 17, 2016, 11:20:36 PM »

Here is a detailed list of what has been changed in the php files from 4images 1.7.13 -> 1.8.
(The best way for yourself to compare the code of files is to use Winmerge.)


Open: admin/comments.php
Quote  [Expand]
search:
1
2
3
if ($action == "") {
  
$action "modifycomments";
}
add after
1
2
3
4
5
6
7
$orderbyOptions = array(
  
'i.image_name' => $lang['field_image_name'],
  
'c.image_id' => $lang['image'] . ' ID',
  
'c.user_name' => $lang['field_username'],
  
'c.comment_headline' => $lang['field_headline'],
  
'c.comment_date' => $lang['field_date'],
);
search
1
2
3
4
5
6
7
  <select name="orderby">
  <
option value="i.image_name" selected><?php echo $lang['field_image_name'?></option>
  <option value="c.image_id" selected><?php echo $lang['image'?> ID</option>
  <option value="c.user_name"><?php echo $lang['field_username'?></option>
  <option value="c.comment_headline"><?php echo $lang['field_headline'?></option>
  <option value="c.comment_date"><?php echo $lang['field_date'?></option>
  </select>
replace with
1
2
3
4
5
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>
search
1
2
3
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby "i.image_name";
replace with
1
2
3
4
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby "i.image_name";
  }
search
1
2
3
4
5
6
  if (isset($HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$direction = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);
  }
  else {
    
$direction "ASC";
  }
replace with
1
2
3
4
5
6
7
8
  $direction "ASC";
  if (isset(
$HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$requestedDirection = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);

    if (
'DESC' === $requestedDirection) {
      
$direction "DESC";
    }
  }

Open: admin/images.php
Quote  [Expand]
search
1
2
3
if ($action == "") {
  
$action "modifyimages";
}
add after
1
2
3
4
5
6
7
8
9
10
11
$orderbyOptions = array(
  
'i.image_name' => $lang['field_image_name'],
  
'i.image_media_file' => $lang['field_image_file'],
  
'i.image_thumb_file' => $lang['field_thumb_file'],
  
'i.cat_id' => $lang['field_category'],
  
'i.image_date' => $lang['field_date'],
  
'i.image_downloads' => $lang['field_downloads'],
  
'i.image_rating' => $lang['field_rating'],
  
'i.image_votes' => $lang['field_votes'],
  
'i.image_hits' => $lang['field_hits'],
);
search
1
2
3
4
5
6
7
8
9
10
11
  <select name="orderby">
  <
option value="i.image_name" selected><?php echo $lang['field_image_name'?></option>
  <option value="i.image_media_file"><?php echo $lang['field_image_file'?></option>
  <option value="i.image_thumb_file"><?php echo $lang['field_thumb_file'?></option>
  <option value="i.cat_id"><?php echo $lang['field_category'?></option>
  <option value="i.image_date"><?php echo $lang['field_date'?></option>
  <option value="i.image_downloads"><?php echo $lang['field_downloads'?></option>
  <option value="i.image_rating"><?php echo $lang['field_rating'?></option>
  <option value="i.image_votes"><?php echo $lang['field_votes'?></option>
  <option value="i.image_hits"><?php echo $lang['field_hits'?></option>
  </select>
replace with
1
2
3
4
5
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>
search
1
2
3
4
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby "i.image_name";
  }
replace with
1
2
3
4
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby "i.image_name";
  }
search
1
2
3
4
5
6
  if (isset($HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$direction = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);
  }
  else {
    
$direction "ASC";
  }
replace with
1
2
3
4
5
6
7
8
  $direction "ASC";
  if (isset(
$HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$requestedDirection = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);

    if (
'DESC' === $requestedDirection) {
      
$direction "DESC";
    }
  }

Open: admin/progress.php
Quote  [Expand]
search
1
<body onload="start_animation()">
replace with
1
<body onLoad="start_animation()">

Open: admin/users.php
Quote  [Expand]
search
1
2
3
if ($action == "") {
  
$action "modifyusers";
}
add after
1
2
3
4
5
6
$orderbyOptions = array(
  
get_user_table_field("""user_name") => $lang['field_username'],
  
get_user_table_field("""user_email") => $lang['field_email'],
  
get_user_table_field("""user_joindate") => $lang['field_joindate'],
  
get_user_table_field("""user_lastaction") => $lang['field_lastaction'],
);
search
1
2
3
4
5
6
  <select name="orderby">
  <
option value="<?php echo get_user_table_field("", "user_name"); ?>" selected><?php echo $lang['field_username']; ?></option>
  <option value="<?php echo get_user_table_field("""user_email"); ?>"><?php echo $lang['field_email']; ?></option>
  <option value="<?php echo get_user_table_field("""user_joindate"); ?>"><?php echo $lang['field_joindate']; ?></option>
  <option value="<?php echo get_user_table_field("""user_lastaction"); ?>"><?php echo $lang['field_lastaction']; ?></option>
  </select>
replace with
1
2
3
4
5
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>
search
1
2
3
4
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby get_user_table_field("""user_name");
  }
replace with
1
2
3
4
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby get_user_table_field("""user_name");
  }
search
1
2
3
4
5
6
  if (isset($HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$direction = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);
  }
  else {
    
$direction "ASC";
  }
replace with
1
2
3
4
5
6
7
8
  $direction "ASC";
  if (isset(
$HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$requestedDirection = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);

    if (
'DESC' === $requestedDirection) {
      
$direction "DESC";
    }
  }

Open: admin/validateimages.php
Quote  [Expand]
search
1
2
3
4
5
6
  if (isset($HTTP_GET_VARS['orderby']) || isset($HTTP_POST_VARS['orderby'])) {
    
$orderby = (isset($HTTP_GET_VARS['orderby'])) ? stripslashes(trim($HTTP_GET_VARS['orderby'])) : stripslashes(trim($HTTP_POST_VARS['orderby']));
  }
  else {
    
$orderby "i.image_date";
  }
replace with
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  $orderbyOptions = array(
    
'i.image_name' => $lang['field_image_name'],
    
'i.cat_id' => $lang['field_category'],
    
'i.image_date' => $lang['field_date'],
    
get_user_table_field("u.""user_name") => $lang['field_username']
  );

  
$orderby "i.image_date";

  if (isset(
$HTTP_GET_VARS['orderby']) || isset($HTTP_POST_VARS['orderby'])) {
    
$requestedOrderby = (isset($HTTP_GET_VARS['orderby'])) ? stripslashes(trim($HTTP_GET_VARS['orderby'])) : stripslashes(trim($HTTP_POST_VARS['orderby']));

    if (isset(
$orderbyOptions[$requestedOrderby])) {
      
$orderby $requestedOrderby;
    }
  }
search
1
2
3
4
5
6
  if (isset($HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$direction = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);
  }
  else {
    
$direction "ASC";
  }
replace with
1
2
3
4
5
6
7
8
  $direction "ASC";
  if (isset(
$HTTP_GET_VARS['direction']) || isset($HTTP_POST_VARS['direction'])) {
    
$requestedDirection = (isset($HTTP_GET_VARS['direction'])) ? trim($HTTP_GET_VARS['direction']) : trim($HTTP_POST_VARS['direction']);

    if (
'DESC' === $requestedDirection) {
      
$direction "DESC";
    }
  }
search
1
2
3
4
5
6
  <select name="orderby">
  <
option value="i.image_name" selected><?php echo $lang['field_image_name'?></option>
  <option value="i.cat_id"><?php echo $lang['field_category'?></option>
  <option value="i.image_date"><?php echo $lang['field_date'?></option>
  <option value="<?php echo get_user_table_field("u.""user_name"); ?>"><?php echo $lang['field_username'?></option>
  </select>
replace with
1
2
3
4
5
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>

Open: includes/constants.php
Quote  [Expand]
search
1
define('SCRIPT_VERSION''1.7.13');
replace with
1
define('SCRIPT_VERSION''1.8');

Open: includes/db_mysql.php
Quote  [Expand]
search
1
  function Db($db_host$db_user$db_password ""$db_name ""$db_pconnect 0) {
replace with
1
  function __construct($db_host$db_user$db_password ""$db_name ""$db_pconnect 0) {
search
1
$this->error("Could not connect to the database server ($db_host$db_user)."1);
replace with
1
$this->error("Could not connect to the database server (".safe_htmlspecialchars($db_host).", ".safe_htmlspecialchars($db_user).")."1);
search
1
$this->error("Could not select database ($db_name)."1);
replace with
1
$this->error("Could not select database (".safe_htmlspecialchars($db_name).")."1);
search
1
2
3
4
5
6
    return $this->connection;
  }

  function 
escape($value) {
    return 
mysql_real_escape_string($value$this->connection);
  }
replace with
1
2
3
4
5
6
7
    mysql_set_charset('utf8'$this->connection);
    return 
$this->connection;
  }

  function 
escape($value) {
    return 
mysql_real_escape_string($value$this->connection);
  }
search
1
$this->error("<b>Bad SQL Query</b>: ".htmlentities($query)."<br /><b>".mysql_error()."</b>");
replace with
1
$this->error("<b>Bad SQL Query</b>: ".safe_htmlspecialchars($query)."<br /><b>".safe_htmlspecialchars(mysql_error())."</b>");

Open: includes/email.php
Quote  [Expand]
search
1
  function Email() {
replace with
1
  function __construct() {
search
1
global $config;
add after
1
global $lang;
search
1
2
    return $header;
  }
replace with
1
2
3
    $header .= "Content-Type: text/plain; charset=" strtolower($lang['charset']) . "\r\n";
    return 
$header;
  }

Open: includes/page_header.php
Quote  [Expand]
search
1
2
3
if ($csrf_protection_enable && $csrf_protection_frontend) {
    
csrf_start(true);
}
add after
1
2
3
if (!headers_sent()) {
  
header('Content-Type: text/html;charset=' $lang['charset'], true);
}

Open: includes/paging.php
Quote  [Expand]
search
1
 function Paging($page 1$perpage 0$num_rows_all 0$link_args "") {
replace with
1
  function __construct($page 1$perpage 0$num_rows_all 0$link_args "") {

Open: includes/sessions.php
Quote  [Expand]
search
1
  function Session() {
replace with
1
 function __construct() {

Open: includes/template.php
Quote  [Expand]
search
1
  function Template($template_path "") {
replace with
1
  function __construct($template_path "") {

Open: includes/upload.php
Quote  [Expand]
search
1
  function Upload() {
replace with
1
  function __construct() {

Open: includes/zip.php
Quote  [Expand]
search
1
 function Zipfile($level 9) {
replace with
1
  function __construct($level 9) {

Open: lang/(deutsch/spanish/english)/main.php
Quote  [Expand]
search
1
$lang['charset'] = "iso-8859-1";
replace with
1
$lang['charset'] = "UTF-8";

Follow members gave a thank to your post:
ASAD, Nosferatu, Jan-Lukas

For this post, 3 members gave a thank you!
« Last Edit: November 19, 2016, 05:44:26 PM by Sumale.my » Logged
Pages: [1] 2 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.127 seconds with 23 queries.