Hot answers tagged

3

You have the instruction in your code, but commented. The query setLimit() function requires two parameters: $limit: the number of records to return, and $offset: the first record you want to return, zero-based. This is the signature of the function: public function setLimit($limit = 0, $offset = 0) Please take notice that the parameter order is opposite ...


3

Your original coding attempt is repeatedly overwriting the $dataPoints variable inside of the loop -- this is why you only see the last iteration's data. To create the desired multidimensional array directly from the query's result set, here is the way to use column aliases and Joomla's query building syntax. $db = JFactory::getDbo(); $query = $db->...


2

I think I have a good idea where the error is. You are using $this->getFileName() to get the files original name, then you mutate the filename using normalize(). At this point you have a new file name, but the system doesn't realise that this is the filename to be used forevermore. Basically, you will either need to rename the file in your file system ...


2

Personally I wouldn't use a .css.php file. The following assumes you WON'T be supporting Internet Explorer and I will be answering your question about CSS filters. The grid/masonry can be asked as a separate question. So, let's say you want to set a CSS filter (grayscale) and the percentage is set dynamically. You firstly want to have the following CSS file (...


2

I have a hard time believing that the file was updated when creating a new menu item. It was more likely updated when updating Joomla. And that is expected. You should never modify core files, they will be overwritten when updating. Instead you should create a copy of the template and then create layout overrides. There is plenty of documentation regarding ...


2

I think you are looking for the rawvalue property of the field object /* Rearrange Fields for use */ foreach($this->item->jcfields as $jcfield){ $this->item->jcFields[$jcfield->name] = $jcfield; } $absolute_path_to_image = JUri::base() . $this->item->jcFields['your-field-name']->rawvalue;


2

It is doubtful it may work; and even if it did, you risk other issues. Components often use constants and loaders that would not work outside the component itself, such as JPATH_COMPONENT. I see the main risk in the assets, which will be created by Joomla referencing your calling component (the social login component) instead of the called component (Easy ...


2

Here are the official Joomla! Docs for anyone else looking in the future: https://docs.joomla.org/How_do_I_use_Gmail_as_my_mail_server%3F How do I use Gmail as my mail server? If you have a working Gmail account you can use Gmail as your mail server by setting it in the global configuration. On the server tab set the following: Mailer: SMTP SMTP Host: smtp....


1

After much experimentation I'm pretty sure it's not possible to achieve this without Javascript, but I did manage it this way: I added this code to the menu's main php file (about line 53 in the default.php override): if ($item!=parent) { $class .= ' single'; } Then in the template.js added this: let single = [...document....


1

I found the above problem solved after using Helix Ultimate 2 Beta 2 Quickstart Package (https://github.com/JoomShaper/helix-ultimate/releases/download/v2.0.0-beta.2/helixultimate_2_beta2_quickstart.zip). Here are the steps that I followed: Download the Helix Ultimate Quickstart Package at https://github.com/JoomShaper/helix-ultimate/releases/tag/v2.0.0-...


1

I consider this a very valuable question that does not have good write-ups/tutorials yet in Joomla documents (we should create one). I am trying to give here some workable info on this. Loading Form Fields using Joomla implemented show-on conditions is not for loading dynamically changing checkboxes, list or combo field's values and fields. For loading Form ...


1

First of all you may well be able to use the Joomla SQL Form Field for your Job Title field, instead of having to write a custom field. To make the Technologies dropdown dependent upon the Job Title field you may be able to use the showon attribute as described in Enabling showon to work in list options. In your Technologies custom field you'd have to select ...


1

I am not aware of any ready made multi-user portfolio extension for Joomla and you may need a combination of extensions together with the core Joomla features to achieve all the functionality you require. If you want photographers to be able to manage photo albums from the front-end of the website, this limits your choices quite a bit as there are only a few ...


1

As I suggested in my comment, building a plugin for this may be an alternative solution worth pursuing. In a system plugin, simply add code similar to the example below to intercept any calls. Rest assured the code below was not tested on animals. intercept onAfterRoute() ensure your code should really run there, as an example: exclude administrator ...


1

Since the value of $this->item->extra_fields is either an array or null, you don't need to check if it "is set" with !empty() or isset(); a truthy value check is all that is required. if ($this->item->params->get('itemExtraFields') && $this->item->extra_fields) { By writing $this->item->extra_fields (without any ...


1

Thanks a lot, James Shaver, I had no idea that such a PHP repository as packagist.org existed (tried Pear and Pecl and various Google searches). I found the Wikimedia/XMP-reader (Ver. 0.7) and installed and ran it according to instructions. Works great - see below. Also read your PDF and I learnt that the XMP Data block cannot be trusted to be authorative. ...


1

You'll probably want to look at something like Composer to install libraries in your component or plugin. Simple search: https://packagist.org/?query=iptc%20exif%20xmp First one found: https://packagist.org/packages/wikimedia/xmp-reader README Reader for XMP data containing properties relevant to images, written in PHP. Install composer require wikimedia/xmp-...


1

When running Joomla from git clone you can use build/stubGenerator.php script. It will generate stubs.php file in Joomla's root directory.


1

If I understand your problem correctly then you just have to change the first few lines of your original code because you do not just want look for the user ID from the database (user table) but you also need to define the user ID from the particular article's URL. So try it with using the following at the beginning of your code: $articleUrl = \Joomla\CMS\...


1

After a long period of time, I have managed to find a solution to my problem. I have decided to rewrite the code from scratch. The code is the following: <script type="text/javascript"> var vehicles = new Array(); var markersLayer; function initializeGoogleMap() { var googleStreets = L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={...


1

I modified my answer from How to SET a user-defined MySQL variable and increment it to produce ranking values with JDatabaseQuery? and added some additional subqueries to obtain the best scores for each athlete. I strongly recommend using "gapped ranking" because it more accurately represents athlete performance -- especially in cases of ties. ...


1

This only works if the article you are attempting to get the menu item id for exists in a menu. i.e. if your menu only has a link to the category, but not the article, you will find your $Itemid = $menuItem->id; will throw a Trying to get property of non-object because $menuItem is not an object, rather an empty array. $articleId = 10; $link = 'index.php?...


1

The easiest way to do what you are trying to accomplish is with template overrides, not plugin events (we don't call them "hooks" in Joomla). Ideally, you'd need to make a template override for com_users' login view and the mod_login module to make sure that both places where a user can log in are covered. The reason I'm not recommending a plugin ...


1

As @Sharky said, it seems like your SQLSRV extension isn't enabled. You can manually activate it by changing your php.ini file, enabling this extension and downloading the drivers. PHP Documentation says: The SQLSRV extension is enabled by adding appropriate DLL file to your PHP extension directory and the corresponding entry to the php.ini file. The SQLSRV ...


1

There is no way to pass the JEXEC constant to the file, other than including a file that defines it - Generally you would want to go through Joomla for this. Turn the whole form to a module and use com_ajax to make the AJAX calls to the helper of your module. https://docs.joomla.org/Using_Joomla_Ajax_Interface Alternatively, you could have used a mature form ...


1

You can definitely delete rows from multiple tables in a single query, but Joomla doesn't offer a query-building technique to accommodate this. If you absolutely demand that query builder methods must be used, then you'll need to conduct some "surgery" (which isn't very pretty) on the generated query before executing it -- see https://joomla....


1

Why don't you do it in 2 steps? I would do something like the following code. As you can see I use name spacing (since Joomla 3.8), used quoteName the table + field names and added a try/catch block. use Joomla\CMS\Factory; public function delete_codes() { $id = $this->input->getInt('id'); $query = $db->getQuery(true) ->delete($db->...


1

Don't use JUri for fetching local files. It returns the web address of your site. Fetching files over HTTP is extremely slow compared to fetching files locally. Use one of JPATH constants to get a local filesystem path, e.g.: $json = JPATH_BASE . '/modules/mod_kou_stack_exchange/media/js/sites.json'; $json = file_get_contents($json); https://docs.joomla....


1

Use the filepath: JUri::base() . '/modules/mod_kou_stack_exchange/media/js/sites.json' The filesystem equivalent of, eg. /public_html/yoursite/modules/... or /htdocs/yoursite/modules/... where Joomla is installed in yoursite directory.


1

That sort of thing is completely in the control of the template designer; Joomla doesn't care how that's set. Not being familiar what template you're using, it's hard for me to tell precisely how it's done. From the site's markup, it looks like it's in a module (would probably be a custom HTML module). I'd look for one of those called something like "logo" ...


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