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.


Messages - Sunny C.

Pages: 1 2 3 [4] 5 6 7 8 ... 116
46
Feedback & Suggestions / Re: 4images 1.8 - Feedback
« 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
search:
if ($action == "") {
  
$action "modifycomments";
}

add after
$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
  <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

  
<select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>

search
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby "i.image_name";

replace with
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby "i.image_name";
  }

search
  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
  $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
search
if ($action == "") {
  
$action "modifyimages";
}

add after
$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
  <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
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>

search
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby "i.image_name";
  }

replace with
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby "i.image_name";
  }

search
  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
  $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
search
Code: [Select]
<body onload="start_animation()">replace with
Code: [Select]
<body onLoad="start_animation()">

Open: admin/users.php
Quote
search
if ($action == "") {
  
$action "modifyusers";
}

add after
$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
  <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
  <select name="orderby">
  <?
php foreach ($orderbyOptions as $field => $label): ?>
  <option value="<?php echo $field?>"><?php echo $label?></option>
  <?php endforeach; ?>
  </select>

search
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (
$orderby == "") {
    
$orderby get_user_table_field("""user_name");
  }

replace with
  $orderby trim($HTTP_POST_VARS['orderby']);
  if (!isset(
$orderbyOptions[$orderby])) {
    
$orderby get_user_table_field("""user_name");
  }

search
  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
  $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
search
  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
  $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
  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
  $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
  <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
  <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
search
define('SCRIPT_VERSION''1.7.13');
replace with
define('SCRIPT_VERSION''1.8');

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

  function 
escape($value) {
    return 
mysql_real_escape_string($value$this->connection);
  }

replace with
    mysql_set_charset('utf8'$this->connection);
    return 
$this->connection;
  }

  function 
escape($value) {
    return 
mysql_real_escape_string($value$this->connection);
  }

search
$this->error("<b>Bad SQL Query</b>: ".htmlentities($query)."<br /><b>".mysql_error()."</b>");
replace with
$this->error("<b>Bad SQL Query</b>: ".safe_htmlspecialchars($query)."<br /><b>".safe_htmlspecialchars(mysql_error())."</b>");

Open: includes/email.php
Quote
search
  function Email() {
replace with
  function __construct() {
search
global $config;
add after
global $lang;
search
    return $header;
  }

replace with
    $header .= "Content-Type: text/plain; charset=" strtolower($lang['charset']) . "\r\n";
    return 
$header;
  }


Open: includes/page_header.php
Quote
search
if ($csrf_protection_enable && $csrf_protection_frontend) {
    
csrf_start(true);
}

add after
if (!headers_sent()) {
  
header('Content-Type: text/html;charset=' $lang['charset'], true);
}


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

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

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

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

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

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

47
Feedback & Suggestions / Re: Support for PHP 7?
« on: November 13, 2016, 02:27:08 AM »
Find the 4images 1.8 beta (PHP 7 ready) attached to this post.

The final version will be realeased the next 2 weeks.

 :| :roll:

48
Discussion & Troubleshooting / Re: PHP 5.6 oder 7.0
« on: August 07, 2016, 08:08:11 PM »
Quote
More and more hosting companies are offering PHP hosting with the new version 7 of the scripting language PHP.

A new version of 4images with support for PHP7 is on it’s way. We are planning the release for march 2016.

Was ja schon seit 4 Monaten vorbei ist.

49
Requests for paid modifications / Jobbörse / Re: Data Backup
« on: April 14, 2016, 07:25:18 PM »
Benutze http://www.mysqldumper.de/ für deine Datenbank. Damit ist sie Save.
Und Speichere alle Dateien + Ordner wo sich auch deine config.php befindet.

51
Installation, Update & Configuration / Re: Fehler bei Addons
« on: November 19, 2015, 01:04:03 AM »
Klick mal im entsprechenden Thread folgende Punkte an:
- Example Mod with "radio" Button
- Example Mod with "textarea"

Dort wird dir beschrieben was du machen kannst!

LG

52
Mods & Plugins (Releases & Support) / Re: Signature image v2.3
« on: November 17, 2015, 01:31:54 PM »
@Jan,
das kann ich bestätigen.

Das Problem ist der Browser.
Beide Signaturen heissen gleich: katalog.png > Führt zu Probleme in der Cache, war jedenfalls bei mir so.
Eine davon umbenennen und das Problem ist behoben.

Signatur 1: http://www.ue-ei-portal-sammlerkatalog.de/katalog.png
Signatur 2: http://www.online-fremdfigurenkatalog.de//katalog.png (Ein Slash zu viel)

LG

53
Mods & Plugins (Requests & Discussions) / Re: Forum in 4images?
« on: November 01, 2015, 02:52:09 PM »
Die Idee ist ja wirklich Top, aber dann kommt wieder das Problem hinzu, wenn du aus zeitlichen Gründen oder Lust etc. nicht weiter an dem Forum arbeitest, wird es dann logischerweise nicht weiterentwickelt.
Somit müsste dann jeder früher oder später auf eine externe Variante ausweichen.

Ich würde dir dann wenigstens Empfehlen, einen Importer direkt mitzuliefern oder wenigstens hinterher einen nachzurüsten.

LG

54
Mods & Plugins (Requests & Discussions) / Re: Forum in 4images?
« on: October 27, 2015, 01:15:33 PM »
Scarla,
es würde doch schon reichen, wenn du eine komplette Brücke für 4images und diversen Forensystemen schreiben würdest.

vBulletin / Xenforo / Woltlab Burningboard 4

LG

55
Very nice !

57
Suche:
  $sql 
	
"SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
  
	
	
	
FROM "
.WORDLIST_TABLE." i
	
	
	
LEFT JOIN "
.WORDMATCH_TABLE." c ON i.word_id = c.word_id
	
	
	
WHERE keys_match > 0
  
	
	
	
GROUP BY i.word_text
  
	
	
	
ORDER BY  RAND()
	
	
	
LIMIT 20"
;

Ersetze mit

  $sql 
	
"SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
  
	
	
	
FROM "
.WORDLIST_TABLE." i
	
	
	
LEFT JOIN "
.WORDMATCH_TABLE." c ON i.word_id = c.word_id
  
	
	
	
GROUP BY i.word_text
  
	
	
	
ORDER BY  RAND()
	
	
	
LIMIT 20"
;


Dann sollte der Fehler weg sein.
Es wurde lediglich folgendes entfernt

WHERE keys_match > 0

oder ändern in "WHERE keys_match >= 0"

58
Die Idee ist ganz cool.
So könnte man das dann dynmaisch ausgeben und muss nicht für jede Kategorie neuen Code benutzen.

Nicht getestet,
aber eventuell so?


$additional_sql 
"";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}
 
$num_new_media_cat $config['image_cells'];
// Option Start
foreach (explode(',''1,2,3') as $var) {
// Option Ende
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN ("
.get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".$var.")
        ORDER BY i.image_date DESC
        LIMIT 
$num_new_media_cat";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$new_media_cat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_media_cat .= $lang['no_new_media_cat'];
  
$new_media_cat .= "</td></tr></table>";
}
else  {
    while (
$image_row $site_db->fetch_array($result)){
    
show_image($image_row);
    
$new_media_cat .= $site_template->parse_template("new_media_cat");
  } 
// end while
// end else
	

$site_template->register_vars(array(
  
"new_media_cat_" $var "" => $new_media_cat
));
}
unset(
$new_media_cat); 

59
Chit Chat / Re: I am back ; )
« on: October 14, 2014, 05:55:16 PM »
Welcome Back !

60
Wenn ein Bildname sich "Künster - Bildname" nennt und die Keywords auto generiert werden. Wie bekomme ich das "-" aus den Keywords weg? Denn er erstellt die K-Words so "Künstler,-,Bildname" !?

Pages: 1 2 3 [4] 5 6 7 8 ... 116