×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Newest Locations

Newest Locations 13 years 4 months ago #10961

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

Instead to show the newest locations in the specific category, I would like to show all the locations inside that category.

How can I change the code?

Thanks

Newest Locations 13 years 4 months ago #10968

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
go to
components/com_hotspots/models/gethotspots.php
on line 42 you have:
$db->setQuery($query, 0, 5);
change it either to
$db->setQuery($query);
or
$db->setQuery($query, 0, 100);

The second variant will limit the request to 100 hotspots and to be honest I believe it is better to set it to 100 or 50. Getting > 100 hotspots at once is most probably going to slow down the server.

Newest Locations 13 years 4 months ago #10970

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Suppose to work but It's not working. It's only showing max 8 locations.

I guess it's a problem with the container height.

How can I fix it?

Newest Locations 13 years 4 months ago #10973

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hm, try setting a css min-height to the container.

Newest Locations 13 years 4 months ago #10976

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

Where / How can I set a css min-height to the container?

Newest Locations 13 years 4 months ago #10982

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Go to media/com_hotspots/css/hotspots.css line 513
#hsSearch {
width: 40%;
float: left;
add a height: 500px; to the above for example.

Newest Locations 13 years 4 months ago #10983

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

Is there any possibility to dynamically increase the height to the container depending of the number of locations?

Newest Locations 13 years 4 months ago #10984

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
You can try the following, but I haven't tested it:
go to media/com_hotspots/js/hotspots.js on line 500:
function expandfootmenu() {
	if(typeof footer_opened == 'undefined' || footer_opened == 0) {
		slide_address.toggle();
		getLatestHotspots();
		footer_opened = 1;
	} else	if(footer_opened == 1) {
		slide_address.slideOut();
		footer_opened = 0;
	}
}
change it to:
function expandfootmenu() {
	if(typeof footer_opened == 'undefined' || footer_opened == 0) {
		slide_address.toggle();
//		getLatestHotspots();
		footer_opened = 1;
	} else	if(footer_opened == 1) {
		slide_address.slideOut();
		footer_opened = 0;
	}
}
then go to line 220 in the hsload function after those lines:
if(show_footer_menu == 1) {
		var cat_element =  new Element(_cat);
		$('newestSpotId').innerHTML = (cat_element.getElement('a').innerHTML).replace(/\(\d+\)/g,'');
	}
add
getLatestHotspots();

So what does this change?
You see when you click on latest location a javascript effect is started - the hidden panel slides in. And after that a query to the database is started that returns the hotspots.

With the above change the query to the database for all spots will take place when you first load the page or click to a category.

What does this change? When the query for the latest hotspots is executed, the result is placed in the latesthotspots div. Once you click on show latest hotspots the js effect should calculate the div height and since we have the hotspots already loaded in place it should function dynamically. As I said - not tested, but this is the theory.

Newest Locations 13 years 4 months ago #10992

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Thanks.

Showing all locations now.

Another questions related with this topic.

1) What can I do to close the 'New Locations Slide at the bottom of the map' every time I click on top of any category?
[the problem]
If the New Locations Slide is open with 8 locations and I am clicking on top of another category this one with 20 locations, the New Locations section is showing only the first 8 locations. But If I close and re-open the New Locations Slide, that section will be showing all the 20 locations.
Has sense my explanation?

2) Once I click on any location (from Newest Locations List), that location is pointed on the center of map. Where can I change the zoom level? I wanna see that location really close on the map.

Newest Locations 13 years 4 months ago #11018

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Try this:
on line 243 you have this code:
	if(typeof footer_opened != 'undefined' && footer_opened == 1) {
		getLatestHotspots();
	}
change it to
if(typeof footer_opened != 'undefined' && footer_opened == 1) {
slide_address.slideOut();
	}
This should actually close the latest hotspots, so when the user click on them again, the height of the container will be calculated again. (Haven#t tested it, so there is a slight chance that it won't work)

Newest Locations 13 years 4 months ago #11019

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
about the zoom go to hotsptos.js

and find the function:
function showNew(lat, lng) {
	map.setCenter(new GLatLng(lat, lng), 13);
}
change 13 to something else.

Newest Locations 13 years 4 months ago #11030

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Thanks,

- the zoom is working great.
- About ...close the latest hotspots
Now, I have to click twice to open the Newest Location List.

Question: How can I add the red circle behind the hotspot once I click on any of the Newest Locations at the bottom of the page?

Newest Locations 13 years 4 months ago #11047

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
about the close, try
if(typeof footer_opened != 'undefined' && footer_opened == 1) {
 
slide_address.toggle();
 
    }
 
instead of .slideOut();

About the red circle - you can't.

Newest Locations 13 years 4 months ago #11071

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

no changes. I still have to click twice to open the newest locations list

Newest Locations 13 years 4 months ago #11094

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, just add footer_opened = 0;
	if(typeof footer_opened != 'undefined' && footer_opened == 1) {
		slide_address.toggle();
		footer_opened = 0;
 
	}

I've just tested it and it works.

Newest Locations 13 years 4 months ago #11201

  • Eliecer Marchante
  • Eliecer Marchante's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 493
  • Karma: 11
  • Thank you received: 13
Hi,

That did the trick. Thanks and Happy New Year!
  • Page:
  • 1
Time to create page: 0.159 seconds