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.

 

Error when using GeoLite?

Error when using GeoLite?

Hi,

I am trying to get Metatemplate to work. Starting very easy. I would like to use a different template for visitors from "Amsterdam" so I enable GeoLite.
But when I do that I get a warning in the front-end:

--- Warning: require_once(geoip.inc) [function.require-once]: failed to open stream: No such file or directory in **********/administrator/components/com_metatemplate/geoip/geoipcity.inc.php on line 33 ---

If I take a look in this directory there is no geoip.inc???

Can someone tell me what I do wrong???
Below is how I setup the Rule.

http://www.spellenwinkeldenbosch.nl/tmp/MetaRuleAmsterdam.jpg

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Oh, terribly sorry about this. I don't know how it slipped through quality control! I think it shows that not many people use this feature...

The quick fix for you is that in administrator/components/com_metatemplate/geoip/geoipcity.inc.php on line 33 you can add ".php" to "geoip.inc". The line should read:

require_once 'geoip.inc.php';

I'll make the fix and get the new version up for download as soon as possible.

Thanks for reporting it!

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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Error when using GeoLite?

By the way, there's also a small problem with the rule as you have it set up:

In the PHP box you check for a particular city - that's fine.
Beneath the PHP box, you have set the "default return" value to "true".

That means that if the PHP condition does not return the name of the template (gk_yourshop_new), it will return "true". This will cause the "succeed" action to be triggered. In the "succeed" action... you are again setting the "gk_yourshop_new" template.

The easiest thing to do is this:

if ($geoip->city == 'denbosch") return true;

... then set the default return value to "false"
... then in the succeed action, use the dropdown to set the gk_yourshop_new template
... and in the fail action, set an alternative template, or don't bother to set any template if you just want the default one to be used.

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Hi Stephen,

Wauw this is fast. Thanks for your speedy answer.
I will give it a try. Glad to have helped.

Thanks again and keep up the good work.

Peterjan

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Hi Stepen,

Sorry but ran in to another problem :-|

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/spellenwinkelde/html/spellenwinkeldenbosch.nl/components/com_metatemplate/helper.php(756) : eval()'d code on line 1

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Oops, did I put in mis-matched quotes? Bad me.

Try:

if ($geoip->city == "denbosch") return true;


Sorry again!

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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Error when using GeoLite?

No my oops,

This one I could have picked up myself.

Thanks

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Wauw,

Working like a charm now!!!

Again many thanks,

Peterjan

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Re: Error when using GeoLite?

The new versions of MetaTemplate and MetaTemplate Pro now have the original problem with GeoLiteCity fixed.

They're available for download now.

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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Error when using GeoLite?

Hi stephen,

Back again, I have metatemplate setup now and its working exept for one thing.
I have set it up so that when a visitor is using the domeinname www.example.nl he will see template_one.
Other visitors from www.something.nl which is redirected to www.example.nl will see template_two but now there is a problem, the "Home" button is still refering to www.example.nl so when using the home button will bring the visitor back to www.example.nl with template_one.

I hope that i am making sens neutral

I tryed to search the forum but could not find an answer.
Hope you can help me (again)

Thanks for your time!

Greetz Peterjan

galahad
Beginner Modder
ranks
useravatar
Offline
10 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10113
Newest User:
michael2066
Members Online:
1
Guests Online:
187

Online: 
michael2066

Forum Legend:

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