Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

From Sobi2 City

From Sobi2 City

hello a first excuse by my English, and really I thank for the fabulous unit that you have created I have two doubts:
I am working with sobi2 and desire that by means of geocity to me the city of where the users enter, that like doing it, the menus of the site identifies them hand like External links this way
index.php? option=com_sobi2&sobi2Task=search&catid=2&field_city=
I would like to know if I can put a variable type:
index.php? option=com_sobi2&sobi2Task=search&catid=2&field_city='.$ciudad. '
And in city to put the city of which visits to me in addition to create a cookie of this this although I do not believe that is necessary,
And finally to know how how to enter you of sobi2 to add in select list all the cities so that the user can change that city and returns to re to redirecct again the menus.

demian
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: From Sobi2 City

Hi Demian,

To be honest, I don't think that I can design your whole system for you... you're looking for something quite complex.

However, I can give you a quick start for some of this.

(1) I don't know how to create a menu item from MetaMod. But, you can easily use MetaMod to create a normal hyperlink, as a module. You could do this:

$ciudad = $geoip->city;
if ( $ciudad != '' ) {
  $url = "index.php?option=com_sobi2&sobi2Task=search&catid=2&field_city=" . $ciudad;
  echo '<a href="' . JRoute::_( $url ) . '">Search</a>";
}

(2) Creating a list of all cities, and a select-list in SOBI2: I think that's a question to ask on the SOBI2 forums. I really can't help you there sorry.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: From Sobi2 City

hi again tanks for ur reply I  tried something like this

if ( $option == 'com_sobi2' and ($catid = JRequest::getVar('catid')) == '4') {
//echo "You Search in: ".$geoip->city;
$app = &JFactory::getApplication();
$app->redirect( JRoute::_('index.php?option=com_sobi2&sobi2Task=search&catid=4&field_city='.$geoip->city));
}

but tha page stop and it does not update, it clears sh4seft but nating healp me please sad

demian
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: From Sobi2 City

I tried this

$app = &JFactory::getApplication();
if ( $option == 'com_sobi2'and ($catid = JRequest::getVar('catid')) != '' ) {
if ( $catid == 4 ){
echo "You Search in: ".$geoip->city;
  $app->redirect( 'http://domain.com/index.php?option=com_ … ity=' . $geoip->city);
}
}

workin but it takes too much in updating the page sad

demian
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: From Sobi2 City

Again I thank for magnificent module that you have created, or solved my problem I believe that towards bug with the component of sobi2 but or it thinks that the menus sent to any content and the redirection makes very many thanks perfect. At least that I solved already it now only lacks to enter the data base of sobi2 to look for the field city so that they can look for in different cities. You have a new friend in Guadalajara Jalisco Mexico for when you wish to visit to me. tanks so much big_smile

demian
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: From Sobi2 City

Hi Demian,

I don't completely understand your last e-mail... but thanks for the thanks smile

A question about your previous e-mail: what do you mean by "but it takes too much in updating the page"? Do you mean that it takes a long time to load the page, or that you are going to have to spend a long time adding lots of MetaMods with different $catid variables?

A note about redirection: when you use JRoute, it changes "&" to "&amp;" for use in <a> tags. This causes problems with $app->redirect, which does not work properly with &amp;. So all you have to do to make it work is this:

  $route = JRoute::_( 'http://domain.com/index.php?option=com_ … ity=' . $geoip->city);
  $route = str_replace( "&amp;","&", $route );
  $app->redirect( $route );

Hope that helps,
and maybe I'll see you in Mexico one day!
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: From Sobi2 City

hi metaguy big_smile

it mentioned you that already resolved the form search by city and like when gave click in a menu sent to the component of sobi search with the parameters of I did geo_city it of the following way;

if ( $option == 'com_content' and ($id = JRequest::getVar('id')) == '5') {
  $app->redirect( 'http://' . $_SERVER['HTTP_HOST'] . JRoute::_('index.php?option=com_sobi2&sobi2Task=search&dtCat=4&field_ciudad='.$_COOKIE["ciudad"].'&field_estado='.$_COOKIE["estado));

also make a scrit with Javascript to create a list of states and cities keeps and them in cookies so that they always changed when them they were that part realises already it

now solve a problem with the unit of sobi that shows to the map of google sobi map

I want that when changes the city that keeps in the cookie $_COOKIE["ciudad"]     also they change to the latitude and length to be able to use it with the component of sobimap. not if it can realise something thus:

$geoip->city = $_COOKIE["ciudad"];

Buth the latitude and lengt donth chage;

demian
Beginner Modder
ranks
useravatar
Offline
5 Posts
Administrator has disabled public posting

Re: From Sobi2 City

Hi Demian, I'm really struggling with the English here, sorry... perhaps you can write in your native language and Google translate will help me understand?

However, I think you are saying that you want to be able to find out the latitude and longitude of a certain city, if you just have the city name. Right?

Unfortunately, the GeoIP City records and system from MaxMind don't allow you to look up the longitude and latitude for particular cities. You can only do a lookup by IP address, and then if there's a city record for that IP address then it also gives you the longitude and latitude.

There must be other databases around, available for PHP, that would allow this. Or, there may be web-based services that you could query for this information. I'm sorry I can't help you more with that (it's getting outside the scope of MetaMod).

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5933
Total Posts Today:
7
User Info:
 
Total Users:
4432
Newest User:
kinggambling14
Members Online:
0
Guests Online:
188

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked