Hi all, I saw your guys site while browsing forums for help and you guys seem most knowledgeable.
Here is my problem, I just uploaded some script to a site of mine, and now I'm getting this error message:
Parse error: syntax error, unexpected T_LNUMBER, expecting '{' in /home/mickeylo/public_html/index.php on line 18
looking on line 18 I'm not sure if that means I need to add an {, but I am not sure where, can anyone please help me? I'm new at this, thanks so much!
<?php
/* (C) ABK-Soft Ltd., 2004-2006
IMPORTANT: This is a commercial software product
and any kind of using it must agree to the ABK-Soft
Ltd. license agreement.
It can be found at http://abk-soft.com/license.doc
This notice may not be removed from the source code. */
if (file_exists(dirname(__FILE__) . '/!install')) {
echo 'Please delete the "./!install" folder for security reasons.';
die;
}
#$area = "public";
include("./_include/core/main_start.php");
if ($g_user['user_id'] > 0 and !isset($gc) and get_param("cmd", "") != "logout") redirect('home.php');
class CIndex extends CHeader 18
{
function action()
{
if ((int) get_param("p", "") != 0)
{
set_session("partner", (int) get_param("p", ""));
}
if (get_param("cmd", "") == "logout")
{
set_session("user_id", "");
set_session("user_id_verify", "");
set_cookie("c_user", "", -1);
set_cookie("c_password", "", -1);
redirect("index.php");
}
}
function parseBlock(&$html)
{
global $g;
global $l;
global $g_info;
global $g_user;
$html->setvar('user', htmlspecialchars(strip_tags((get_param("user")))));
$html->setvar('password', htmlspecialchars(strip_tags((get_param("password")))));
if ($g['options']['main_users'] == "Y" and $html->blockexists("users"))
{
$i = 0;
DB::query("
SELECT u.user_id, u.name, u.orientation, u.gender, YEAR(FROM_DAYS(TO_DAYS('" . date('Y-m-d H:i:s') . "')-TO_DAYS(birth))) AS age
FROM user AS u
WHERE u.is_photo='Y' AND u.hide_time=0
ORDER BY u.rating DESC
LIMIT " . $g['options']['main_users_number'] . "
");
while ($row = DB::fetch_row())
{
$i++;
if ($i == 4) $html->parse("newline", false);
else $html->setblockvar("newline", "");
if (!isset($row['photo_id'])) $row['photo_id'] = DB::result("SELECT photo_id FROM photo WHERE user_id=" . $row['user_id'] . " " . $g['sql']['photo_vis'] . " LIMIT 1", 0, 2);
if ($row['photo_id'] != "" and file_exists($g['path']['dir_files'] . "photo/" . $row['user_id'] . "_" . $row['photo_id'] . "_s.jpg")) $row['photo'] = "photo/" . $row['user_id'] . "_" . $row['photo_id'] . "_" . $g['options']['main_users_photo_size'] . ".jpg";
else $row['photo'] = "nophoto_" . $row['gender'] . "_" . $g['options']['main_users_photo_size'] . ".jpg";
foreach ($row as $k => $v) $html->setvar($k, $v);
$html->parse("user", true);
}
$html->parse("users", true);
}
if ($g['options']['main_search'] == "Y" and $html->blockexists("search"))
{
$html->setvar("p_age_from_options", n_options($g['options']['users_age'], $g['options']['users_age_max'], get_param("p_age_from", $g['options']['users_age'])));
$html->setvar("p_age_to_options", n_options($g['options']['users_age'], $g['options']['users_age_max'], get_param("p_age_to", $g['options']['users_age_max'])));
$html->setvar("orientation_options", DB::db_options("SELECT search AS id, title FROM const_orientation ORDER BY const_orientation.id", 'first'));
$html->parse("search", true);
}
if ($g['options']['videogallery'] == "Y" and $html->blockexists("videos"))
{
DB::query("SELECT * FROM videogallery_video WHERE featured='YES' AND status = 'ACTIVE' AND brodcast='PUBLIC' ORDER BY id DESC LIMIT 4");
while ($row = DB::fetch_row())
{
foreach ($row as $k => $v) $html->setvar("video_" . $k, $v);
$html->setvar("video_video_image", str_replace(".", "_m.", $row['video_image']));
$video_name = DB::query("SELECT name FROM user WHERE user_id=" . $row['user_id'] . "", 2);
if (strlen($video_name) < 3) $video_name = "";
$html->setvar("video_name", $video_name);
$html->parse("video_item", true);
}
$html->setvar("total_videos", DB::result("SELECT COUNT(*) FROM videogallery_video"));
$html->parse("videos", true);
}
if ($g['options']['videogallery'] == "Y" and $html->blockexists("video2"))
{
DB::query("SELECT * FROM videogallery_video WHERE id=" . $g['main_page']['big_video'] . "");
while ($row = DB::fetch_row())
{
foreach ($row as $k => $v) $html->setvar("video2_" . $k, $v);
$html->setvar("video2_video_image", str_replace(".", "_b.", $row['video_image']));
$video_name = DB::query("SELECT name FROM user WHERE user_id=" . $row['user_id'] . "", 2);
if (strlen($video_name) < 3) $video_name = $l['all']['blank'];
$html->setvar("video2_name", $video_name);
}
$html->parse("video2", true);
}
if ($g['options']['blogs'] == "Y" and $html->blockexists("blogs"))
{
DB::query("SELECT id, subject, msg FROM blog_msg WHERE id IN (" . $g['main_page']['blog1'] . ", " . $g['main_page']['blog2'] . ") ORDER BY id DESC LIMIT 2");
while ($row = DB::fetch_row())
{
$html->setvar("blog_id", $row['id']);
$html->setvar("blog_title", strip_tags($row['subject']));
$html->setvar("blog_msg", strip_tags(strlen($row['msg']) > 250 ? substr($row['msg'], 0, 255) . "..." : $row['msg']));
#$blog_name = DB::query("SELECT name FROM user WHERE user_id=" . $row['user_id'] . "", 2);
#if (strlen($blog_name) < 3) $blog_name = $l['all']['blank'];
#$html->setvar("blog_name", $blog_name);
if (file_exists($g['path']['dir_main'] . "_files/blog/" . $row['id'] . ".jpg")) $html->parse("blog_image", false);
else $html->setblockvar("blog_image", "");
$html->parse("blog_item", true);
}
$html->parse("blogs", true);
}
if ($html->blockexists("ad1") and $html->blockexists("ad2"))
{
$j = 1;
for ($i = 1; $i <= 4; $i++) {
DB::query("SELECT id, subject, user_id, created, '" . to_sql($g['main_page']['ad' . $i . 't'], 'Plain') . "' AS tablename FROM adv_" . to_sql($g['main_page']['ad' . $i . 't'], 'Plain') . " WHERE id=" . to_sql($g['main_page']['ad' . $i . '']) . "");
if ($row = DB::fetch_row()) {
$r[$j] = $row;
$r[$j]['username'] = DB::result("SELECT name FROM user WHERE user_id=" . $row['user_id'] . "", 0, 4);
$j++;
}
}
for ($i = 1; $i <= 2; $i++) {
if (isset($r[$i])) {
$html->setvar("ad_id", $r[$i]['id']);
$html->setvar("username", $r[$i]['username']);
$html->setvar("tablename", $r[$i]['tablename']);
$html->setvar("subject", $r[$i]['subject']);
$html->parse("ad1", true);
}
}
for ($i = 3; $i <= 4; $i++) {
if (isset($r[$i])) {
$html->setvar("ad_id", $r[$i]['id']);
$html->setvar("username", $r[$i]['username']);
$html->setvar("tablename", $r[$i]['tablename']);
$html->setvar("subject", $r[$i]['subject']);
$html->parse("ad2", true);
}
}
}
foreach ($g_info as $k => $v) $html->setvar($k, $v);
$html->setvar("login_message", $this->message);
parent::parseBlock($html);
}
}
class CJoinForm extends CHtmlBlock
{
var $login = "";
function parseBlock(&$html)
{
global $g;
global $l;
$m = array(
1 => isset($l['all']['january']) ? $l['all']['january'] : 'January',
2 => isset($l['all']['february']) ? $l['all']['february'] : 'February',
3 => isset($l['all']['march']) ? $l['all']['march'] : 'March',
4 => isset($l['all']['april']) ? $l['all']['april'] : 'April',
5 => isset($l['all']['may']) ? $l['all']['may'] : 'May',
6 => isset($l['all']['june']) ? $l['all']['june'] : 'June',
7 => isset($l['all']['july']) ? $l['all']['july'] : 'July',
8 => isset($l['all']['august']) ? $l['all']['august'] : 'August',
9 => isset($l['all']['september']) ? $l['all']['september'] : 'September',
10 => isset($l['all']['october']) ? $l['all']['october'] : 'October',
11 => isset($l['all']['november']) ? $l['all']['november'] : 'November',
12 => isset($l['all']['december']) ? $l['all']['december'] : 'December',
);
$html->setvar("month_options", h_options($m, get_param("month", "")));
$html->setvar("day_options", n_options(1, 31, get_param("day", "")));
$html->setvar("year_options", n_options(date("Y") - $g['options']['users_age_max'], date("Y") - $g['options']['users_age'] + 1, get_param("year", "")));
$html->setvar("country_options", DB::db_options("SELECT country_id, country_title FROM geo_country WHERE country_id in (1,2,3)" , 1) . DB::db_options("SELECT country_id, country_title FROM geo_country ORDER BY country_title" , ""));
$html->setvar("orientation_options", DB::db_options("SELECT id, title FROM const_orientation ORDER BY const_orientation.id", 'first'));
parent::parseBlock($html);
}
}
$page = new CIndex("", $g['tmpl']['dir_tmpl_main'] . "index.html");
$header = new CHeader("header", $g['tmpl']['dir_tmpl_main'] . "_header.html");
$page->add($header);
$footer = new CFooter("footer", $g['tmpl']['dir_tmpl_main'] . "_footer.html");
$page->add($footer);
$register = new CJoinForm("join", null);
$page->add($register);
include("./_include/core/main_close.php");
?>