4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 17, 2014, 08:47:38 AM

Login with username, password and session length
Search:     Advanced search
You're looking for some 4images templates and styles? Then visit this thread to show websites with 4images templates to download.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] Invisible Settings v1.2
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: [MOD] Invisible Settings v1.2  (Read 3551 times)
Sumale.my
Addicted member
******
Offline Offline

Posts: 1785

Thank You
-Given: 156
-Receive: 75

Neverdie


View Profile
« on: November 18, 2011, 06:49:51 PM »

Deutsch Mit dieser Modifikation ist es möglich, Einstellungen vorzunehmen die im Grunde unsichtbar sind bzw. in den Dateien direkt editiert werden müssen.
Diese Modifikation erspart diesen Eingriff und kann demnach einfach über das Admin Control Panel abgewickelt werden.


Features:
  • Volle Captcha- Konfiguration
  • Volle Cache- Konfiguration
  • Volle CSRF- Konfiguration
  • Spezielle Einstellungen
  • Registration sperren/entsperren
  • Wartungsmodus + Informationstexteingabe
  • Header und Footer Script für das einfügen von weiteren Codes wie z.B Layer
  • Mehr Bilder auf der Startseite anzeigen. Einstellbar im Admin Control Panel
  • Weitere Links in die user_loginform.html und user_logininfo.html anlegen
  • User Begrüßung einschalten/ausschalten (http://www.4homepages.de/forum/index.php?topic=26932.msg145954#msg145954)
  • Neuesten Kategorien auf der Startseite ein/aus + Optionen (http://www.4homepages.de/forum/index.php?topic=27253.msg148352#msg148352)
  • Überschrift bei Kommentaren einschalten/ausschalten
  • Anzahl der Punkte für die Bewertung erhöhen
  • Bilderbeschreibung und Schlüsselwörter wahlweise als Pflichtfeld

 English [Google-Translate] With this modification it is possible to make adjustments that are basically invisible and must be edited directly in the files.
This modification eliminates this interference, and thus can easily be handled via the Admin Control Panel.


Features:

Step #1
Öffne/Open: global.php
Suche / Search:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Initialize CAPTCHA configuration
$captcha_enable              1;
$captcha_enable_comments     1;
$captcha_enable_upload       1;
$captcha_enable_registration 1;
$captcha_enable_postcards    1;
$captcha_ttf                 1;
$captcha_path                ROOT_PATH.'captcha';
$captcha_chars               "abcdefghijklmnopqrstuvwxyz123456789";
$captcha_length              6;
$captcha_wordfile            0;
$captcha_width               200;
$captcha_height              70;
$captcha_text_color          '#000000';
$captcha_text_size           20;
$captcha_text_transparency   50;
$captcha_filter_text         1;
$captcha_filter_bg           1;
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*/ Initialize CAPTCHA configuration
$captcha_enable              = 1;
$captcha_enable_comments     = 1;
$captcha_enable_upload       = 1;
$captcha_enable_registration = 1;
$captcha_enable_postcards    = 1;
$captcha_ttf                 = 1;
$captcha_path                = ROOT_PATH.'captcha';
$captcha_chars               = "abcdefghijklmnopqrstuvwxyz123456789";
$captcha_length              = 6;
$captcha_wordfile            = 0;
$captcha_width               = 200;
$captcha_height              = 70;
$captcha_text_color          = '#000000';
$captcha_text_size           = 20;
$captcha_text_transparency   = 50;
$captcha_filter_text         = 1;
$captcha_filter_bg           = 1; */
Suche / Search:
1
2
3
4
5
6
7
// Initialize CSRF protection configuration
$csrf_protection_enable      1;
$csrf_protection_frontend    1;
$csrf_protection_backend     1;
$csrf_protection_expires     7200;
$csrf_protection_name        '__csrf';
$csrf_protection_xhtml       1;
Ersetze mit / Replace with:
1
2
3
4
5
6
7
/*/ Initialize CSRF protection configuration
$csrf_protection_enable      = 1;
$csrf_protection_frontend    = 1;
$csrf_protection_backend     = 1;
$csrf_protection_expires     = 7200;
$csrf_protection_name        = '__csrf';
$csrf_protection_xhtml       = 1; */
Suche / Search:
1
2
3
4
5
6
7
8
// Initialize cache configuration
$cache_enable          0;
$cache_lifetime        3600// 1 hour
$cache_path            ROOT_PATH.'cache';
$cache_page_index      1;
$cache_page_categories 1;
$cache_page_top        1;
$cache_page_rss        1;
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
/*/ Initialize cache configuration
$cache_enable          = 0;
$cache_lifetime        = 3600; // 1 hour
$cache_path            = ROOT_PATH.'cache';
$cache_page_index      = 1;
$cache_page_categories = 1;
$cache_page_top        = 1;
$cache_page_rss        = 1; */
Suche / Search:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//-----------------------------------------------------
//--- Generate Setting --------------------------------
//-----------------------------------------------------
$sql "SELECT setting_name, setting_value
        FROM "
.SETTINGS_TABLE;
$result $site_db->query($sql);
if (!
$result) {
  echo 
$lang['no_settings'];
  exit;
}
while (
$row $site_db->fetch_array($result)) {
  
$config[$row['setting_name']] = $row['setting_value'];
}
$site_db->free_result();
Füge danach ein / Add after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$captcha_enable              $config['captcha_enable'];
$captcha_enable_comments     $config['captcha_enable_comments'];
$captcha_enable_upload       $config['captcha_enable_upload'];
$captcha_enable_registration $config['captcha_enable_registration'];
$captcha_enable_postcards    $config['captcha_enable_postcards'];
$captcha_ttf                 1;
$captcha_path                ROOT_PATH.''.$config['captcha_path'].'';
$captcha_chars               "".$config['captcha_chars']."";
$captcha_length              $config['captcha_length'];
$captcha_wordfile            $config['captcha_wordfile'];
$captcha_width               $config['captcha_width'];
$captcha_height              $config['captcha_height'];
$captcha_text_color          ''.$config['captcha_text_color'].'';
$captcha_text_size           $config['captcha_text_size'];
$captcha_text_transparency   $config['captcha_text_transparency'];
$captcha_filter_text         $config['captcha_filter_text'];
$captcha_filter_bg           $config['captcha_filter_bg'];
$csrf_protection_enable      $config['csrf_protection_enable'];
$csrf_protection_frontend    $config['csrf_protection_frontend'];
$csrf_protection_backend     $config['csrf_protection_backend '];
$csrf_protection_expires     $config['csrf_protection_expires'];
$csrf_protection_name        ''.$config['csrf_protection_name'].'';
$csrf_protection_xhtml       $config['csrf_protection_xhtml'];
$cache_enable                $config['cache_enable'];
$cache_lifetime              $config['cache_lifetime'];
$cache_path                  ROOT_PATH.''.$config['cache_path'].'';
$cache_page_index            $config['cache_page_index'];
$cache_page_categories       $config['cache_page_categories'];
$cache_page_top              $config['cache_page_top'];
$cache_page_rss              $config['cache_page_rss'];

Step #2
Öffne / Open: member.php
Suche / Search:
1
2
3
4
  if (!compare_passwords($current_user_password$user_info['user_password'])) {
    
$msg .= (($msg != "") ? "<br />" "").$lang['update_password_error'];
    
$error 1;
  }
Füge danach ein / Add after:
1
2
3
4
5
6
7
  if($config['password_minimum_onoff'] == 1)  {
  if (
strlen($HTTP_POST_VARS['user_password']) < || !preg_match("#[0-9]#"$HTTP_POST_VARS['user_password']))
  {
    
$msg .= (($msg != "") ? "<br />" "").$lang['update_password_minimum_error'];
    
$error 1;
  }
  }
Suche / Search:
1
if ($cat_id == 0)  {
Davor einfügen / Add before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  if($config['image_description_required'] == 1)  {
  if (
$image_description == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_description_required']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  }
  if(
$config['image_keywords_required'] == 1)  {
  if (
$image_keywords == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_keywords_required']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  }

Step 3
Öffne / Open: register.php
Suche / Search:
1
2
3
4
    if ($user_password == "") {
      
$msg .= (($msg != "") ? "<br />" "").$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['password']), $lang['field_required']);
      
$error 1;
    }
Füge danach ein / Add after:
1
2
3
4
5
6
	
if(
$config['password_minimum_onoff'] == 1)  {
    if (
strlen($user_password) < $config['password_minimum'] || !preg_match("#[0-9]#"$user_password)) {
      
$msg .= (($msg != "") ? "<br />" "").$lang['update_password_minimum_error'];
      
$error 1;
    }
	
}

Step #4
Öffne / Open: lang/your-lang/main.php und/and lang/your-lang/admin.php
Suche / Search:
Füge davor ein / Add above:
admin.php
1
include(ROOT_PATH.'mods/invisible_settings/lang_de.php');
main.php
1
include(ROOT_PATH.'mods/invisible_settings/lang_de_main.php');

Step #5
Öffne / Open: config.php
Suche / Search:
1
$table_prefix '4images_';
Füge danach ein / Add after:
1
2
3
4
5
6
7
$cache_enable          $config['cache_enable'];
$cache_lifetime        $config['cache_lifetime'];
$cache_path            ROOT_PATH.''.$config['cache_path'].'';
$cache_page_index      $config['cache_page_index'];
$cache_page_categories $config['cache_page_categories'];
$cache_page_top        $config['cache_page_top'];
$cache_page_rss        $config['cache_page_rss'];

Step #6
Öffne / Open: admin/settings.php
Suche / Search:
1
  show_form_footer($lang['save_changes'], ""2);
Füge davor ein / Add above:
1
include(ROOT_PATH.'mods/invisible_settings/settings.php');

Step #7
Öffne / Open: includes/page_header.php
Suche / Search:
1
2
3
//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
Füge davor ein / Add before:
1
include(ROOT_PATH.'mods/invisible_settings/page_header.php');
Suche / Search:
1
 $site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
Ersetze mit / Replace with:
1
2
3
4
5
if($config['user_gruss_onoff'] == 1)  {
  
$site_template->register_vars"lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), "<center>".$welcome."<br /><strong>"format_text($user_info['user_name'])."</strong></center>"));
}else{
  
$site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
}
Suche / Search:
1
$user_box $site_template->parse_template("user_loginform");
Füge darüber ein / Add before:
1
$site_template->register_vars"lang_loggedin_msg""<center>".$welcome."<br><br><b>"$lang['userlevel_guest']."</b></center>");
Suche / Search:
1
2
if ($action == "rateimage" && $id) {
  
$rating intval($HTTP_POST_VARS['rating']);
Füge davor ein / Add before:
1
2
3
4
5
if($config['rating_button_disabled_after_vote_suffix'] == 1)  {
$rate_suffix "_".$user_info['user_id'];
} else {
$rate_suffix "";
}
Suche / Search:
1
if ($rating && $rating <= MAX_RATING && $id) {
Ersetze mit / Replace with:
1
if ($rating && $rating <= $config['max_rating_number'] && $id) {

Step #8
Öffne / Open: templates/**TEMPLATE**/user_loginform.html
Suche / Search:
1
» <a href="{url_register}">{lang_register}</a><br>&nbsp;</td>
Ersetze mit / Replace with:
1
{is_url_register}</td>
Suche / Search:
1
<form action="{url_login}" method="post">
Davor einfügen / Add before:
1
{lang_loggedin_msg}

Step #9
Öffne / Open: register.php
Suche / Search:
1
2
3
4
5
6
7
8
9
10
11
12
//-----------------------------------------------------
//--- Signup ------------------------------------------
//-----------------------------------------------------
if ($action == "signup") {
  
$site_template->register_vars(array(
    
"lang_agreement" => $lang['agreement'],
    
"lang_agreement_terms" => $lang['agreement_terms'],
    
"lang_agree" => $lang['agree'],
    
"lang_agree_not" => $lang['agree_not']
  ));
  
$content $site_template->parse_template("register_signup");
}
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//-----------------------------------------------------
//--- Signup ------------------------------------------
//-----------------------------------------------------
if ($config['register_onoff'] == && $action == "signup") {
  
$site_template->register_vars(array(
    
"lang_agreement" => $lang['agreement'],
    
"lang_agreement_terms" => $lang['agreement_terms'],
    
"lang_agree" => $lang['agree'],
    
"lang_agree_not" => $lang['agree_not']
  ));
  
$content $site_template->parse_template("register_signup");
} else {
  
show_error_page($lang['register_onoff_error']);
}

Step #10
Öffne / Open: index.php + lightbox.php + categories.php + details.php + member.php + postcards.php + search.php + top.php
Suche / Search:
1
$site_template->print_template($site_template->parse_template($main_template));
Ersetze mit / Replace with:
1
2
3
4
5
6
7
if($config['wartung_onoff'] == 0)  {
$site_template->print_template($site_template->parse_template($main_template));
}elseif (
$user_info['user_level'] == ADMIN){
$site_template->print_template($site_template->parse_template($main_template));
}else{
$site_template->print_template($site_template->parse_template("wartung"));
}

Step #11
Öffne / Open: templates/**TEMPLATE**/header.html
Suche / Search:
Füge davor ein / Add before:
1
{site_header}

Step #12
Öffne / Open: templates/**TEMPLATE**/footer.html
Suche / Search:
Füge davor ein / Add before:
1
{site_footer}

Step #13
Öffne / Open: index.php
Suche / Search:
1
$num_new_images $config['image_cells'];
Ersetze mit / Replace with:
1
$num_new_images $config['more_images_home'];

Step #14
Öffne / Open: templates/**TEMPLATE**/user_logininfo.html
Suche / Search:
Füge danach ein / Add after:
1
{more_links_logininfo}
Suche / Search:
1
{lang_loggedin_msg}<br /><br />
Ersetze mit / Replace with:
1
{lang_loggedin_msg}<br />

Step #15
Öffne / Open: templates/**TEMPLATE**/user_loginform.html
Suche / Search:
Füge danach ein / Add after:
1
{more_links_loginform}

Step #16
Öffne / Open: index.php
Suche / Search:
1
2
3
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
Füge davor ein / Add before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if($config['new_cat_on_home_onoff'] == 1)  {
$num_new_cat $config['new_cat_on_home_menge'];
$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 NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
        GROUP BY i.cat_id DESC
        ORDER BY i.cat_id DESC
        LIMIT 
$num_new_cat";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$new_cat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_cat .= $lang['no_new_images'];
  
$new_cat .= "</td></tr></table>";
}
else  {
  
$new_cat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$new_cat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_cat .= "<td  valign=\"top\">\n";

    
show_image($image_row);
    
$new_cat .= $site_template->parse_template("thumbnail_bit");
    
$new_cat .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$new_cat .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$new_cat .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$new_cat .= "</tr>\n";
    }
  }
  
$new_cat .= "</table>\n";
// end else

$site_template->register_vars(array(
  
"new_cat_on_home" => '                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td class="head1"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="4">
                            <tr> 
                              <td class="head1" valign="top">'
.$lang['new_cat_on_home'].'</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr> 
                        <td class="head1">'
.$new_cat.'</td>
                      </tr>
                    </table>
                    <br />'
,
));
$site_template->register_vars("new_cat"$new_cat);
unset(
$new_cat);
}
Suche / Search:
1
2
$site_template->register_vars("new_images"$new_images);
unset(
$new_images);
Füge danach ein / Add after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
if($config['cat_bycat_onoff'] == 1)  {
//-----------------------------------------------------
//--- Show New Images By Category ---------------------
//-----------------------------------------------------
$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$num_news_images_bycat $config['cat_bycat_number'];
// Option Start
$bycat_in = array($config['cat_bycat']); // Change the Number in your category-id - ID ripping by commas
                           // Ändere die Nummer in deine Kategorie-ID - ID trennen durch Komma
// 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 (".implode(", "$bycat_in).") 
        ORDER BY i.image_date DESC
        LIMIT 
$num_news_images_bycat";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$news_images_bycat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$news_images_bycat .= $lang['no_news_images_bycat'];
  
$news_images_bycat .= "</td></tr></table>";
}
else  {
  
$news_images_bycat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$news_images_bycat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$news_images_bycat .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row);
    
$news_images_bycat .= $site_template->parse_template("thumbnail_bit");
    
$news_images_bycat .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$news_images_bycat .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$news_images_bycat .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$news_images_bycat .= "</tr>\n";
    }
  }
  
$news_images_bycat .= "</table>\n";
// end else

$site_template->register_vars("news_images_bycat"$news_images_bycat);
$site_template->register_vars(array(
  
"news_images_bycat_home" => '                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td class="head1"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="4">
                            <tr> 
                              <td class="head1" valign="top">'
.$config['news_images_bycat_name'].'</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr> 
                        <td class="head1">'
.$news_images_bycat.'</td>
                      </tr>
                    </table>
                    <br />'
,
));
unset(
$news_images_bycat);
}

Step #17
Step #5
Öffne / Open: includes/functions.php
Suche / Search:
1
2
3
4
5
6
7
8
9
10
11
  $rate_form "";
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  return 
true;
}
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  $rate_form "";
  if(
$config['rating_button_disabled_after_vote_onoff'] == 0)  {
  if(
$config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  }else{
    if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  } else {
  if(
$config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$rate_form rate_form($image_row['image_id'], $rate_suffix$rating);
  }
  }else{
    if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$rate_form rate_form($image_row['image_id'], $rate_suffix$rating);
  }
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  }
  return 
true;
}

function 
rate_form($id$rate_suffix ""$rating ""){
 global 
$site_template$session_info$lang$site_sess$HTTP_COOKIE_VARS$rate_suffix$config;
  
$rate_show $config['rating_button_disabled_after_vote_show_rate'];
  
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME "4images_";
  
$cookie_rated_array = isset($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix]) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix])) : array();
  
$split_list_array = array();
  if (!empty(
$session_info['rated_imgs'.$rate_suffix])) {
    
$split_list_array explode(" "$session_info['rated_imgs'.$rate_suffix]);
  }
  
$cookie_rated = array();
  foreach (
$cookie_rated_array as $key) {
    
$split explode(","$key);
    
$cookie_rated[] = $split[0];
    if (
$id == $split[0]) {
      
$rating $split[1];
    }
  }
  
$split_list = array();
  foreach (
$split_list_array as $key) {
    
$split explode(","$key);
    
$split_list[] = $split[0];
    if (
$id == $split[0]) {
      
$rating $split[1];
    }
  }
  
$no_rateform = (in_array($id$split_list) || in_array($id$cookie_rated)) ? "disabled" 0;
  
$rate_options "<option value=\"\">--</option>\n";
  for (
$i $config['max_rating_number']; $i$i--){
    
$rate_options .= "<option value=\"".$i."\"".(($i == $rating && $rate_show) ? "selected" "").">".$i."</option>\n";
  }
  
$site_template->register_vars(array(
          
"rate" => ($no_rateform && !(check_permission("auth_vote"$image_row['cat_id']) && $no_rateform)) ?  $lang['rating_finish'] : $lang['rate'],
          
"rate_options" => $rate_options,
          
"rate_button" => ($no_rateform) ? $no_rateform ""

    
));
  
$rate_form $site_template->parse_template("rate_form_disable");
  return 
$rate_form;
}
Suche / Search:
1
2
3
4
5
6
7
8
9
10
  if (check_permission("auth_vote"$image_row['cat_id'])) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  if($config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
  }else{
  if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
  }

Step #18
Öffne / Open: details.php
Suche / Search:
1
2
3
4
    if ($comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['headline_required'];
      
$error 1;
    }
Ersetze mit / Replace with:
1
2
3
4
5
6
	
if(
$config['comment_headline_onoff'] == 1)  {
    if (
$comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['headline_required'];
      
$error 1;
     }
	
}

Step #19
Öffne / Open: postcards.php
Suche / Search 2x:
1
$expiry time() - 60 60 24 POSTCARD_EXPIRY;
Ersetze mit / Replace with:
1
$expiry time() - 60 60 24 $config['days_postcards'];

Step #20
Öffne / Open: includes/search_utils.php
Suche / Search 2x:
1
MIN_SEARCH_KEYWORD_LENGTH && $len <= MAX_SEARCH_KEYWORD_LENGTH
Ersetze mit / Replace with:
1
$config['MIN_SEARCH_KEYWORD_LENGTH'] && $len <= $config['MAX_SEARCH_KEYWORD_LENGTH']

Step #21
Öffne / Open: templates/**TEMPLATE**/home.html
Suche / Search:
1
{if msg}<b>{msg}</b><br /><br />{endif msg}
Davor einfügen / Add before:
1
2
                 {new_cat_on_home}
                  {news_images_bycat_home}

Step #22
 Deutsch
- Lade [MOD]Invisible_Settings_v1_2_build_183521112011.zip herunter
- Kopiere den Ordner "mods" in deinem Rootverzeichnis, dort wo auch die index.php und config.php liegt
- Kopiere die wartung.html und rate_form_disable.html in deinem templates/**TEMPLATE**/ Verzeichnis
- Führe die install.php aus Beispiel: http://deine-seite.de/install.php

 English
- Download [MOD]Invisible_Settings_v1_2_build_183521112011.zip
- Copy the "mods" folder to your ROOT, where there is also the index.php and config.php
- Copy the wartung.html and rate_form_disable.html in your templates/**TEMPLATE**/ folder
- Run the install.php. Example: http://your-site.com/install.php

* 4i_proof.png (9.61 KB - downloaded 531 times.)
* [MOD-UPDATE]Invisible_Settings_v1_1_build_163619112011.zip (10.19 KB - downloaded 9 times.)
* [MOD]Invisible_Settings_v1_2_build_183521112011.zip (12.47 KB - downloaded 16 times.)
« Last Edit: March 18, 2012, 07:21:01 PM by Sumale.nin » Logged
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1209

Thank You
-Given: 134
-Receive: 39


View Profile WWW
« Reply #1 on: November 18, 2011, 07:53:12 PM »

eigentlich eine gute Sache, aber nutze 4images nun schon seit 2002, und habe diese Einstellungen bis jetzt nur 1x durchgeführt, beabsichtige dieses auch in den nächsten 12 Jahren nicht zu ändern.
glaube die Einstellung durchzuführen ist unproblematischer als dafür einen Mod einzubauen, den man dann bei der nächsten Version wieder einbauen muss.

Trotzdem, wer es braucht eine gute Idee

LG

Logged

Danke Harald

Rembrandt
Moderator
4images Guru
*****
Offline Offline

Posts: 3976

Thank You
-Given: 99
-Receive: 831

Vienna


View Profile WWW
« Reply #2 on: November 18, 2011, 08:15:29 PM »

Hi!

Danke fürs Veröffentlichen!

Ich sehe es ähnlich wie @Jan-Lukas, vor allem aber die CSRF Einstellungen und die Möglichkeit es mit einen klick abzuschalten.
Ein unbedarfter User kann damit auf seinen Server eine potenzielle Sicherheitslücke öffnen, ich würde es mir an deiner stelle nochmal überlegen so eine Möglichkeit anzubieten,
 vor allem wenn dann tatsächlich was passiert wie erklärst du das dann den betreffenden User?

mfg Andi
Logged

Meine 4Images Modifikationen  Now over 100 Modification Online!    Meine 4images Demo Seite


Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Sumale.my
Addicted member
******
Offline Offline

Posts: 1785

Thank You
-Given: 156
-Receive: 75

Neverdie


View Profile
« Reply #3 on: November 21, 2011, 06:26:54 PM »

UPDATE v1.1 FERTIG / UPDATE v1.1 READY
Startpost
[/size]
Trotzdem, wer es braucht eine gute Idee
Danke dir

Ihr habt ja auch Recht, aber ich zwinge ja auch niemanden so etwas zu nutzen.
Für mich ist das reine Übung und wenn daraus fertige Modifikationen entstehen, biete ich diese einfach und sehr gerne an.

Hi!

Danke fürs Veröffentlichen!

Ich sehe es ähnlich wie @Jan-Lukas, vor allem aber die CSRF Einstellungen und die Möglichkeit es mit einen klick abzuschalten.
Ein unbedarfter User kann damit auf seinen Server eine potenzielle Sicherheitslücke öffnen, ich würde es mir an deiner stelle nochmal überlegen so eine Möglichkeit anzubieten,
 vor allem wenn dann tatsächlich was passiert wie erklärst du das dann den betreffenden User?

mfg Andi

Mehr als ein Hinweis, welcher mit dem v1.1 Update jetzt dazu kam, kann ich nicht machen. Ich wollte einfach nur mal schauen ob man diese Funktionen schön und einfach über das ACP regeln kann.

Update v1.2
Deutsch
Neue Features
- User Begrüßung einschalten/ausschalten (http://www.4homepages.de/forum/index.php?topic=26932.msg145954#msg145954)
- Neuesten Kategorien auf der Startseite ein/aus + Optionen (http://www.4homepages.de/forum/index.php?topic=27253.msg148352#msg148352)
- Überschrift bei Kommentaren einschalten/ausschalten
- Anzahl der Punkte für die Bewertung erhöhen
- Bilderbeschreibung und Schlüsselwörter wahlweise als Pflichtfeld

Step #0
- Lade [MOD-UPDATE]Invisible_Settings_v1_2_build_163619112011.zip herunter
- Kopiere den Ordner "mods" in deinem Rootverzeichnis, dort wo auch die index.php und config.php liegt
- Kopiere die rate_form_disable.html in deinem templates/**TEMPLATE**/ Verzeichnis
- Führe die install_update.php aus

English
New Features
- User Welcome turn on / off (http://www.4homepages.de/forum/index.php?topic=26932.msg145954#msg145954)
- New categories on home on/off + option (http://www.4homepages.de/forum/index.php?topic=27253.msg148352#msg148352)
- Comment headline on/off
- Set more rating value
- image description and image_keywords as required field

Step #0
- Load [MOD UPDATE] Invisible_Settings_v1_2_build_163619112011.zip down
- Copy the folder "mods" in your root directory, where there is also the index.php and config.php
- Put the rate_form_disable.html in your templates/**TEMPLATE**/ folder
- Run the install_update.php

Step #1
Öffne / Open: includes/page_header.php
Suche / Search:
1
 $site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
Ersetze mit / Replace with:
1
2
3
4
5
if($config['user_gruss_onoff'] == 1)  {
  
$site_template->register_vars"lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), "<center>".$welcome."<br /><strong>"format_text($user_info['user_name'])."</strong></center>"));
}else{
  
$site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
}
Suche / Search:
1
$user_box $site_template->parse_template("user_loginform");
Füge darüber ein / Add before:
1
$site_template->register_vars"lang_loggedin_msg""<center>".$welcome."<br><br><b>"$lang['userlevel_guest']."</b></center>");
Suche / Search:
1
2
if ($action == "rateimage" && $id) {
  
$rating intval($HTTP_POST_VARS['rating']);
Füge davor ein / Add before:
1
2
3
4
5
if($config['rating_button_disabled_after_vote_suffix'] == 1)  {
$rate_suffix "_".$user_info['user_id'];
} else {
$rate_suffix "";
}
Suche / Search:
1
if ($rating && $rating <= MAX_RATING && $id) {
Ersetze mit / Replace with:
1
if ($rating && $rating <= $config['max_rating_number'] && $id) {

Step #2
Öffne / Open: templates/**TEMPLATE**/user_loginform.html
Suche / Search:
1
<form action="{url_login}" method="post">
Davor einfügen / Add before:
1
{lang_loggedin_msg}

Step #3
Öffne / Open: templates/**TEMPLATE**/user_logininfo.html
Suche / Search:
1
{lang_loggedin_msg}<br /><br />
Ersetze mit / Replace with:
1
{lang_loggedin_msg}<br />

Step #4
Öffne / Open: index.php
Suche / Search:
1
2
3
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
Füge davor ein / Add before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if($config['new_cat_on_home_onoff'] == 1)  {
$num_new_cat $config['new_cat_on_home_menge'];
$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 NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
        GROUP BY i.cat_id DESC
        ORDER BY i.cat_id DESC
        LIMIT 
$num_new_cat";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$new_cat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$new_cat .= $lang['no_new_images'];
  
$new_cat .= "</td></tr></table>";
}
else  {
  
$new_cat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$new_cat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$new_cat .= "<td  valign=\"top\">\n";

    
show_image($image_row);
    
$new_cat .= $site_template->parse_template("thumbnail_bit");
    
$new_cat .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$new_cat .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$new_cat .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$new_cat .= "</tr>\n";
    }
  }
  
$new_cat .= "</table>\n";
// end else

$site_template->register_vars(array(
  
"new_cat_on_home" => '                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td class="head1"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="4">
                            <tr> 
                              <td class="head1" valign="top">'
.$lang['new_cat_on_home'].'</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr> 
                        <td class="head1">'
.$new_cat.'</td>
                      </tr>
                    </table>
                    <br />'
,
));
$site_template->register_vars("new_cat"$new_cat);
unset(
$new_cat);
}
Suche / Search:
1
2
$site_template->register_vars("new_images"$new_images);
unset(
$new_images);
Füge danach ein / Add after:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
if($config['cat_bycat_onoff'] == 1)  {
//-----------------------------------------------------
//--- Show New Images By Category ---------------------
//-----------------------------------------------------
$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}

$num_news_images_bycat $config['cat_bycat_number'];
// Option Start
$bycat_in = array($config['cat_bycat']); // Change the Number in your category-id - ID ripping by commas
                           // Ändere die Nummer in deine Kategorie-ID - ID trennen durch Komma
// 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 (".implode(", "$bycat_in).") 
        ORDER BY i.image_date DESC
        LIMIT 
$num_news_images_bycat";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$news_images_bycat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$news_images_bycat .= $lang['no_news_images_bycat'];
  
$news_images_bycat .= "</td></tr></table>";
}
else  {
  
$news_images_bycat "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$news_images_bycat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$news_images_bycat .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row);
    
$news_images_bycat .= $site_template->parse_template("thumbnail_bit");
    
$news_images_bycat .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$news_images_bycat .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$news_images_bycat .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$news_images_bycat .= "</tr>\n";
    }
  }
  
$news_images_bycat .= "</table>\n";
// end else

$site_template->register_vars("news_images_bycat"$news_images_bycat);
$site_template->register_vars(array(
  
"news_images_bycat_home" => '                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td class="head1"> 
                          <table width="100%" border="0" cellspacing="0" cellpadding="4">
                            <tr> 
                              <td class="head1" valign="top">'
.$config['news_images_bycat_name'].'</td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr> 
                        <td class="head1">'
.$news_images_bycat.'</td>
                      </tr>
                    </table>
                    <br />'
,
));
unset(
$news_images_bycat);
}

Step #5
Öffne / Open: includes/functions.php
Suche / Search:
1
2
3
4
5
6
7
8
9
10
11
  $rate_form "";
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  return 
true;
}
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  $rate_form "";
  if(
$config['rating_button_disabled_after_vote_onoff'] == 0)  {
  if(
$config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  }else{
    if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$site_template->register_vars("rate"$lang['rate']);
    
$rate_form $site_template->parse_template("rate_form");
  }
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  } else {
  if(
$config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$rate_form rate_form($image_row['image_id'], $rate_suffix$rating);
  }
  }else{
    if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$rate_form rate_form($image_row['image_id'], $rate_suffix$rating);
  }
  }
  
$site_template->register_vars("rate_form"$rate_form);
  
$site_template->register_vars(array(
    
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$detailed_view),
  ));
  }
  return 
true;
}

function 
rate_form($id$rate_suffix ""$rating ""){
 global 
$site_template$session_info$lang$site_sess$HTTP_COOKIE_VARS$rate_suffix$config;
  
$rate_show $config['rating_button_disabled_after_vote_show_rate'];
  
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME "4images_";
  
$cookie_rated_array = isset($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix]) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'.$rate_suffix])) : array();
  
$split_list_array = array();
  if (!empty(
$session_info['rated_imgs'.$rate_suffix])) {
    
$split_list_array explode(" "$session_info['rated_imgs'.$rate_suffix]);
  }
  
$cookie_rated = array();
  foreach (
$cookie_rated_array as $key) {
    
$split explode(","$key);
    
$cookie_rated[] = $split[0];
    if (
$id == $split[0]) {
      
$rating $split[1];
    }
  }
  
$split_list = array();
  foreach (
$split_list_array as $key) {
    
$split explode(","$key);
    
$split_list[] = $split[0];
    if (
$id == $split[0]) {
      
$rating $split[1];
    }
  }
  
$no_rateform = (in_array($id$split_list) || in_array($id$cookie_rated)) ? "disabled" 0;
  
$rate_options "<option value=\"\">--</option>\n";
  for (
$i $config['max_rating_number']; $i$i--){
    
$rate_options .= "<option value=\"".$i."\"".(($i == $rating && $rate_show) ? "selected" "").">".$i."</option>\n";
  }
  
$site_template->register_vars(array(
          
"rate" => ($no_rateform && !(check_permission("auth_vote"$image_row['cat_id']) && $no_rateform)) ?  $lang['rating_finish'] : $lang['rate'],
          
"rate_options" => $rate_options,
          
"rate_button" => ($no_rateform) ? $no_rateform ""

    
));
  
$rate_form $site_template->parse_template("rate_form_disable");
  return 
$rate_form;
}
Suche / Search:
1
2
3
4
5
6
7
8
9
10
  if (check_permission("auth_vote"$image_row['cat_id'])) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
Ersetze mit / Replace with:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  if($config['rating_disable_for_author'] == 1)  {
  if (
check_permission("auth_vote"$image_row['cat_id'])) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
  }else{
  if (
check_permission("auth_vote"$image_row['cat_id']) && $user_info['user_id'] != $image_row['user_id']) {
    
$old_votes $image_row['image_votes'];
    
$old_rating $image_row['image_rating'];
    
$new_rating = (($old_rating $old_votes) + $rating) / ($old_votes 1);
    
$new_rating sprintf("%.2f"$new_rating);
    
$sql "UPDATE ".IMAGES_TABLE."
            SET image_votes = (
$old_votes + 1), image_rating = '$new_rating'
            WHERE image_id = 
$image_id";
    
$site_db->query($sql);
  }
  }


Step #6
Öffne / Open: details.php
Suche / Search:
1
2
3
4
    if ($comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['headline_required'];
      
$error 1;
    }
Ersetze mit / Replace with:
1
2
3
4
5
6
	
if(
$config['comment_headline_onoff'] == 1)  {
    if (
$comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" "").$lang['headline_required'];
      
$error 1;
     }
	
}

Step #7
Öffne / Open: postcards.php
Suche / Search 2x:
1
$expiry time() - 60 60 24 POSTCARD_EXPIRY;
Ersetze mit / Replace with:
1
$expiry time() - 60 60 24 $config['days_postcards'];

Step #8
Öffne / Open: includes/search_utils.php
Suche / Search 2x:
1
MIN_SEARCH_KEYWORD_LENGTH && $len <= MAX_SEARCH_KEYWORD_LENGTH
Ersetze mit / Replace with:
1
$config['MIN_SEARCH_KEYWORD_LENGTH'] && $len <= $config['MAX_SEARCH_KEYWORD_LENGTH']

Step #9
Öffne / Open: member.php
Suche / Search:
1
if ($cat_id == 0)  {
Davor einfügen / Add before:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  if($config['image_description_required'] == 1)  {
  if (
$image_description == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_description_required']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  }
  if(
$config['image_keywords_required'] == 1)  {
  if (
$image_keywords == "")  {
    
$error 1;
    
$field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_keywords_required']), $lang['field_required']);
    
$msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  }
 
Step #10
Öffne / Open: templates/**TEMPLATE**/home.html
Suche / Search:
1
{if msg}<b>{msg}</b><br /><br />{endif msg}
Davor einfügen / Add before:
1
2
                  {new_cat_on_home}
                  {news_images_bycat_home}

Logged
wallward
Jr. Member
**
Offline Offline

Posts: 52

Thank You
-Given: 273
-Receive: 0


View Profile
« Reply #4 on: June 01, 2012, 01:51:07 PM »

please english version
Logged

Saschilys
Jr. Member
**
Offline Offline

Posts: 51

Thank You
-Given: 5
-Receive: 0


View Profile
« Reply #5 on: June 01, 2012, 03:17:32 PM »

Hmm?
Look again!
Logged
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1209

Thank You
-Given: 134
-Receive: 39


View Profile WWW
« Reply #6 on: June 01, 2012, 05:39:28 PM »


Please
Logged

Danke Harald

wallward
Jr. Member
**
Offline Offline

Posts: 52

Thank You
-Given: 273
-Receive: 0


View Profile
« Reply #7 on: January 19, 2014, 09:26:16 AM »

Is it necessary in 1.7.11?
Logged

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
piqs.de - Fotocommunity & lizenzfreie Fotos
Page created in 0.21 seconds with 21 queries.