Questions tagged [php]

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Joomla is based on PHP.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Joomla php function which prints the pagename

Is there a php function to insert in the template which prints the name of the menu item of the displayed page?
0
votes
1answer
20 views

Fatal error in joomla component arrays objects

In my admin view (custom Joomla module) I get errors sometimes. User submits a custom form and it works, but when there are two checkboxes checked, I get this error: Fatal error: Cannot use object ...
0
votes
0answers
15 views

Add more than one URL query parameters to wordpress URL [migrated]

As soon as someone clicks on an anchor tag in my website, I was planning to redirect to the same page containing the information added via two URL query parameters, and then access them with the $_GET ...
1
vote
1answer
33 views

Problem accessing database from front end of a component

I am currently working on a component which will display "events", stored in a database, on a map (filterable by location, category, date etc...). My first step is to display a simple report of the ...
0
votes
1answer
35 views

How to get the currently installed Joomla! Version in PHP

For one of my extensions i need a switch statement if the Joomla! Version is 3.x or 4. (in fact i have to call the Articles Model in different way for J4) - but how can i get the actual installed ...
0
votes
1answer
31 views

How to cancel a mandatory (required) field in Virtuemart form submission process?

I want to free my future site's visitors from having to fill out the form before submitting their name, e-mail and a phone No. Basically, in most cases it won't be needed for them to also add more ...
0
votes
0answers
20 views

Modify the Expires Header

In the file: /html/joomla-usa/libraries/src/Application/WebApplication.php are the code: if (!$this->response->cachable) { // Expires in the past. $this->...
0
votes
0answers
20 views

Custom Registration Form getInstance() Could Not Load File

Joomla 3.9.14 I have an external script that allows users to register on my Joomla site. The code is below; php <?php include('conn.php'); require_once JPATH_BASE .'/components/com_users/...
2
votes
2answers
42 views

Language Constant Not Displaying in External Script

Joomla 3.9.14 I have an external application that uses the script below, allowing users to register as a user on my Joomla site. It all appears to be working apart from error displaying. My code is ...
2
votes
0answers
39 views

External User Registration Script - Change Email Content

Joomla 3.9.14 I have a script that successfully registers a user on my Joomla site via an external script. The code is below; <?php // database connection include('conn.php'); require_once ...
1
vote
1answer
42 views

External Login Script and getDbo()

I have a Joomla 3.9.14 site with a subdomain app.example.com. I have a login form, and I want to allow users to login using their Joomla credentials. Everything is working as expected, users are ...
0
votes
0answers
37 views

Converting to JS

Hello i am still learning but was wondering if anyone here could help i have the two function be low i would like to convert them to JS to store in an external file then be able to call one of the ...
0
votes
1answer
50 views

Show the fieldgroup title on /html/com_content/article/edit.php

We want to move all field groups to the first content tab on the backend and assign individual classes to every field group. Therefore, we've already ignored the fieldsets to avoid the creation of the ...
1
vote
1answer
58 views

How to include images in Joomla's search results?

I'm trying to display images in search results for the default search of Joomla. I messed with some code from the web and I managed to display images with the following: in template/html/com_search/...
-1
votes
1answer
27 views

How do I find the first NON bootstrap class ancestor of my current module position?

Not sure I'm wording this right so please forgive me. I'm working on a situation where I want to apply the background to the 1st NON .container ancestor of my current module. So, for example.. <...
0
votes
2answers
48 views

Jooma Article content to load from mysql based on ID in url?

On my old website, built in php i had a link on a page, wich picked an ID based on what line it was. <td width=124><a href="tp/package.php?ID=<?php echo $row[0];?>">Package</a>...
0
votes
1answer
41 views

Joomla old code to latest 3x series with best practice of safe and secure code

Am Trying to rewrite this code with latest joomla and php for best practice Confused on where to use this function in new code onchange="showModelVariant(this.value)"> Is the new code correct ...
1
vote
1answer
75 views

RSS Feed error: “cURL error 22: The requested URL returned error: 403 Forbidden”

I'm trying to load the following RSS feed in a Joomla! Feeds module: https://community.joomla.org/events/view,rss.xml However, I get the following error: cURL error 22: The requested URL returned ...
2
votes
2answers
76 views

Latest articles structured data markup

I have added microdata into every article manually and it works fine. Now I want to insert them into the latest articles module. To override the module in my template and I added: <li itemscope ...
0
votes
0answers
52 views

Joomla 3.9.13 - Error: Failed to start application

I just installed version 3.9 joomla in local using xampp. Once the installation was finished correctly I tried to navigate the site and the backend. After loading a few pages, this annoying error ...
0
votes
0answers
14 views

How to change a language constant on the fly with PHP?

In Joomla! (currently 3.9.13) the language constant COM_INSTALLER_TYPE_TYPE_ is not defined. The constant is used in the error message that is displayed if the Joomla extension update system (the 'one-...
0
votes
0answers
11 views

Why am I getting an editors iframe popup in tiny mce editor when I embed a canva button in it

I am trying to embed a canva button in tinymce editor. Everything works fine. The canva url get loaded in a iframe but at the same time an iframe is also loaded in the back with the home url. How to ...
1
vote
0answers
28 views

ob_flush pushes output before Joomla header

I have a module that I've created to test ob_flush buffering off. I need to understand it so I can have some longer modules buffer output to the page as the script goes through long processes. The ...
3
votes
1answer
57 views

JHTML::_('behavior.tooltip') — Set tooltip position

I'm trying to set the position of the tooltip in Joomla 3.9.8. I've used: JHTML::_('behavior.tooltip'); At the top of the document. I then have field set as: <?php echo JHTML::tooltip($...
0
votes
1answer
79 views

I can't install Joomla because Zlib Compression Support no

I'm trying to install Joomla 3 on docker server using php 5.3.29 but I can't because : Zlib Compression Support no In Pre-Installation Check I tried every thing found on internet but still having ...
1
vote
1answer
41 views

How to add userinfo to link in Joomla Page

We have a Joomla site (latest version) with a page that links to another system with a fixed username/pw, so like https://www.othersystem.com/login.php?un=[fixed_un]&pw=[fixed_pw]. Now we need ...
0
votes
0answers
31 views

How to get all tags of articles of specified categories in Joomla?

I want to add a "filter by tags" feature to mixitup in Joomla. I need a list of tags for specified category articles and later for each item to add titles of tags for each item. There was a "...
3
votes
1answer
84 views

Programmatically set article image

I generate/update several articles through a PHP script (in the cli folder) that parses an external data source (custom tables). This works well. Now, if an article has not yet an image, the script ...
2
votes
4answers
91 views

How to use cookies to populate RSForm fields without notices/warnings?

I have used this code to save the RSForm data in a cookie and if the user tries to fill in the same form again, the previously entered data is loaded as default values: Script called on form display: ...
0
votes
3answers
78 views

Joomla 3 call model function inside controller

I want to call a function from model inside controller my model : httpdocs/components/com_storemanager/models/searchmanager.php <?php /** * @version CVS: 1.0.2 * @package ...
1
vote
1answer
65 views

Joomla 3 return view with parameters

I'm using Joomla 3 and I have a controller with the function abc that should call a view with some parameters title & address My controller :components/com_storemanager/controller.php <?php /...
0
votes
1answer
38 views

Joomla 3 database query select with limit [duplicate]

How can I use this query with joomla 3 with limit to 3 SELECT * , (3956 * 2 * ASIN(SQRT( POWER(SIN(( $coorlat - latitude) * pi()/180 / 2), 2) +COS( $coorlat * pi()/180) * COS(latitude * pi()/180) * ...
1
vote
0answers
42 views

Homepage of multilingual site not working anymore after removing index.php (404); all other sites working

So I removed the "index.php" - part from the URL in Joomla in the following way: Change the htaccess.txt - file name to .htaccess via FTP Set the URL-rewrite Option in the Joomla Configuration ...
0
votes
1answer
75 views

Remove css admin template from component

I'm designing a custom component where I am utilising the tmpl=component ability to render the component only rather than displaying the default template. How can I remove the unwanted css files which ...
0
votes
0answers
70 views

How to fix “Application Instantiation Error” caused by “JFactory::getApplication('site')” in docker application?

I am about to move a Joomla application (Joomla! 3.7.3 Stable) into a docker environment. This unfortunately causes the JFactory::getApplication('site') an Application Instantiation Error that I do ...
2
votes
1answer
85 views

TypeError: Form is Null on Button in Admin toolbar

I am receiving TypeError: form is null in the browser console when I select a custom button added to a form using JToolbarHelper. I can insert the button to any other component as is and it will ...
0
votes
0answers
15 views

Customize alternative layout for the K2 Content module in Joomla

I already established an alternative layout php file and it's recognized by the Joomla administrator for the K2 - content modules. What I need to do now is code the layout I want in php, but the ...
1
vote
1answer
24 views

Joomshopping in Joomla - Wrong php-file assigned

I have a website using three languages, and the website includes a webshop via the Joomshopping component. The translation of the products and all worked, but the things controlled by the joomshop - ...
0
votes
0answers
17 views

Joomla 3.9.8 - Virtuemart not save correctly new manufacturer

I have virtuemart updated to version 3.4.2. and I created a new manufacturer in the backend. Finally, I assigned a new manufacturer to a product. The problem is that in my frontend, in the "sort by: ...
3
votes
1answer
98 views

How to separate database results into 2 columns?

I saw the examples of how to do the odd even way, but I want the order to flow from one whole column to the next and not alternating left to right for each alphabetical item. Can this be done? Here ...
1
vote
1answer
75 views

How to query for users from a specific user group?

I want to list only the users with a group_id value of 10. Why doesn't the following query work? $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.id, a.name, a....
1
vote
1answer
53 views

Joomla Warning Showing Incorrect PHP Version

Using Joomla 3.9.8 I recently migrated from localhost (PHP 7.1.9) to a live server (PHP 7.2) On localhost my site was installed at localhost/mysote. On my live server it's installed at dev.example....
0
votes
1answer
149 views

How to remove username field from the reset password confirmation form?

Does anybody know how to remove the username field from the reset password confirmation form? I edited the reset_confirm.xml file in /components/com_users/models/forms to remove it from the front end,...
0
votes
3answers
52 views

(Module override/PHP) Checking if a content-item has an image otherwise display a placeholder

I am customising a Joomla module (Override) and it does not seem to accommodate if an image is not selected (just shows a broken image symbol). What I'd like to do is check if there is an image and ...
0
votes
2answers
228 views

Error trying to update above PHP 7.1.27

Trying to update PHP from 7.1.27 to 7.3.3 and can't seem to. Set error reporting to max and after awhile of loading these are the errors I get on top of a white screen (admin also gone) Warning: ...
1
vote
1answer
26 views

How to pass a php array to javascript array/object with non-sequential keys

I'm trying to pass a php array to javascript, but the array has non-sequential keys. Here is a portion of the array: Array ( [1812] => Array ( [RecID] => 1 [...
0
votes
0answers
32 views

com_weblinks Unhandled exception - InvalidArgumentException

Admin Tools is notifying me of a PHP exception that occurs within the Weblinks component on Joomla 3.9.6. I have included the stack trace below for reference. The exception occurs infrequently (about ...
-2
votes
1answer
33 views

What does the line in the code below does? [closed]

$hasContent = empty($this->item->module) || isset($this->item->xml->customContent); line 23 in /administrator/components/com_modules/tmpl/module/edit.php
2
votes
2answers
37 views

How to stop Joomla 2.5 from disabling PHP

I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it). I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work. I am ...
1
vote
1answer
169 views

Generate and render a module on an article with PHP

I want to create a module and add it to an article I can already create the module manually and can add it to the article using php. I can't figure out how to add a module using php. So if I have ...

1
2 3 4 5
13