4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 21, 2014, 10:07:44 PM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Help / Hilfe
| |-+  Bug Fixes & Patches
| | |-+  [1.7.3 - 1.7.6] After login always redirect to index.php
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 [2] 3 » »» Print
Author Topic: [1.7.3 - 1.7.6] After login always redirect to index.php  (Read 55516 times)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 554

mmm PHP...


View Profile WWW
« Reply #15 on: October 14, 2008, 11:55:29 PM »

Yes the file I have provided doesn't contain the fix. 
I have applied the mentioned change in my test site.. there also its not working .. Sad

The reason I've asked you for the file is to make sure you applied the changes in the right place and to check if its working on my site or not.
Logged

Your first three "must do" before you ask a question:
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)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
batu544
Sr. Member
****
Offline Offline

Posts: 336

Thank You
-Given: 2
-Receive: 26


View Profile WWW
« Reply #16 on: October 15, 2008, 08:51:56 AM »

ok.. V@no,
                  here is my global.php file with the fix.

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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: global.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

error_reporting(E_ERROR E_WARNING E_PARSE);
set_magic_quotes_runtime(0);
$start_time microtime();

function 
addslashes_array($array) {
  foreach (
$array as $key => $val) {
    
$array[$key] = (is_array($val)) ? addslashes_array($val) : addslashes($val);
  }
  return 
$array;
}

if (!isset(
$HTTP_GET_VARS)) {
  
$HTTP_GET_VARS    = &$_GET;
  
$HTTP_POST_VARS   = &$_POST;
  
$HTTP_COOKIE_VARS = &$_COOKIE;
  
$HTTP_POST_FILES  = &$_FILES;
  
$HTTP_SERVER_VARS = &$_SERVER;
  
$HTTP_ENV_VARS    = &$_ENV;
}

if (isset(
$HTTP_GET_VARS['GLOBALS']) || isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS'])) {
// Try to exploit PHP bug
die("Security violation");
}

if (
get_magic_quotes_gpc() == 0) {
  
$HTTP_GET_VARS    addslashes_array($HTTP_GET_VARS);
  
$HTTP_POST_VARS   addslashes_array($HTTP_POST_VARS);
  
$HTTP_COOKIE_VARS addslashes_array($HTTP_COOKIE_VARS);
}

$cat_cache = array();
$cat_parent_cache = array();
$new_image_cache = array();
$session_info = array();
$user_info = array();
$user_access = array();
$config = array();
$lang = array();
$mime_type_match = array();
$additional_image_fields = array();
$additional_user_fields = array();
$additional_urls = array();
$global_info = array();
$auth_cat_sql = array();
unset(
$self_url);
unset(
$url);
unset(
$script_url);

$db_servertype "mysql";
$db_host "localhost";
$db_name "";
$db_user "";
$db_password "";

$table_prefix "4images_";

// 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;

// 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               "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$captcha_length              5;
$captcha_wordfile            0;
$captcha_width               200;
$captcha_height              70;
$captcha_text_color          '#000000';
$captcha_text_size           25;
$captcha_text_transparency   60;
$captcha_filter_text         1;
$captcha_filter_bg           1;

@include(
ROOT_PATH.'config.php');

if (!
$cache_enable) {
  
$cache_page_index      0;
  
$cache_page_categories 0;
  
$cache_page_top        0;
  
$cache_page_rss        0;
}

if (!
$captcha_enable) {
  
$captcha_enable_comments     0;
  
$captcha_enable_upload       0;
  
$captcha_enable_registration 0;
  
$captcha_enable_postcards    0;
}

// Include default languages
@include_once(ROOT_PATH.'lang/english/main.php');
include_once(
ROOT_PATH.'includes/constants.php');
include_once(
ROOT_PATH.'includes/functions.php');

function 
clean_array($array) {
  
$search = array(
    
// Remove any attribute starting with "on" or xmlns
    
'#(<[^>]+[\x00-\x20\"\'])(on|xmlns)[^>]*>#iUu',
    
// Remove javascript: and vbscript: protocol
    
'#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*)[\\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu',
    
'#([a-z]*)[\x00-\x20]*=([\'\"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu',
    
//<span style="width: expression(alert('Ping!'));"></span>
    // Only works in ie...
    
'#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*expression[\x00-\x20]*\([^>]*>#iU',
    
'#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*behaviour[\x00-\x20]*\([^>]*>#iU',
    
'#(<[^>]+)style[\x00-\x20]*=[\x00-\x20]*([\`\'\"]*).*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*>#iUu'
  
);

  
$replace = array(
    
"$1>",
    
'$1=$2nojavascript...',
    
'$1=$2novbscript...',
    
"$1>",
    
"$1>",
    
"$1>"
  
);

  
// Remove all control (i.e. with ASCII value lower than 0x20 (space),
  // except of 0x0A (line feed) and 0x09 (tabulator)
  
$search2 =
      
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
  
$replace2 //str_repeat("\r", strlen($search2));
      
"\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D\x0D";

  foreach (
$array as $key => $val) {
    if (
is_array($val)) {
      
$val clean_array($val);
    } else {
      
$val preg_replace($search$replace$val);

      
$val str_replace("\r\n""\n"$val);
      
$val str_replace("\r",   "\n"$val);
      
$val strtr($val$search2$replace2);
      
$val str_replace("\r"''$val);  // \r === \x0D

      
do {
        
$oldval $val;
        
$val preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i'""$val);
      } while (
$oldval != $val);
    }

    
$array[$key] = $val;
  }

  return 
$array;
}

if (!
defined('IN_CP')) {
  
$HTTP_GET_VARS    clean_array($HTTP_GET_VARS);
  
$HTTP_POST_VARS   clean_array($HTTP_POST_VARS);
  
$HTTP_COOKIE_VARS clean_array($HTTP_COOKIE_VARS);
  
$HTTP_POST_FILES  clean_array($HTTP_POST_FILES);
}

//-----------------------------------------------------
//--- Useful Stuff ------------------------------------
//-----------------------------------------------------
if (isset($HTTP_GET_VARS['action']) || isset($HTTP_POST_VARS['action'])) {
  
$action = (isset($HTTP_POST_VARS['action'])) ? stripslashes(trim($HTTP_POST_VARS['action'])) : stripslashes(trim($HTTP_GET_VARS['action']));
  
$action preg_replace("/[^a-z0-9_-]+/i"""$action);
}
else {
  
$action "";
}

if (isset(
$HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) {
  
$mode = (isset($HTTP_POST_VARS['mode'])) ? stripslashes(trim($HTTP_POST_VARS['mode'])) : stripslashes(trim($HTTP_GET_VARS['mode']));
  
$mode preg_replace("/[^a-z0-9_-]+/i"""$mode);
}
else {
  
$mode "";
}

if (isset(
$HTTP_GET_VARS[URL_CAT_ID]) || isset($HTTP_POST_VARS[URL_CAT_ID])) {
  
$cat_id = (isset($HTTP_POST_VARS[URL_CAT_ID])) ? intval($HTTP_POST_VARS[URL_CAT_ID]) : intval($HTTP_GET_VARS[URL_CAT_ID]);
}
else {
  
$cat_id 0;
}

if (isset(
$HTTP_GET_VARS[URL_IMAGE_ID]) || isset($HTTP_POST_VARS[URL_IMAGE_ID])) {
  
$image_id = (isset($HTTP_POST_VARS[URL_IMAGE_ID])) ? intval($HTTP_POST_VARS[URL_IMAGE_ID]) : intval($HTTP_GET_VARS[URL_IMAGE_ID]);
}
else {
  
$image_id 0;
}

if (isset(
$HTTP_GET_VARS[URL_ID]) || isset($HTTP_POST_VARS[URL_ID])) {
  
$id = (isset($HTTP_POST_VARS[URL_ID])) ? intval($HTTP_POST_VARS[URL_ID]) : intval($HTTP_GET_VARS[URL_ID]);
}
else {
  
$id 0;
}

if (isset(
$HTTP_GET_VARS[URL_PAGE]) || isset($HTTP_POST_VARS[URL_PAGE])) {
  
$page = (isset($HTTP_POST_VARS[URL_PAGE])) ? intval($HTTP_POST_VARS[URL_PAGE]) : intval($HTTP_GET_VARS[URL_PAGE]);
if (!$page) {
    
$page 1;
  }
}
else {
  
$page 1;
}

if (isset(
$HTTP_POST_VARS['show_result']) || isset($HTTP_GET_VARS['show_result'])) {
  
$show_result 1;
}
else {
  
$show_result 0;
}

if (isset(
$HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords'])) {
  
$search_keywords = (isset($HTTP_POST_VARS['search_keywords'])) ? trim($HTTP_POST_VARS['search_keywords']) : trim($HTTP_GET_VARS['search_keywords']);
  if (
$search_keywords != "") {
    
$show_result 1;
  }
}
else {
  
$search_keywords "";
}

if (isset(
$HTTP_POST_VARS['search_user']) || isset($HTTP_GET_VARS['search_user'])) {
  
$search_user = (isset($HTTP_POST_VARS['search_user'])) ? trim($HTTP_POST_VARS['search_user']) : trim($HTTP_GET_VARS['search_user']);
  if (
$search_user != "") {
    
$show_result 1;
  }
}
else {
  
$search_user "";
}

if (isset(
$HTTP_POST_VARS['search_new_images']) || isset($HTTP_GET_VARS['search_new_images'])) {
  
$search_new_images 1;
  
$show_result 1;
}
else {
  
$search_new_images 0;
}

if (empty(
$PHP_SELF)) {
  if (!empty(
$HTTP_SERVER_VARS['PHP_SELF'])) {
    
$PHP_SELF $HTTP_SERVER_VARS["PHP_SELF"];
  }
  elseif (!empty(
$HTTP_ENV_VARS['PHP_SELF'])) {
    
$PHP_SELF $HTTP_ENV_VARS["PHP_SELF"];
  }
elseif (!empty($HTTP_SERVER_VARS['PATH_INFO'])) {
    
$PHP_SELF $HTTP_SERVER_VARS['PATH_INFO'];
  }
  else {
    
$PHP_SELF getenv("SCRIPT_NAME");
  }
}

$self_url basename($PHP_SELF);
if (empty(
$self_url) || !preg_match("/\.php$/"$self_url)) {
  
$self_url "index.php";
}

//if (getenv("QUERY_STRING")) {
//  $self_url .= "?".getenv("QUERY_STRING");
//  $self_url = preg_replace(array("/([?|&])action=[^?|&]*/", "/([?|&])mode=[^?|&]*/", "/([?|&])phpinfo=[^?|&]*/", "/([?|&])printstats=[^?|&]*/", "/[?|&]".URL_ID."=[^?|&]*/", "/[?|&]l=[^?|&]*/", "/[&?]+$/"), array("", "", "", "", "", "", ""), $self_url);
//}
//else {
  
if (preg_match("/details.php/"$self_url) && !preg_match("/[?|&]".URL_IMAGE_ID."=[^?|&]*/"$self_url) && $image_id) {
    
$self_url .= "?".URL_IMAGE_ID."=".$image_id;
  }
  elseif (
preg_match("/categories.php/"$self_url) && !preg_match("/[?|&]".URL_CAT_ID."=[^?|&]*/"$self_url)) {
    
$self_url .= "?".URL_CAT_ID."=".$cat_id;
  }
  if (isset(
$show_result) && $show_result) {
    
$self_url .= preg_match("/\?/"$self_url) ? "&amp;" "?";
    
$self_url .= "show_result=1";
  }
  if (
$page && $page != 1) {
    
$self_url .= preg_match("/\?/"$self_url) ? "&amp;" "?";
    
$self_url .= URL_PAGE."=".$page;
  }
//}

if (isset($HTTP_GET_VARS['url']) || isset($HTTP_POST_VARS['url'])) {
  
$url = (isset($HTTP_GET_VARS['url'])) ? trim($HTTP_GET_VARS['url']) : trim($HTTP_POST_VARS['url']);
}
else {
  
$url "";
}
if (empty(
$url)) {
  
$url get_basename(getenv("HTTP_REFERER"));
}
else {
  if (
$url == getenv("HTTP_REFERER")) {
    
$url "index.php";
  }
}
$url preg_replace(array("/[?|&]action=[^?|&]*/""/[?|&]mode=[^?|&]*/""/[?|&]".URL_ID."=[^?|&]*/""/[?|&]l=[^?|&]*/""/[&?]+$/"), array(""""""""""), $url);
if (
$url == $self_url || $url == "" || !preg_match("/\.php/"$url)) {
  
$url "index.php";
}

if (
defined("SCRIPT_URL") && SCRIPT_URL != "") {
  
$script_url SCRIPT_URL;
}
else {
  
$port = (!preg_match("/^(80|443)$/"getenv("SERVER_PORT"), $port_match)) ? ":".getenv("SERVER_PORT") : "";
  
$script_url  = (isset($port_match[1]) && $port_match[1] == 443) ? "https://" "http://";
  
$script_url .= (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : getenv("SERVER_NAME");
  
$script_url .= $port;

  
$dirname str_replace("\\""/"dirname($PHP_SELF));
  
$script_url .= ($dirname != "/") ? $dirname "";
}

// Check if we should redirect to the installation routine
if (!defined("4IMAGES_ACTIVE")) {
  
redirect("install.php");
}

//-----------------------------------------------------
//--- Start DB ----------------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/db_'.strtolower($db_servertype).'.php');
$site_db = new Db($db_host$db_user$db_password$db_name);

//-----------------------------------------------------
//--- 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();

$config['allowed_mediatypes'] = str_replace(" """$config['allowed_mediatypes']);
$config['allowed_mediatypes_array'] = explode(","$config['allowed_mediatypes']);
$config['allowed_mediatypes_match'] = str_replace(",""|"$config['allowed_mediatypes']);

$msg "";
$clickstream "";
define('MEDIA_PATH'ROOT_PATH.MEDIA_DIR);
define('THUMB_PATH'ROOT_PATH.THUMB_DIR);
define('MEDIA_TEMP_PATH'ROOT_PATH.MEDIA_TEMP_DIR);
define('THUMB_TEMP_PATH'ROOT_PATH.THUMB_TEMP_DIR);
define('TEMPLATE_PATH'ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH'ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");

//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

$config['language_dir_default'] = $config['language_dir'];
$l null;
if (isset(
$HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
  
$requested_l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
  if (
$requested_l != $config['language_dir'] && file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
    
$l $requested_l;
    
$config['language_dir'] = $l;
  }
}

include_once(
ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');
include_once(
ROOT_PATH."includes/db_field_definitions.php");
include_once(
ROOT_PATH.'includes/auth.php');

//-----------------------------------------------------
//--- Cache -------------------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/cache_utils.php');

//-----------------------------------------------------
//--- CAPTCHA -----------------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/captcha_utils.php');

//-----------------------------------------------------
//--- GZip Compression --------------------------------
//-----------------------------------------------------
$do_gzip_compress 0;
if (
$config['gz_compress'] == && !isset($nozip)) {
  if (
get_php_version() >= 40004) {
    if (
extension_loaded("zlib")) {
      
ob_start("ob_gzhandler");
    }
  }
  elseif (
get_php_version() > 40000) {
    if (
eregi("gzip"$HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || eregi("x-gzip"$HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
      if (
extension_loaded("zlib")) {
        
$do_gzip_compress 1;
        
ob_start();
        
ob_implicit_flush(0);
      }
    }
  }
}

if (
defined("GET_CACHES")) {
//  Line commented for T&C MOD 12/07/2008
//  $sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
    
$sql "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, terms, terms_msg
          FROM "
.CATEGORIES_TABLE."
          ORDER BY cat_order, cat_name ASC"
;
  
$result $site_db->query($sql);

  while (
$row $site_db->fetch_array($result)) {
    
$cat_cache[$row['cat_id']] = $row;
    
$cat_parent_cache[$row['cat_parent_id']][] = $row['cat_id'];
  }
  
$site_db->free_result();

  
// --------------------------------------

  
$new_cutoff time() - (60 60 24 $config['new_cutoff']);

  
$sql "SELECT cat_id, COUNT(image_id) AS new_images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_date >= 
$new_cutoff
          GROUP BY cat_id"
;
  
$result $site_db->query($sql);

  while (
$row $site_db->fetch_array($result)) {
    
$new_image_cache[$row['cat_id']] = $row['new_images'];
  }
  
$site_db->free_result();

  
// --------------------------------------

  
$sql "SELECT cat_id, COUNT(*) AS num_images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1
          GROUP BY cat_id"
;
  
$result $site_db->query($sql);

  while (
$row $site_db->fetch_array($result)) {
    
$cat_cache[$row['cat_id']]['num_images'] = $row['num_images'];
  }
  
$site_db->free_result();
//end if GET_CACHES

?>


If you need the admin password .. then I can PM it to you. Smile
Logged

batu544
Sr. Member
****
Offline Offline

Posts: 336

Thank You
-Given: 2
-Receive: 26


View Profile WWW
« Reply #17 on: October 27, 2008, 08:16:08 AM »

Hi,
        is this working with 4image with SEO MOD installed ??

Thanks
Logged

V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 554

mmm PHP...


View Profile WWW
« Reply #18 on: October 27, 2008, 08:36:21 AM »

oh, now you mentioned this....the two SEO mods we have are not fully functional, meaning there are some changes in global.php must be done to support redirections.

If you need further assistance with this issue, please reply to the MOD's topic. The problem you have is not related to 4images itself.
Logged

Your first three "must do" before you ask a question:
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)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Mike48
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 5
-Receive: 0


View Profile
« Reply #19 on: November 02, 2008, 03:16:16 PM »

Hallo,
leider bin eich ein Amateur was php betrifft,trotzdem habe ich meine Galerie zum laufen bekommen(alles per File Zilla) korrekt auf den Server geladen und es läuft auch alles bestens.

Nun meine Frage ..Wenn ich z.b Patches oder Bug Fixes in mein System verändern möchte ...wo muss ich es einbinden? Rolling Eyes
z.b index php hat eine Sicherheitslücke,die ich schliessen möchte. Wie weiss ich schon(verändern des Codes) aber nicht wie komme ich dort rein?

Wen ich die index Datei aufrufe "index php" über Dateinen bei Fille Zilla steht dort z.b ansehen/bearbeiten..Klicke ich es an um es zu öffnen.öffnet sich Microsoft Picture Premim 10 bei mir und sagt,das es
Die Datei xxxxx index.php konnte nicht geöffnet werden,da sie ein nicht unterstütztes Dateiformat hat..

Also vereinfacht..Wie komme ich an den textlichen Inhalt der php Dateien  ran..So auf keinen Fall.. Sad

bestimmt ein  grober Denkfehler von mir und für euch ein Klacks..
Wie gesagt ,bin noch dies bezüglich ein absoluter  Dummie..eher CSS und Html ist meine welt..
Aber ich lerne gerne dazu...

danke schon mal für euere Mühe..
Logged
KurtW
4images Guru
*******
Offline Offline

Posts: 2778

Thank You
-Given: 0
-Receive: 8


View Profile WWW
« Reply #20 on: November 02, 2008, 03:27:23 PM »

z.B. mit text editor  Wink
Logged

Mike48
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 5
-Receive: 0


View Profile
« Reply #21 on: November 02, 2008, 04:00:56 PM »


dachte ich mir schon.. Confused..also muss ich die datei in dieses Format ändern?
Logged
KurtW
4images Guru
*******
Offline Offline

Posts: 2778

Thank You
-Given: 0
-Receive: 8


View Profile WWW
« Reply #22 on: November 02, 2008, 04:17:43 PM »

nö, einfach .php doppelklick, editieren und speichern!
Nicht als .txt speichern
Logged

Mike48
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 5
-Receive: 0


View Profile
« Reply #23 on: November 02, 2008, 04:21:43 PM »

nö, einfach .php doppelklick, editieren und speichern!
Nicht als .txt speichern

danke dir Very Happy
Logged
arocholl
Pre-Newbie

Offline Offline

Posts: 1

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #24 on: December 09, 2008, 11:33:48 PM »

Not sure if this problem I have is the problem this thread is resolving. I tried the fix in my global.php but it didn't correct the problem.

What I have in my page is a problem after I login (tried several users including admin). The problem is it regularly logoff and I have to login back again. It is not a matter of how long I wait, I can be clicking images on the album continuosly and suddently I am not logged in anymore.

Is this a bug on 4Images or could it be because of the hosting I am using (ehostpros.com)

Any help really appreciated.

TIA
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 554

mmm PHP...


View Profile WWW
« Reply #25 on: December 10, 2008, 12:53:00 AM »

Hello and welcome to 4images forum.

If you didn't modify 4images (especially sessions.php) then there are two possibilities:
1) something wrong with your browser or your computer (perhaps other security software interference)
2) server's issue, most probably sessions don't work properly.

Well, obviously the first possibility is easy enough to trace: try on another browser and if possible on another computer.

If at the end you come to conclusion that it's the server's issue, maybe you could give us URL to your site for further investigation.
Logged

Your first three "must do" before you ask a question:
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)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
tanirtheone
Pre-Newbie

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #26 on: June 06, 2009, 01:35:20 PM »

hi V@no !!! this is arif ....

i have made a new signin page ... and the users logs in through tat page !!
but i want the user to b redirected to the previous page when they sign in from the signin page !!!

is this possible .... if yes ..plsss the fixx !!!! ?????  thnxx in advanceeE !!!! =)
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 554

mmm PHP...


View Profile WWW
« Reply #27 on: June 06, 2009, 09:52:27 PM »

Hello and welcome to 4images forum.

I don't know how your login page works, but you can try "capturing" the page visitor came from and then adding it into a hidden <input>:
1
<input type="hidden" name="url" value="blah.php" />
Logged

Your first three "must do" before you ask a question:
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)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
tanirtheone
Pre-Newbie

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #28 on: June 19, 2009, 09:10:28 PM »

www.photobangla.com

pls visit it if u hv sir.. and sorry for the late responce cz of my screwed net ..

well just did a bit of modification !!! if u want i can send u the php files.... not too big a modification was done .... but its quiet goood hope u like it !!!

welll um a noob in php ... but if u can pls explain how the input capturing thing works in a bit more detail then it will b a great help

and plus do we have a mod in which v can search the image by its ID .....
and nother mod...very imp....
by which v can dl the Image using the image ID but not he name wit which it was uploaded .... thnks in advance ur responce is highly anticipated @ V@no !!
Logged
k1lljoy
Jr. Member
**
Offline Offline

Posts: 79

Thank You
-Given: 2
-Receive: 0


View Profile WWW
« Reply #29 on: December 18, 2009, 04:21:04 AM »

Hi, V@no!  Smile
This fix also didn't work for me - always ge redirected to index.php
I have this MOD installed: Search Engine Friendly URLs aka Short URLs ( http://www.4homepages.de/forum/index.php?topic=6729.0 ), may it be the issue?  Rolling Eyes

By the way, after adding
1
2
3
4
<?php
global $url$user_info;
if (
$user_info['user_level'] == ADMIN) echo "URL: ".$url;
?>
into user_logininfo.html - I always see "URL: index.php" there...
Logged


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

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.139 seconds with 19 queries.