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.

 

[solved] Old recipe code not working on new site

[solved] Old recipe code not working on new site

Hi,
We have been using Metamod Pro on our Joomla 2.5 site with no problems with the following PHP....

// change some_guy23 to the login name of the person you are tracking
$search_user_name = 'admin';
$username = $db->getEscaped($search_user_name);
$query = "SELECT username "
. " FROM jos_session WHERE username = '$username' "
. " AND guest = 0 "
. " AND client_id = 0 ;" ;
$db->setQuery( $query );
$found = $db->loadAssoc();
if (is_array($found)) {
$changes->mod(183)->disable(); /* gets rid of this module if it exists */
return 209; /* and display this module */ }

We have just purchased the newest Metamod for our new Joomla 3.2 site that is being built but the code above is no longer working. We have checked all the basics and know that Metamod is operational using testing functions but seems not to be able to grab the DB or session data.

The module IDs are also correct.

Any ideas please ?

Regards
Phil

Joomla version is 3.2.4
MetaMod v3.17, 2014-04-14
MetaMod Pro plugin v3.17, 2014-04-14 is installed and enabled.
JomGenius v20 is provided by MetaMod

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

Re: [solved] Old recipe code not working on new site

It might be the jos_ thing. Your new database will have a different prefix. The official way to do it is to replace jos_ with # _ _ (without the spaces) in the query above.

Actually it's probably this:

JDatabase::getEscaped() has been removed. Use JDatabase::escape() instead.

If you make that change it will probably fix it :-)

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: [solved] Old recipe code not working on new site

JDatabase::escape() was the problem.
Many thanks for your support Stephen.

philkin
Beginner Modder
ranks
useravatar
Offline
5 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:
151

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