PDA

View Full Version : Listing title, language questions



AidPr
October 8, 2012, 11:51 AM
Hello, I have auto classifieds 4.1.0

say when you want to place an ad, first you have to choose a category then sub-category
for example: Alpha Romeo/156
Is it possible to make that your selected category/sub-cat will be automatically seen as a listing title, without writing anything in the title field?
I want that the title would look something like: Alfa Romeo 156, 1.8 l. Saloon

Next question,

when I trying to import language from my computer via admin panel, I am getting this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Dear {username},Checking our records for new listings we found that you have no' at line 1 ............long text............
Function: error
Class: rlDb
File: /home/*****/public_html/includes/classes/rlDb.class.php (line# 193)

Sorry for my english:/

Mike
October 9, 2012, 09:44 AM
Hello, I have auto classifieds 4.1.0

say when you want to place an ad, first you have to choose a category then sub-category
for example: Alpha Romeo/156
Is it possible to make that your selected category/sub-cat will be automatically seen as a listing title, without writing anything in the title field?
I want that the title would look something like: Alfa Romeo 156, 1.8 l. Saloon


It's possible with few changes to the code. Could you please submit a ticket with ftp login details of your website, i will do it and post instructions here.

About:



Next question,
I am getting error:
File: /home/*****/public_html/includes/classes/rlDb.class.php (line# 193)


It resulted from the single quota in the file but normally script should handle this without problems, could you also include language file to the ticket we will investigate it.

Mike
October 11, 2012, 11:48 AM
Instructions how to add category field which will show category and subcategory information (useful for auto sites to display make and model in any listing forms)

1. admin/controllers/categories.inc.php

find code ~1140 line


/* get listing fields */
if ( !empty($a_fields) )
{
$add_cond = "AND(`ID` = '". implode("' OR `ID` = '", $a_fields) ."') ";

change to



/* get listing fields */
if ( !empty($a_fields) )
{
$a_fields[] = "88";
$add_cond = "AND(`ID` = '". implode("' OR `ID` = '", $a_fields) ."') ";


2. includes/classes/rlCommon.class.php -> function adaptValue


case 'select':
if ( !empty($field['Condition']) )
{
if ( $field['Condition'] != 'years' )
{
$out = $GLOBALS['lang']['data_formats+name+'.$value];
}
else
{
$out = $value;
}
}
else
{
$out = $GLOBALS['lang'][$type . '_fields+name+'.$field['Key'].'_'.$value];
}
break;

change to


case 'select':
if ( !empty($field['Condition']) )
{
if ( $field['Condition'] != 'years' )
{
$out = $GLOBALS['lang']['data_formats+name+'.$value];
}
else
{
$out = $value;
}
}
else
{
if( $field['Key'] == 'Category_ID' )
{
$sql .="SELECT `T1`.`Key`, `T2`.`Key` as `Parent_key` FROM `".RL_DBPREFIX."categories` AS `T1` ";
$sql .="LEFT JOIN `".RL_DBPREFIX."categories` AS `T2` ON `T2`.`ID` = `T1`.`Parent_ID` ";
$sql .="WHERE `T1`.`ID` = ".$value;
$cc = $this -> getRow( $sql );

$out = $GLOBALS['lang']['categories+name+'.$cc['Parent_key']]." ";

$out .= $GLOBALS['lang']['categories+name+'.$cc['Key']];
}else
{
$out = $GLOBALS['lang'][$type . '_fields+name+'.$field['Key'].'_'.$value];
}
}
break;

Mike
October 11, 2012, 11:51 AM
About the broken language file, for some reason error resulted from the line breaks in the email templates, sorted it out through importing via phpmyadmin.
Never saw it before and i think it resulted from server specific configuration.

AidPr
October 13, 2012, 05:06 PM
I made these changes and I have to say it really works. Thanks

About the language, a few months ago, I had installed the real estate software (4.0.1) in the same server,
and did the same things with the language file, but did not get any errors. So it's hard to say whether this is due to server configuration.