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
2
votes
3answers
56 views

Cannot Connect To MSSQL Server

I am using php 7 and trying to connect to mssql server. I have this code: <?php $serverName = "server"; //serverName\instanceName $connectionInfo = array( "Database"=>"...
2
votes
1answer
31 views

How do I pass _JEXEC to a php file?

I have a form in my Joomla! site. Once completed, the form should send an e-mail but only if some conditions have been met. Not having been able to use standard, commercially available mailers while ...
1
vote
2answers
28 views

Deleting rows in two different tables

I'm trying to make function (task) and deleting rows in two tables. But I don't get this sql query working, I only got this error: 1064 - An error has occurred. You have an error in your SQL syntax; ...
0
votes
1answer
42 views

Photo size validation

I use the Fox Contact component on my website, and through that component users send me photos (as an attachment) I had to make a few modifications in the upload form itself and make filters for file ...
1
vote
1answer
53 views

Pass PHP variables to CSS?

I want to pass some variables to my css, without using inline styles. During some research I found different sources pointing to the same solution. For example here on the Joomla forum. Basicly they ...
0
votes
2answers
34 views

How to reference a file locally within my class

I'm trying to use file_get_contents to reference a .json file in my module. My directory structure is as follows my custom field which is trying to reference the json file /models/fields....
0
votes
2answers
61 views

How to change logo's link URL?

I recently bought a new domain and transfered my old site's files to it. It's all nice, but the logo still points to the old site. How can I adjust it? Here's my new site home page and the logo is in ...
1
vote
2answers
82 views

Best way to clear a group's cache in Joomla via php, from an administrator plugin?

So background: I'm making a caching plugin that clears our site and CDN caches when content is saved in the administrator backend. In this instance, I want to clear the site cache for one group. My ...
0
votes
1answer
39 views

Controller Joomla - Output Class construct for color css style

thanks to you i'm learning a lot about php and Joomla Develop! Many thanks! Now i'm trying to understand php class into joomla and construct output i've created this class into my controller.php ...
0
votes
1answer
30 views

How to extend class on my component class in controller.php

I have created a Basic Joomla Component with Component Creator in order to prepare every single files in less the 1 minute :D (I'm lazy, i know.) I have one view default and one for form edit. I ...
1
vote
2answers
64 views

Use custom fields in index.php template file

For some reason i need tu use articles custom fields in index.php file template, i try this code without success : This after defined('_JEXEC') or die('Restricted access'); JLoader::register('...
0
votes
1answer
34 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?
1
vote
1answer
35 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
36 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
34 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
21 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
31 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
49 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
54 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
55 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
56 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
62 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
53 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
43 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
116 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
78 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
106 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
17 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
38 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
74 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
110 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
46 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
96 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
103 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
130 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
81 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
42 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
59 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
119 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
125 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
136 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
20 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
29 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
112 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
81 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
2 3 4 5
13