4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 24, 2014, 02:40:30 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
|-+  General / Allgemeines
| |-+  Programming
| | |-+  Very strange and unknown error
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: Very strange and unknown error  (Read 4199 times)
MrAndrew
Sr. Member
****
Offline Offline

Posts: 301

Thank You
-Given: 9
-Receive: 12


View Profile WWW
« on: February 26, 2011, 12:51:29 PM »

Please help me resolve this problem, i don`t understand what is the problem! I`ve this code in file msweek.php

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
<?php

$time 
time() - 60 60 24 7;
$sql "SELECT COUNT(*) AS num_rows_all
        FROM (" 
IMAGES_TABLE " i, " CATEGORIES_TABLE " c)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.image_date >= " 
$time " AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")
        "
;
        
$row $site_db->query_firstrow($sql);
$num_rows_all = (isset($row['num_rows_all'])) ? $row['num_rows_all'] : 0;

$link_arg $site_sess->url(ROOT_PATH."index.php");

$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;
  }
}

$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.image_date >= " 
$time " AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY i.image_hits DESC
        LIMIT 2"
;
        
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$msweek_new_images "<table align=\"center\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$msweek_new_images .= $lang['no_today_images'];
  
$msweek_new_images .= "</td></tr></table>";
}
else  {
  
$msweek_new_images "<table align=\"center\" 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;

    }
    
$msweek_new_images .= "<td width=\"".$imgtable_width."\" align=\"center\" >\n";

    
show_image($image_row);
    
$msweek_new_images .= $site_template->parse_template("most_rated_bit");
    
$msweek_new_images .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {

      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {

      }
      
$msweek_new_images .= "</tr>\n";
    }
  }
  
$msweek_new_images .= "</table>\n";
}  
// end else

$site_template->register_vars("msweek_images"$msweek_new_images);
unset(
$msweek_new_images);
?>

And add this path to index.php

1
include(ROOT_PATH.'msweek.php');

But i have error:

1
Fatal errorCall to a member function url() on a non-object in /home/users2/m/***/domains/***/msweek.php on line 12

Line 12 is:

1
$link_arg $site_sess->url(ROOT_PATH."index.php");

Version of the gallery 1.7.9, on my first site it work fine!

In what file maybe problem?

Thanks!

Logged

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

Posts: 3980

Thank You
-Given: 99
-Receive: 833

Vienna


View Profile WWW
« Reply #1 on: February 26, 2011, 01:19:09 PM »

hm.. for me work it, but you can try this:
insert below
this
1
global $site_sess;

mfg Andi
« Last Edit: February 26, 2011, 04:16:31 PM by Rembrandt » 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)
MrAndrew
Sr. Member
****
Offline Offline

Posts: 301

Thank You
-Given: 9
-Receive: 12


View Profile WWW
« Reply #2 on: February 26, 2011, 01:38:37 PM »

1
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/users2/m/milan/domains/planesphotos.net/msweek.php on line 2

Sad
Logged

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

Posts: 3980

Thank You
-Given: 99
-Receive: 833

Vienna


View Profile WWW
« Reply #3 on: February 26, 2011, 04:17:06 PM »

oups  Embarassed i have edit my frist post.
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)
MrAndrew
Sr. Member
****
Offline Offline

Posts: 301

Thank You
-Given: 9
-Receive: 12


View Profile WWW
« Reply #4 on: February 26, 2011, 05:32:44 PM »

1
Fatal error: Call to a member function url() on a non-object in /home/users2/m/milan/domains/planesphotos.net/msweek.php on line 13

Nothing Sad
Logged

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

Posts: 3980

Thank You
-Given: 99
-Receive: 833

Vienna


View Profile WWW
« Reply #5 on: February 26, 2011, 05:37:32 PM »

i understand this not , i have no error.
in the index.php, where you add the "include" ?
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)
MrAndrew
Sr. Member
****
Offline Offline

Posts: 301

Thank You
-Given: 9
-Receive: 12


View Profile WWW
« Reply #6 on: February 26, 2011, 06:11:52 PM »

In the first part of file:

1
2
3
4
5
6
7
8
9
10
11
$templates_used 'home,category_bit,whos_online,thumbnail_bit,thumbnail2_bit';
$main_template 'home';

define('GET_CACHES'1);
define('ROOT_PATH''./');
define('MAIN_SCRIPT'__FILE__);
define('GET_USER_ONLINE'1);
include(
ROOT_PATH.'global.php');
include(
ROOT_PATH.'msweek.php');

require(
ROOT_PATH.'includes/sessions.php');
Logged

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

Posts: 3980

Thank You
-Given: 99
-Receive: 833

Vienna


View Profile WWW
« Reply #7 on: February 26, 2011, 07:37:25 PM »

you must include below:
1
require(ROOT_PATH.'includes/sessions.php');

and this can you remove:
1
global $site_sess;
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)
MrAndrew
Sr. Member
****
Offline Offline

Posts: 301

Thank You
-Given: 9
-Receive: 12


View Profile WWW
« Reply #8 on: February 26, 2011, 07:45:03 PM »

What a .**** I`ve edited this within a 3-4 days Smile Screw my mind!!! Really thanks!!!
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.212 seconds with 19 queries.