Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
20 views

How to include processed Joomla material?

I need to include article by ID via PHP. Not only intro- or fulltext, I need to load article, but processed with plugins and etc. For example, if article has uploaded attachments (via special ...
0
votes
1answer
17 views

Using a custom field with different names

I want to use a flexible field name for a field across different forms thru my extension. My custom example field looks like this: defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\...
2
votes
1answer
39 views

adding curent item to pagenavigation

I want to modify: /plugins/content/pagenavigation/tmpl/default.php. There are 2 <li> tags, one for "next" and one for "previous". I want to display the current article's title in a <li> ...
1
vote
1answer
30 views

Joomla.submitbutton is not a function at HTMLButtonElement.onclick

I have been facing a problem when I try to update the article from the frontend then it shows this error Joomla.submitbutton is not a function at HTMLButtonElement.onclick Here is my code &...
-1
votes
0answers
13 views

Post variables not working properly in form

I have some very simple code is executed via Sourcerer: <form action="" method="GET"> <input type="text" name="ALL"> <input type="submit" value = "Search"> </form> <...
1
vote
1answer
24 views

Can I set the directory that Joomla cache will store data in for my module?

Joomla has a nice "Clear Cache" page that lists cached content and lets you delete it. I'd like to allow cached content from my module to be deleted from there. I'm using Joomla's built-in cache ...
1
vote
0answers
12 views

mklink and JFolder: :folder: Path is not a folder [due to is_dir()]

Joomla is on Win2012 R2, XAMPP, Fabrik. I created a symlink like so: C:\Users\Administrator>mklink /D "C:\xampp\htdocs\pdf" "Z:\" symbolic link created for C:\xampp\htdocs\pdf <<===>> ...
2
votes
1answer
78 views

0 - Using $this when not in object content

I moved a website from server (PHP 5.6.38) to localhost (PHP 7.2.10). And I receive this error in the page title (in the chrome tab): 0 - Using $this when not in object content While searching ...
2
votes
1answer
27 views

I cant access all my joomla admin menus and menu labels have weired symbols, How can i resolve this?

I am from migrating a joomla website from server A to my server B but i other parts of the website work fine but my administrator side or backend has the following issues. I am not able to access all ...
-1
votes
1answer
194 views

Problems When I change my PHP version to 7.2(Error 0 Using $this when not in object context )

I have my website in production now, The site works very good with PHP 5.6 and 7.0 but When I try to change the PHP version to 7.2 the website doesn't work. It shows me an error message like this: I'...
1
vote
1answer
36 views

Custom header content depend on article

I am wondering is it possible to have different headers depending on the different articles? e.g article ID 1 shows header A and article ID 2 shows header B. Currently I have modified the template ...
-1
votes
1answer
46 views

Virtuemart 3.4 - products on manufacturer page

Virtuemart 3.4.2, joomla 3.8 i try copy code from category template, but cant fix this errors: at /my_template/html/com_virtuemart/manufacturer/details.php NOW I HAVE Two ERRORS: Call to a member ...
3
votes
2answers
36 views

I would like to add a string after 'script' at JHtml::_('script', $file, true, true);

Inside the recaptcha.php file of the Recaptcha Plugin on Joomla 3.6, I have the following code: case '2.0': $theme = $this->params->get('theme2', 'light'); $file = '...
1
vote
2answers
84 views

How to check if specific table names exist in a database?

All I want to do is check if a table exists or not and I can't figure it out. I've tried: for ($r = 0; $r < count($tableArray); $r++) { $db = JFactory::getDbo(); $query = $db->getQuery(...
1
vote
1answer
40 views

Showing a module only on first page of Category Blog

I am using this code to show a module inside blog.php: <?php echo JHtml::_('content.prepare', '{loadposition myModule}'); ?> How can I show it only on the first page of the category blog? I ...
1
vote
0answers
19 views

How to configure PHP basedir for Joomla running on IIS shared hosting

I have the following setup: IIS 10 with Plesk Onyx 17.8.11. Joomla 3.8.13/PHP 7.2.10. The website is hosted in shared hosting provider. After installing Gantry 5 I get the following warning on the ...
1
vote
1answer
141 views

Joomla 3.8 PDF view using DomPDF

I was searching a way to save a layout of my custom component as PDF. I tried various libraries JS / PHP. What I wanted was utf-8 support, tables, images to be properly saved in the pdf file. I ...
1
vote
1answer
23 views

Joomla table DESCRIBE

I'm trying to DESCRIBE a table in joomla 3.x I want to get the column names and the associated details (type etc) into an array. I want to get Name Type Collation Attributes Null ...
2
votes
2answers
59 views

How to query certain rows from a table based on other associated rows in the same table?

I'm trying to query my jos_rsform_submission_values table for FieldValue data in rows with a FieldName of Container# which shares a SubmissionId with another row where the FieldValue is "Pending" and ...
-1
votes
1answer
30 views

How to write a conditional check on a column value with a mysql query?

I am trying to setup a simple default statement on the results page of a testing system. This seems like it would be relatively simple, but I cannot get my if statement to process properly. The ...
-1
votes
2answers
34 views

Individual user fine grained ACL is it possible in Joomla! 3.x

I was wondering if it was possible in Joomla! 3.x to have permissions down to individual user level. Eg: user A can see item X but not user B even if user B is in the same group or have the same ...
2
votes
2answers
34 views

How to solve include_once() Warnings in tmp directory after migration?

After Joomla migration, I'm left with a few errors like: Warning: include_once(menu.php): failed to open stream: No such file or directory in /www/doc/www.elody.cz/www/tmp/htmlpaUI9p on line 1 ...
1
vote
1answer
71 views

Solidres Data Report for Joomla Admin

I am pretty new to Joomla & PHP so this is a broad question. My client is looking for some custom reports for Admin login on data prepared by Solidres as that Solidres doesn't have those reports....
1
vote
2answers
62 views

How to write a query with a WHERE clause with two conditions?

I cannot seem to get this select statement to work with the WHERE conditions. Depending how it loads the data, I either get the first test result or all of the test results and not the user_id-...
0
votes
2answers
55 views

In custom fields, array_values() prints “Array”

From the code below, the output is <meta mytags="tags" content="Array" /> but if I echo the array_values($field->rawvalue), it displays all the populated values from the array. Can someone ...
-1
votes
1answer
31 views

Joomla / PHPMyAdmin bug when “select” is in the value

This question was originally asked on StackExchange, and it was recommended by @mickmackusa that I ask it here. Background We recently changed over from one server to a brand new one. Old server: ...
1
vote
1answer
10 views

Targeting An Element On a Specific URL

I need to run an alternate header on a single top-level Joomla page. From what I can see, unlike Wordpress Joomla doesn't assign an ID to individual pages, making this a pain. I'm wondering if I can ...
0
votes
1answer
17 views

Installing two copies of the same site with same db and prefix for a test - is this ok

Before i start i know what your going to say no no no no no never install Joomla sites with the same prefix or on the same db but hear me out. Its the same website essentially one installed in route ...
2
votes
1answer
48 views

How to replace &nbsp; with a space?

I am creating some code to auto-generate a meta-desc for product pages in VM. I have stripped tags, but I am still seeing &nbsp in the resulting text. The code I have at present is: if ($...
0
votes
0answers
63 views

Error: Cannot access protected property Joomla\CMS\Menu\AbstractMenu::$User

randomly tried to access the production site this morning and came across the following error immediately after logging in. I cannot navigate past it and if i hit return to control panel i am ...
0
votes
3answers
70 views

Convert PHP code to Jooma PHP syntax?

I'm running a query on phpmyadmin which has the "IN" function included. It is to extract data from the same column for different fields' (Waybill1, Waybill2 etc.) I shall post the SQL query below: ...
0
votes
0answers
76 views

How to create a Joomla MVC for consuming a RESTful API

I'm looking for some help with writing a Joomla MVC which will consume a RESTful API. The API returns data in JSON and XML. The component should have two views (a frontend list with all objects - ...
1
vote
1answer
192 views

Get module id in helper file

I need to get id of current module in helper.php file of mod_menu. But there is no module parameters in this script.
0
votes
1answer
16 views

CheckToken() error when TinyMCE init

I have a form, which add some data to DataBase. <form> <input type="text" name="mydata" /> <textarea name="mytext"></textarea> <?php echo JHtml::_( 'form.token' );?> ...
0
votes
1answer
76 views

How to access user-submitted values from a dynamic form?

I want to insert a row in my db-table with inputs from users. The form the users fill out is made with a foreach-loop: foreach ($results as $row) { echo '<div class="vm_kampe"><input ...
3
votes
1answer
27 views

How is the relationship between template styles and menus stored in Joomla 3.x?

I'm working on a tool that imports content for a new language. As part of that process, I'm creating a copy of a template style specific to the new language. After making a copy of the template style ...
3
votes
1answer
102 views

How to find path and list files in directory?

I would like to simply list some files from my web server and display the file names on the front-end of my website. I use Sourcerer plugin and created a custom module where I inserted this code to ...
2
votes
1answer
34 views

Make div disapear after a while

I have made a page, where if the user update its form, the backend will send the user back to the form with a message like this: header('loaction:/index.php?msg'); On the index.php site, it loads ...
0
votes
0answers
28 views

Select file stored on web server and send as attachment in email?

I was hoping someone could help me/guide me in the right direction with this issue. I want to create a button called "Send File". When this button is clicked, a directory on my web server is opened ...
0
votes
0answers
153 views

How to redirect a different url using Controller page

After submitting a form, the page refresh with a thank you message. So how can I redirect that page to a different url after successfully submitting the form. Current Form codes are as following: &...
1
vote
1answer
117 views

How can I use a username and password to login with PHP?

I have a custom page that checks if cUser->id is zero and, if it is, I pop up a login form. Now I can't seem to find any documentation on how to remotely log in to Joomla. Any ideas?
0
votes
0answers
54 views

How to fetch data from database in a function of helper.php file of joomla module

I am new to joomla. I have developed a simple module. I need to fetch data from database in a function of helper.php. I am using $db = JFactory::getDbo(); But it giving fatal error Uncaught Error:...
-1
votes
1answer
115 views

JOIN multiple queries?

I was wondering if anyone could help me JOIN multiple queries into one query. Currently, these 2 blocks of code retrieve information from the DB. I am using "Sourcerer" plugin to add custom PHP code ...
4
votes
3answers
87 views

Add where statement to database query

I need to modify the database query to not select a certain ID in the database so the items with that ID do not show in the results. However, I cannot figure out how to do this. below I added a WHERE ...
2
votes
1answer
294 views

Convert line breaks in php textarea

I have a kind of a guestbook on my page. It's just a common textarea like this: echo ' <textarea name="msg"></textarea>'; and then I use a form to send me to the backend on submit: $db =...
0
votes
1answer
90 views

Convert article to PDF?

I was wondering if anyone knows of any way to take the HTML content of a custom module which is placed inside an article and convert the HTML to PDF via the click of a button or so. So basically the ...
1
vote
2answers
38 views

How to re-write sql for joomla JDatabase

I am new to custom Joomla coding so excuse me for this, I want to execute the following statement: "SELECT MAX(CASE WHEN v.FieldName = 'Team_Name' THEN v.FieldValue END) 'Team_Name' , MAX(...
1
vote
1answer
41 views

Send mail on execute

I have a page, where people can sign up with name and mail to a waitinglist. When they write the info, the backend add it to my db and I have an admin-page to show the list. But I would like to ...
0
votes
1answer
47 views

Hikashop, extract text after read more

I want to have the introtext and then the rest of the text in Hikashop product details page. So in the product description I insert the <hr id="system-readmore" /> to separate the introtext and ...
0
votes
2answers
94 views

Use one pdo connection across multiple modules?

I have multiple modules on the same page that are individually connecting to the same external database through pdo connections. The website is getting slower since I added more modules. My guess is ...