PDA

View Full Version : moving javascripts out of user_top into an external .js file



Anonymous
02-20-2004, 01:01 PM
Has anyone managed to move the javascripts from the user_top into an external file?

From what I gather, having a huge user_top cluttered with javascript code does not help with the search engine placements?

Any ideas?
Ad
adilakkus@softhome.net
http://www.ashleycharles.com

awddesign
02-20-2004, 01:10 PM
remove

awddesign
02-20-2004, 01:14 PM
Hi

removed as this page has changed to multi map ????????????

Anonymous
02-24-2004, 08:42 AM
You used a link to a map-website. (multimap instead of the traditional yahoo.)
Is it possible to post the code for building that link.
Thanks
Jan.
_jan_@pandora.be

justice
02-24-2004, 02:49 PM
I have the file but cannot connect to internet from home due to my phone line problems.

As soon as it's fixed, I'll put my version.

As far as I can remember, someone else has already posted the code for multimap.

Justice
http://www.ashleycharles.com

ltp
02-24-2004, 07:46 PM
Has anyone managed to move the javascripts from the user_top into an external file?

From what I gather, having a huge user_top cluttered with javascript code does not help with the search engine placements?

Search engines will not see this... The only thing that it will see is that the page size is a little bit bigger which will be the same case if you do not use a robots.txt file to tell it not to include that external js, or any .js file for that matter.

justice
02-27-2004, 04:50 PM
As promised, here's how I create multimap links:

1. In your template directory (usually vertical-menu), find style.php and copy the following code at the bottom of the file:



function makeMultiMap($listingID, $address_field, $city_field, $postcode_field)
{
// renders a link to MultiMap.co.uk maps on the page

global $conn, $config;
$sql_listingID = make_db_extra_safe($listingID);
$sql_postcode_field = make_db_safe($postcode_field);

// get postcode
$sql = "SELECT " . $config[table_prefix] . "listingsDBElements.field_value FROM " . $config[table_prefix] . "listingsDBElements, " . $config[table_prefix] . "listingsFormElements WHERE ((" . $config[table_prefix] . "listingsDBElements.listing_id = $sql_listingID) AND (" . $config[table_prefix] . "listingsFormElements.field_name = " . $config[table_prefix] . "listingsDBElements.field_name) AND (" . $config[table_prefix] . "listingsDBElements.field_name = $sql_postcode_field))";

//print "sql: ".$sql;

$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
while (!$recordSet->EOF)
{
$postcode = make_db_unsafe ($recordSet->fields[field_value]);
$recordSet->MoveNext();
} // end while

//Remove the space in the postcode
$postcode_arr=split(" ", $postcode);
//$multimap_postcode=$postcode_arr[0].$postcode_arr[1];
$multimap_postcode=implode($postcode_arr);

// Make the postcode uppercase
$multimap_postcode=strtoupper($multimap_postcode);
$multimap_string = "pc=$multimap_postcode&scale=10000&cat=h&title=ashl eycharles.com";
echo "<a href=\"http://www.multimap.com/p/browse.cgi?$multimap_string\" target=\"_map\"><img border=\"0\" src=\"$config[baseurl]/images/directions.gif\"></a>";


} // end makeMultiMap


2. Whereever you want to create the hyperlinks, use something similar to the following:


<?php makeMultiMap($listingID, "address", "city", "postcode") ?>


I hope it helps,
Justice
Letting Agents in Reading (http://www.appleton-lettings.com)

altahost
03-02-2004, 01:28 PM
hi, thanks for the input. I have tried this code in style php...the code seems to work fine but there is no return of a map...infact it redirects to home page of the map site. I think it someting to do with this section


http&#58;//www.multimap.com/p/browse.cgi?pc=&amp;scale=10000&amp;cat=h&amp;title=ashleycharl es.com


If you want to see how it functions from my site, please use the following link:

http://www.estate.altahost.net/manager/listingview.php?listingID=2

At least I am not seeing a bunch of parse errors anymore :)

Many thanks, it is really appreciated

Paul

altahost
03-02-2004, 02:08 PM
Eventually i worked it out...works great, thanking you for all the input...so appreciated

Baldy
03-02-2004, 04:42 PM
I'm unable to get map quest or multimap to work as I've lost my (Post code link) from the "browse listing page"
The Title | Address | City |County | are there, But No Post code??
I do'nt know... you put somthing down for 2 min's &amp; it just walks off!
It was there , now i'ts gone. :shock:
Could someone please tell me where to start looking?

Thank you.

Dun
04-21-2004, 06:31 AM
Sh*t sh*t sh*t

Bleedin Ireland dosnt have postcodes, does it :cry:

Any ideas how I get this to work by town instead of postcode?

Dun
04-21-2004, 09:55 AM
Problem solved (for me anyway)

I used this code

<a href="http&#58;//www.mapquest.co.uk/cgi-bin/ia_find?link=btwn%2Ftwn-map_results&amp;random=1167&amp;event=find_search&amp;uid=u8na _7e2slm3sapa%3A25lrt29y80&amp;country=Great+Britain&amp;SN VData=&amp;address=&amp;city=<?php renderSingleListingItemNoCaption&#40;$listingID, "Location"&#41; ?>&amp;Zip=&amp;Find+Map.x=35&amp;Find+Map.y=6" target="_blank">map</a>
and changed

country=Great+Britain to
country=Ireland and
&#40;$listingID, "Location"&#41; to
&#40;$listingID, "City"&#41;

banged that in listingview.php where the yahoo map link was and happy lil me :D