PDA

View Full Version : Problem with Boss


rico-m345501
01-06-2011, 07:31 AM
Hello,
I have a problem with search for boss. I follow the steps in the tutorial, and then comes the following error message:
Parse error: syntax error, unexpected '}' in /mnt/weba/30/30/5593230/htdocs/fotos/results.php on line 69

Here can you see:
http://www.lenkercrew.de/fotos/results.php

how can I solve the problem?

Jason Byrnes
01-06-2011, 08:35 AM
please send a copy of your page so i can examine the code.

rico-m345501
01-06-2011, 08:48 AM
This is the Code from results.php
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>
<?php
if ("".($Search1_BOSS_start) ."" != "1") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","first")); ?>">&lt;&lt;</a> <a href="<?php echo(getBOSSURL("Search1","previous")); ?>">&lt;</a>
<?php
} // ("".($Search1_BOSS_start) ."" != "1")
?>
<?php
if ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","next")); ?>">&gt;</a> <a href="<?php echo(getBOSSURL("Search1","last")); ?>">&gt;&gt;</a>
<?php
} // ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."")
?>
</div>
<?php
} // ("".($Search1_BOSS_all) ."" > "0")
?>
<?php
if ("".($Search1_BOSS_all) ."" == "0") { // WebAssist Show If
?>
<div>No results found matching your search.</div>
<?php
} // ("".($Search1_BOSS_all) ."" == "0")
?>
<?php require_once("Yahoo/BOSS_include.php"); ?>
<?php
$Search1_BOSS_page_size = 10;
$Search1_BOSS_appID = "KwAW.dfV34FRo8WDt.sKj0tjyuLNnGRKH0Eclarc2bnBaAjvQW Xz988wadpjWbxZFXcY";
$Search1_BOSS_domain = "http://lenkercrew.de/";
$Search1_BOSS_result = "";
$Search1_BOSS_start = 0;
$Search1_BOSS_end = 0;
$Search1_BOSS_all = 0;
$Search1_BOSS_index = 0;
$Search1_BOSS_term = "";
if($Search1_BOSS_page_size > 50) {
$Search1_BOSS_page_size = 50;
}
if(isset($_GET['Search1_BOSS_start']) && preg_match("/[0-9]+/",$_GET['Search1_BOSS_start'])) {
$Search1_BOSS_start = $_GET['Search1_BOSS_start'];
}
if (!session_id()) session_start();
if ("bold" != "") {
$Search1_BOSS_term = "bold";
$word = "/^[a-z|A-Z|0-9| |-|\"]+$/";
if(!preg_match($word,$Search1_BOSS_term)) {
$Search1_BOSS_term = "";
}
$_SESSION['Search1_BOSS_term'] = $Search1_BOSS_term;
} else if (isset($_SESSION['Search1_BOSS_term']) && $_SESSION['Search1_BOSS_term'] != "") {
$Search1_BOSS_term = $_SESSION['Search1_BOSS_term'];
}
if ($Search1_BOSS_term != "") {
$Search1_BOSS_result = getBOSSResults($Search1_BOSS_term, $Search1_BOSS_start, $Search1_BOSS_appID, $Search1_BOSS_domain, $Search1_BOSS_page_size);
if (!empty($Search1_BOSS_result)) {
$Search1_BOSS_feed = new SimpleXMLElement($Search1_BOSS_result); // convert the XML string into ab object structure
$Search1_BOSS_all = $Search1_BOSS_feed->resultset_web['totalhits']; // get the amount of results
if ($Search1_BOSS_all > 1000) $Search1_BOSS_all = 1000;
$Search1_BOSS_start = $Search1_BOSS_feed->resultset_web['start'];
$Search1_BOSS_end = ($Search1_BOSS_all > $Search1_BOSS_start+$Search1_BOSS_page_size) ? $Search1_BOSS_start+$Search1_BOSS_page_size : $Search1_BOSS_all;
if ($Search1_BOSS_end!=0) $Search1_BOSS_start = $Search1_BOSS_start+1;
} else {
$Search1_BOSS_start = 0;
}
}
?>
<?php
while ($Search1_BOSS_index <= ($Search1_BOSS_end - $Search1_BOSS_start ) && $Search1_BOSS_end != 0) {
?>
<div>
<h3><a href="<?php echo(getBOSSValue($Search1_BOSS_feed,$Search1_BOSS _index,"result url")); ?>"><?php echo(getBOSSValue($Search1_BOSS_feed,$Search1_BOSS _index,"title")); ?></a></h3>
<div><?php echo(getBOSSValue($Search1_BOSS_feed,$Search1_BOSS _index,"abstract")); ?></div>
<?php echo(getBOSSValue($Search1_BOSS_feed,$Search1_BOSS _index,"keywords")); ?> </div>
<?php
$Search1_BOSS_index ++;
}
$Search1_BOSS_index = 0;
?>

Jason Byrnes
01-06-2011, 09:02 AM
please send the php page in a zip archive so i can open it in dreamweaver to navigate to line 69 where the error is occurring.

rico-m345501
01-06-2011, 09:18 AM
here is the file...

Jason Byrnes
01-06-2011, 09:59 AM
it looks like some code was deleted from the page.


The code causing the error is lines 68 - 70:
<?php
} // ("".($Search1_BOSS_all) ."" > "0")
?>

the error is occurring because the corresponding opening if statement was removed. add this if statement before the opening body tag:
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>

rico-m345501
01-06-2011, 10:25 AM
the code is on line 1-3. I dont understand.

Jason Byrnes
01-06-2011, 10:29 AM
it is not in the file you sent me. the code from the body tag that you sent to me is:
<body>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>

it should be:
<body>
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>


when i edited the page you sent me to include that code, it worked.

rico-m345501
01-06-2011, 10:55 AM
The file in the Zip archive is also on the server, nevertheless, there comes the same error message.

Jason Byrnes
01-06-2011, 11:02 AM
the file in the zip archive has the following at line 50 - 52:
<body>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>

it needs to be changed to:
<body>
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>

as suggested previously.

rico-m345501
01-06-2011, 11:59 AM
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>
<?php
if ("".($Search1_BOSS_start) ."" != "1") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","first")); ?>">&lt;&lt;</a> <a href="<?php echo(getBOSSURL("Search1","previous")); ?>">&lt;</a>
<?php
} // ("".($Search1_BOSS_start) ."" != "1")
?>
<?php
if ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","next")); ?>">&gt;</a> <a href="<?php echo(getBOSSURL("Search1","last")); ?>">&gt;&gt;</a>
<?php
} // ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."")
?>
</div>
<?php
} // ("".($Search1_BOSS_all) ."" > "0")
?>
<?php
if ("".($Search1_BOSS_all) ."" == "0") { // WebAssist Show If
?>
<div>No results found matching your search.</div>
<?php
} // ("".($Search1_BOSS_all) ."" == "0")
?>
<?php require_once("Yahoo/BOSS_include.php"); ?>
<?php
$Search1_BOSS_page_size = 10;
$Search1_BOSS_appID = "KwAW.dfV34FRo8WDt.sKj0tjyuLNnGRKH0Eclarc2bnBaAjvQW Xz988wadpjWbxZFXcY";
$Search1_BOSS_domain = "http://lenkercrew.de/";
$Search1_BOSS_result = "";
$Search1_BOSS_start = 0;
$Search1_BOSS_end = 0;
$Search1_BOSS_all = 0;
$Search1_BOSS_index = 0;
$Search1_BOSS_term = "";
if($Search1_BOSS_page_size > 50) {
$Search1_BOSS_page_size = 50;
}
if(isset($_GET['Search1_BOSS_start']) && preg_match("/[0-9]+/",$_GET['Search1_BOSS_start'])) {
$Search1_BOSS_start = $_GET['Search1_BOSS_start'];
}
if (!session_id()) session_start();
if ("bold" != "") {
$Search1_BOSS_term = "bold";
$word = "/^[a-z|A-Z|0-9| |-|\"]+$/";
if(!preg_match($word,$Search1_BOSS_term)) {
$Search1_BOSS_term = "";
}
$_SESSION['Search1_BOSS_term'] = $Search1_BOSS_term;
} else if (isset($_SESSION['Search1_BOSS_term']) && $_SESSION['Search1_BOSS_term'] != "") {
$Search1_BOSS_term = $_SESSION['Search1_BOSS_term'];
}
if ($Search1_BOSS_term != "") {
$Search1_BOSS_result = getBOSSResults($Search1_BOSS_term, $Search1_BOSS_start, $Search1_BOSS_appID, $Search1_BOSS_domain, $Search1_BOSS_page_size);
if (!empty($Search1_BOSS_result)) {
$Search1_BOSS_feed = new SimpleXMLElement($Search1_BOSS_result); // convert the XML string into ab object structure
$Search1_BOSS_all = $Search1_BOSS_feed->resultset_web['totalhits']; // get the amount of results
if ($Search1_BOSS_all > 1000) $Search1_BOSS_all = 1000;
$Search1_BOSS_start = $Search1_BOSS_feed->resultset_web['start'];
$Search1_BOSS_end = ($Search1_BOSS_all > $Search1_BOSS_start+$Search1_BOSS_page_size) ? $Search1_BOSS_start+$Search1_BOSS_page_size : $Search1_BOSS_all;
if ($Search1_BOSS_end!=0) $Search1_BOSS_start = $Search1_BOSS_start+1;
} else {
$Search1_BOSS_start = 0;
}
}
?>

Please, copy the code and insert in Dreamweaver (you see the lines)- here something is not right.

Jason Byrnes
01-06-2011, 12:27 PM
the code above is not the same code as in the zip archive.

the problem with the code above is that:
a) lines 1 - 30 should not be at the top.

b) at the end of that code, there should be the standard html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>results</title>
</head>

<body>


c) the code at line 1 - 30 should come after the body tag.

rico-m345501
01-06-2011, 12:46 PM
If they can publish the code here, I still get the same mistake.

Jason Byrnes
01-06-2011, 12:48 PM
<?php require_once("../Yahoo/BOSS_include.php"); ?>
<?php
$Search1_BOSS_page_size = 15;
$Search1_BOSS_appID = "PG562sLV34Eszi3tt1mFB1pbxhe74piosu8yvQYJY0ZD.BU34L LG7y9OjK78m83Tp6lU";
$Search1_BOSS_domain = "http://lenkercrew.de/";
$Search1_BOSS_result = "";
$Search1_BOSS_start = 0;
$Search1_BOSS_end = 0;
$Search1_BOSS_all = 0;
$Search1_BOSS_index = 0;
$Search1_BOSS_term = "";
if($Search1_BOSS_page_size > 50) {
$Search1_BOSS_page_size = 50;
}
if(isset($_GET['Search1_BOSS_start']) && preg_match("/[0-9]+/",$_GET['Search1_BOSS_start'])) {
$Search1_BOSS_start = $_GET['Search1_BOSS_start'];
}
if (!session_id()) session_start();
if ("bolt" != "") {
$Search1_BOSS_term = "bolt";
$word = "/^[a-z|A-Z|0-9| |-|\"]+$/";
if(!preg_match($word,$Search1_BOSS_term)) {
$Search1_BOSS_term = "";
}
$_SESSION['Search1_BOSS_term'] = $Search1_BOSS_term;
} else if (isset($_SESSION['Search1_BOSS_term']) && $_SESSION['Search1_BOSS_term'] != "") {
$Search1_BOSS_term = $_SESSION['Search1_BOSS_term'];
}
if ($Search1_BOSS_term != "") {
$Search1_BOSS_result = getBOSSResults($Search1_BOSS_term, $Search1_BOSS_start, $Search1_BOSS_appID, $Search1_BOSS_domain, $Search1_BOSS_page_size);
if (!empty($Search1_BOSS_result)) {
$Search1_BOSS_feed = new SimpleXMLElement($Search1_BOSS_result); // convert the XML string into ab object structure
$Search1_BOSS_all = $Search1_BOSS_feed->resultset_web['totalhits']; // get the amount of results
if ($Search1_BOSS_all > 1000) $Search1_BOSS_all = 1000;
$Search1_BOSS_start = $Search1_BOSS_feed->resultset_web['start'];
$Search1_BOSS_end = ($Search1_BOSS_all > $Search1_BOSS_start+$Search1_BOSS_page_size) ? $Search1_BOSS_start+$Search1_BOSS_page_size : $Search1_BOSS_all;
if ($Search1_BOSS_end!=0) $Search1_BOSS_start = $Search1_BOSS_start+1;
} else {
$Search1_BOSS_start = 0;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>results</title>
</head>

<body>
<?php
if ("".($Search1_BOSS_all) ."" > "0") { // WebAssist Show If
?>
<div>Viewing records <?php echo($Search1_BOSS_start); ?> to <?php echo($Search1_BOSS_end); ?> of <?php echo($Search1_BOSS_all); ?></div>
<div>
<?php
if ("".($Search1_BOSS_start) ."" != "1") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","first")); ?>">&lt;&lt;</a> <a href="<?php echo(getBOSSURL("Search1","previous")); ?>">&lt;</a>
<?php
} // ("".($Search1_BOSS_start) ."" != "1")
?>
<?php
if ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."") { // WebAssist Show If
?>
<a href="<?php echo(getBOSSURL("Search1","next")); ?>">&gt;</a> <a href="<?php echo(getBOSSURL("Search1","last")); ?>">&gt;&gt;</a>
<?php
} // ("".($Search1_BOSS_end) ."" != "".($Search1_BOSS_all) ."")
?>
</div>
<?php
} // ("".($Search1_BOSS_all) ."" > "0")
?>
<?php
if ("".($Search1_BOSS_all) ."" == "0") { // WebAssist Show If
?>
<div>No results found matching your search.</div>
<?php
} // ("".($Search1_BOSS_all) ."" == "0")
?>

</body>
</html>

rico-m345501
01-06-2011, 01:26 PM
New Error Message:
Fatal error: Call to undefined function: curl_init() in /mnt/weba/30/30/5593230/htdocs/Yahoo/BOSS_include.php on line 4

I dont understand, who is the problem?

Jason Byrnes
01-06-2011, 01:29 PM
that error means that cURL is not enabled in the php.ini file.

you will need to contact the host to have them enable the cURL extension in the php installation.

rico-m345501
01-06-2011, 01:43 PM
Where find I them the php.ini file ?

Jason Byrnes
01-06-2011, 02:04 PM
contact the host. They should be able to locate the php.ini file and make the needed change.

rico-m345501
01-06-2011, 02:15 PM
Do you mean with it the operator of the server?

Jason Byrnes
01-06-2011, 02:19 PM
yes, the server administrator.

rico-m345501
01-07-2011, 06:10 AM
I have enquired with my Hoster, cURL is not activated. To be of use cURL I need another package, this costs considerably more. With it the Plugin, unfortunately, does not have the expected use, because is not activated with most customers cURL.

Jason Byrnes
01-07-2011, 07:44 AM
Who is your Host? Every host I have dealt with has had no extra fee for enabling cURL.

I use the most basic php package from 1 & 1 for $3.99 a month and it allows me to use to cURL, even GoDaddy's basic package has cURL enabled.

rico-m345501
01-07-2011, 08:14 AM
My Hoster is Strato. I have there 4 Domains for 6.90€/month. If I want to use cURL then the at least 14.90€/month costs with 8 Domains.

Jason Byrnes
01-07-2011, 08:41 AM
there are tons of hosts out there that offer cURL support without having to pay an extra fee. I would reconsider using Strato if they do not want to work with you.

With the shear volume of hosting options available out there, hosts that wont work with the costumers should be prepared to lose business.


see this page for a brief listing of hosts that support cURL at the basic level:
http://curl.haxx.se/libcurl/php/hosting.html

rico-m345501
01-07-2011, 10:05 AM
Thank you for the answers, maybe Version2 corresponds to my images. Because the Plugin uses to me at the moment nothing, does the possibility instead of the money pass back guarantee to settle the money, would extend then on Eric Meyer CSS SCULPTOR 38(Upgrade)?

§- To benefit PROMT on-line translator, therefore, correctly does not formulate.

Jason Byrnes
01-07-2011, 10:33 AM
If you purchased within 15 days, you can contact the sales department for a refund at sales[at]webassist[dot]com