Parse Error database help.
Hi;
This is my first attempt at building a website. I bought some code to ease the pain. This is the section left to edit. It seems simple enough but I do not know HTML yet. The error reads:
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home2/musicia/public_html/classifieds/local/local.php on line 222
The code is below, I was trying to check all the ; ect....I am not seeing the error. Any help would be appreciated. Thank_You in Advance Mclassified.
// (C) Copyright 2001, Belcom Bailey LLC
// +-------------------------------------------------------------------+
// | This script is protected by copyright laws and can not be used, |
// | copied or distributed without written permission from the author. |
// +-------------------------------------------------------------------+
// =====================================================================
// 1. System Path to BBClassifieds Installation
// =====================================================================
// Please enter the absolute path to the folder where BBClassifieds
// is installed. This is NOT the URL, it is the server system path.
// For example: /home/your_username/www/classifieds/
$CF_PATH = "home2/musicia/www/classifieds/";
// =====================================================================
// 2. URL of the folder where BBClassifieds is installed
// =====================================================================
// Please enter the absolute (starting with http://) URL of the folder
// where BBClassifieds will be installed. This is the same location as
// defined in $CF_PATH, just translated to the URL.
// For example: http://www.your_domain.com/classifieds
$CF_URL = "http://www.musicians-classified.com/classifieds";
// =====================================================================
// 3. URL of the BBClasisifieds homepage
// =====================================================================
// Please enter the absolute (starting with http://) URL of the page
// that will serve as classifieds homepage. This will be the URL of a
// script from where your visitors will browse the ads.
// For example: http://www.your_domain.com/pages/welcome.php
$CF_HOME_URL = "http://www.musicians-classified.com/pages/welcome.php";
// Ignore these two lines, but do not delete them
require($CF_PATH . "/scripts/db_mysql.php");
require($CF_PATH . "/scripts/classifieds.php");
class DB_CF extends DB_mySql {
// =====================================================================
// Database host
// =====================================================================
// Please enter host address of the database that will hold the data
// If database is on the same machine, simply put "localhost". You can
// use IP address as well.
var $Host = "localhost";
// =====================================================================
// Database name
// =====================================================================
// Please enter name of the database that will hold the data. This is
// the database name you should have created with supplied script
var $Database = "musicia_classifieds";
// =====================================================================
// Database login
// =====================================================================
// Please enter username you wish to use to connect to the database
var $User = "musicia";
// =====================================================================
// Database password
// =====================================================================
// Please enter password you wish to use to connect to the database
var $Password = "1234567";
}
class CF extends Classifieds {
// =====================================================================
// A. FUNCTIONALITY
// =====================================================================
// Following options affect the functionality of the classifieds system.
// =====================================================================
// Allow HTML in ads
// =====================================================================
// Do you want to allow HTML tags in the listing body? Enter either
// true or false. If false, all HTML tags will be stripped out.
var $allow_html = false;
// Allow search
// =====================================================================
// Do you want visitors to be able to search trhough classifieds?
// Enter true or false
var $allow_search = true;
// Advanced search options
// =====================================================================
// Do you want to allow "advanced" search options, such as specification
// of AND/OR/Exact Phrase?
var $show_search_options = true;
// Notify admin of new post
// =====================================================================
// Do you want to send email to system administrator each time new
// ad is posted? Enter true or false
var $notify_admin_posting =true;
// Send thank you note
// =====================================================================
// Do you want to send thank you email after listing is entered into system?
// Please enter either true or false
var $send_courtesy_email = true;
// Limit size of post
// =====================================================================
// If you want to limit the size of post, enter the number of characters
// allowed, otherwise leave to 0;
var $max_post_size = 500;
// Alow post edit
// =====================================================================
// Do you want to allow users to modify their listings after they are
// enterd into the system?
var $allow_user_edit = true;
// Maintain mailing list
// =====================================================================
// Do you want to harvest email address in separate table for future
// mailings?
var $maintain_mailing_list = true;
// Replace "bad" words
// =====================================================================
// Do you want bad words to be replaced? You can define them in admin
var $replace_bad_words = true;
// Moderate the system
// =====================================================================
// Do you want admin to approve ads first before they appear on the site?
var $moderate = false;
// Require ad confirmation by email
// =====================================================================
// Do you want user to confirm his/her listing by replying to email
var $require_listing_confirmation = false;
// Require personal info
// =====================================================================
// Do you want users to enter their first name, last name and company?
var $require_personal_data = true;
// Maintain mailing list
// =====================================================================
// Do you want users to be able to subscribe to mailing list?
var $allow_mailing_list = false;
// Expiration notification
// =====================================================================
// Do you want to send message notifying users that their listing is about to expire?
var $allow_expiration_notice = true;
// Ad
// =====================================================================
// How many hours ahead of expiration do you want the email to go out?
var $notify_hrs_ahead = \48\;
// Ad durations
// =====================================================================
// ad listing durations:
var $ad_durations = "array( "1day" =>false,
"3days" => false,
"1week" => true,
"2weeks" => true,
"1month" => true,
"3months" => false,
);
// Limit ad renewals
// =====================================================================
// Do you want to limit how many times an ad can be renewed?
var $limit_renewals = true;
// Renewal limit
// =====================================================================
// If you limit ad renewals, enter how many times an ad can be renewed
var $max_renewals = 3;
// =====================================================================
// B. APPEARANCE
// =====================================================================
// Following options affect the appearance of the classifieds system.
// =====================================================================
// Display subcategories on homepage
// =====================================================================
// Do you want to display the subcategories on the first page? Set to
// true if yes, or false if you want only the main categories to appear.
var $show_children_at_home = false;
// Results per page
// =====================================================================
// How many results do you want to show per page? If there is more
// ads than will fit on page, page navigation will display at the bottom
var $results_per_page = 10;
// Use stylesheet?
// =====================================================================
// Do you want to use buil-in stylesheets? Please enter either true or
// false. If you want to edit look-and-feel of the system, enter true and
// edit style.css document in scripts folder
var $use_stylesheet = true;
// Show system credentials
// =====================================================================
// Do you want to show credits on the homepage? Enter true or false.
// We like true ;o)
var $show_credits =false;
// Tree separator
// =====================================================================
// How to separate items in the tree
var $tree_separator = " : : ";
// Date display format
// =====================================================================
// How do you want date to appear
var $date_format = "%b %D, %Y"; // May 2nd, 2002
//var $date_format = "%e/%c/%Y"; // 2/5/2002
//var $date_format = "%d/%m/%Y"; // 02/05/2002
// currency appearance
// =====================================================================
// How do you want the price to appear?
var $currency_symbol = "\$"; // currency symbol
var $currency_decimals = "2"; // decimal places
var $decimal_separator = "."; // decimal separator
var $thousands_separator = ","; // thousands separator
var $currency_symbol_location = "before"; // location of currency symbol
// =====================================================================
// C. IDENTIFICATION
// =====================================================================
// Following options affect your company and personal information.
// =====================================================================
// Sender for email communication
// =====================================================================
// Please enter email address wich will appear in "From:" field for all
// emails sent out by the system
// i.e. [email protected] (Your Classifieds Site)
var $from_email = "[email protected]";
// Sysadmin email address
// =====================================================================
// Please enter email address of the system administrator
// i.e. [email protected] (Administrator)
var $admin_email = "[email protected](Administrator)";
}
// set your error reporting level as desired
error_reporting(0);
?>
Abhishek Reddy posted this at 04:33 — 24th July 2004.
He has: 3,348 posts
Joined: Jul 2001
Here:
<?php
var $ad_durations = \"array( \"1day\" =>false,
\"3days\" => false,
\"1week\" => true,
\"2weeks\" => true,
\"1month\" => true,
\"3months\" => false,
);
?>
Remove the " in front of array.
Busy posted this at 05:41 — 24th July 2004.
He has: 6,151 posts
Joined: May 2001
also remove the last comma in the section Abhishek pointed out.
this bit is also wrong
var $notify_hrs_ahead = \48\;
mclassified posted this at 14:14 — 24th July 2004.
They have: 10 posts
Joined: Jul 2004
Thanks....I am still getting the same error. Any other ideas? Regarding the quotation before the aray....It seems to me that the way the quotations line up that it should stay and there needs to be one after false?
// ad listing durations:
var $ad_durations = "array( "1day" =>false,
"3days" => false,
"1week" => true,
"2weeks" => true,
"1month" => true,
"3months" => false,"
);
I have tried alot of combinations, Let me know if I am correct and would appreciate any help....It says expected ";" or "," I kept thinking there was a colin missing somewhere?
Busy posted this at 23:33 — 24th July 2004.
He has: 6,151 posts
Joined: May 2001
var $ad_durations = array( "1day" =>false,
"3days" => false,
"1week" => true,
"2weeks" => true,
"1month" => true,
"3months" => false
);
Abhishek Reddy posted this at 23:44 — 24th July 2004.
He has: 3,348 posts
Joined: Jul 2001
You've not removed the quote -- you've added one in the wrong place instead.
Try this:
<?php
// ad listing durations:
var $ad_durations = array( \"1day\" =>false,
\"3days\" => false,
\"1week\" => true,
\"2weeks\" => true,
\"1month\" => true,
\"3months\" => false
);
?>
array() is a function, and thus should not be in quotes. Only 'literals' -- strings of text which aren't to be parsed, go in quotes. Also, as Busy says, the last item in the list of array contents doesn't need a trailing comma.
Edit: Busy got there first.
mclassified posted this at 00:12 — 25th July 2004.
They have: 10 posts
Joined: Jul 2004
Thanks that didn't work....I just put the code back the way I got it after I try something so it doesn't get to far out of line. That part of the code came that way. Thanks for the array info. I remove the array " when I try something. Your code makes sense to me, but I still get the exact same Error?
Busy posted this at 04:57 — 25th July 2004.
He has: 6,151 posts
Joined: May 2001
did you fix the other line,
var $notify_hrs_ahead = \48\;
should be
var $notify_hrs_ahead = 48;
(or quotes around the value) the '\' will be trying to escape the ';'
mclassified posted this at 12:51 — 25th July 2004.
They have: 10 posts
Joined: Jul 2004
yes...that was a mistake i accidently left in. . Really I'm serious...Is there something else That could affect that section of code. I am going crazzzzzy!
Abhishek Reddy posted this at 22:05 — 25th July 2004.
He has: 3,348 posts
Joined: Jul 2001
What's your code look like now?
KarenArt posted this at 13:02 — 12th August 2004.
She has: 354 posts
Joined: May 2001
I was just wondering if you got this sorted out.
Since I'm still learning php I had a question after looking at your code.
What is going on with the date_format part of the code?
var $date_format = "%b %D, %Y"; // May 2nd, 2002
//var $date_format = "%e/%c/%Y"; // 2/5/2002
//var $date_format = "%d/%m/%Y"; // 02/05/2002
I don't reconize the e or b as part of a php date. I'm used to seeing...
M jS, Y
j/g/Y
d/m/Y
Is there something (else) I don't know.
Also I'm used to seeing % in ASP but not php.
I'm just asking because I haven't seen it before and that intreages me.
gotta finish redesigning my sites so I can show them again.
The purpose of education is... to get more jokes!
mclassified posted this at 15:27 — 13th August 2004.
They have: 10 posts
Joined: Jul 2004
Thanks,
I'm sorry to say I do not know how to write code yet,
I actually bought this code from belcombailey .com for $30.00.
I asked such a stupid question the first time they won't reply a second time. In a way I do not blame them for $30.00, but you would think that if all I have left is getting the classifieds home pg to show they would answer the 2nd time. I did not know to put values between the quotation marks they provided and looked pretty stupid.
I feel introduced to the code and very comfortable with it now. I know it is a simple fact I do not know keeping me hostage. Basically what they did not explain how easy it really was to set up. The code came with instructions and blank quotation marks for values.
The date sequence is simply giving choices of format with the chosen one at the top in the active quotations.
The second I can not answer because a good understanding of reading the scripts is lacking, I have set up the catagories ext and all is fine in Admin, but the home page (line #3), I cannot get it to show, I keep getting the directories instead of the program.
Wordy I know but wanted to ask for help because I am time short but very facinated by code, will be takin classes soon
KarenArt posted this at 15:50 — 13th August 2004.
She has: 354 posts
Joined: May 2001
I'm certainly not expert at php code... that's why I asked about the date bit.
There's so much about it I don't know.
I don't know the company you bought the script from, but I have say... It seems very unprofessional to refuse to answer questions. Do they sell a plan where they will install the script for you?
I guess I'm enough of a newbie to this... I certainly hope my questions aren't so stupid that someone would stop answering me.
I'm sure some of the experts here will be able to help you.
Why don't you post what you have right now and see if someone can help you sort it out.
gotta finish redesigning my sites so I can show them again.
The purpose of education is... to get more jokes!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.