4

I am making a guess here, as I can't really test this right now and I am not entirely sure I understood what you want correctly, but this should be in the correct general direction. define( '_JEXEC', 1 ); define( 'JPATH_BASE', $_SERVER["DOCUMENT_ROOT"]); require_once ( JPATH_BASE '/includes/defines.php' ); require_once ( JPATH_BASE '/includes/framework.php'...


2

I have had issues with this when the database is used as the session handler. From what I can gather, the session data isn't written to the database until the script has terminated. This means that if the second script starts running before the first finishes it would load the session data without the new values since it hasn't been written to the database ...


2

As posted by Lodder, It is really hard to migrate Joomla 1.5 site to other framework. You would surely need enough months to accomplish this task. I rather suggest you to go from Joomla 1.5 to Joomla 3.x. The migration from Joomla! 1.5 to 3.x is a major migration. There are many changes in features and database tables between these two version. It is NOT a ...


2

How about using DOMDocument instead of preg_match? That way you should be able to get all images in the body using getElementsByTagName(). Maybe something like this could work: $buffer = JResponse::getBody(); $document = new DOMDocument(); @$document->loadHTML($buffer); $images = $document->getElementsByTagName('img'); $images will be an object ...


2

For your Error:- Undefined Variable : timage I have noticed that $timage variable is declared inside condition statement in both code. if (isset($src[1]) && $src[1] != '') { $timage = htmlspecialchars($src[1])); $img = 1; } If above condition fails, $timage variable will never be declared. Try declaring this ...


2

I use the default Joomla multilingual management, no falang, no third-party plugin. Same problem, and I spent 1 hour to find the solution. The key is, don't try to use JFactory::getLanguage(). Instead of that, use JFactory::getSession() and retrieve the result like this: $session = JFactory::getSession(); $lang_obj = $session->get('...


2

First of all, you are trying to add code without following Joomla! practices. Then, it is going to be difficult to achieve what your are looking for. For instance, Javascript code is generally located in /media folder. Also, a PHP file without "defined('_JEXEC') or die();" is a bad idea, not following the general security rule to prevent direct access to ...


2

It’s a good question and a bad question at the same time. Why? Good, because the question sounds ‘exotic’ for many many Joomla users/superusers. Why this small line of code is there everywhere like the coca-cola of Joomla. :) 'Nobody' understands why it works that much. defined('_JEXEC') or die('gooo to hell!'); The question is bad because in the Joomla ...


2

Hard to say without seeing the complete code but my guess is you don't initialize the application and the language file in question does not get loaded. You can load it manually: $language->load('lib_joomla', JPATH_ADMINISTRATOR);


2

Create a simple ajax plugin that handles your user login logic and returns a message for your users. The following 2 files should be zipped together and installed on your site. userlogin.php <?php defined('_JEXEC') or die; // Import library dependencies jimport('joomla.plugin.plugin'); class plgAjaxUserLogin extends JPlugin{ function ...


1

There is a good video from Joomla World Conference 2016 on a presentation of Namespaces by Jisse Reitsma that around the 23 minute mark goes into an example that eventually describes a situation where you would not use Jexec in your code so that it can be shared with other platforms like Wordpress/Magento, https://www.youtube.com/watch?v=Dyx05GR4Bms With a ...


1

The following testcode works <?php define('_JEXEC', 1); define('JPATH_BASE', __DIR__); define('DS', DIRECTORY_SEPARATOR); /* Required Files */ require_once(JPATH_BASE . DS . 'includes' . DS . 'defines.php'); require_once(JPATH_BASE . DS . 'includes' . DS . 'framework.php'); $app = JFactory::getApplication('site'); $app->initialise(); require_once(...


1

To get your db prefix, you need to create object of Jconfig class(configuration file). Let us suppose you are creating a file connectivity.php and place it root. And the code in that file would be : require_once ('configuration.php' ); $var_cls = new JConfig(); $connlink = mysql_connect($var_cls->host, $var_cls->user, $var_cls->password) ...


1

Unfortunately Joomla 3 does not seem to support language initialization in external scripts. I therefore had to construct an alternative solution, which might be of help to others wanting to code external scripts such as APPs and API´s for Joomla 3 with multilanguage support using Joomla´s override language files. Here is what I did. I transferred the ...


1

OK, the problem is that we got to use the same session. In order to do that. We had to call $session->getId() to get current seeeion_id then send it to the client side, when we create the session and save the data. Then the client side should pass back the session_id when they want to retrieve back the session data, and we pass the seeeion_id as a one ...


1

It will depend on whether you use any JFactory:: calls, given that it provides useful functions like: getApplication getConfig getSession getLanguage getDocument getUser getCache getACL getDbo getMailer getFeedParser getXML getEditor getURI getDate createConfig createSession createDbo createMailer createLanguage createDocument getStream I can imagine a lot ...


Only top voted, non community-wiki answers of a minimum length are eligible