Please help me resolve this problem, i don`t understand what is the problem! I`ve this code in file msweek.php
<?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++ % 2 == 0) ? 1 : 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
include(ROOT_PATH.'msweek.php');
But i have error:
Fatal error: Call to a member function url() on a non-object in /home/users2/m/***/domains/***/msweek.php on line 12
Line 12 is:
$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!