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.

2
votes
1answer
60 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 ...
0
votes
0answers
185 views

Admin site gets error “0 Class 'JToolbarHelper' not found error”

I attempted to upgrade my Joomla website and I am getting the following error: 0 Class 'JToolbarHelper' not found Based on other recommendation I added following code: if(!class_exists('...
2
votes
1answer
24 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
94 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
34 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
45 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
32 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
75 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
37 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
16 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
84 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
22 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
57 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
28 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
29 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
65 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
58 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-...
-1
votes
2answers
45 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 ...
1
vote
1answer
34 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
53 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
68 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
55 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
163 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
14 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
70 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
67 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
24 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
139 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
87 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
40 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
91 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
77 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
250 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
65 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
37 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
35 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
40 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
66 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 ...
3
votes
1answer
38 views

Component Development PHP Version Check

I've been developing a component, and have been trying to find some information, to no avail, of having my component perform a check of the PHP version before install. If PHP is greater than 7, then ...
3
votes
2answers
154 views

Check if INSERT query was successful or failed because of a duplicate UNIQUE KEY

I have a db-table called league where the mail column is the unique id: |name |mail | |Bryan|bryan@hotmail.com | I have a frontend where users can sign up and then I have this for ...
0
votes
2answers
86 views

Rows with same id in same div

I have a db-table called vm_kupon. It looks a little like this: |id |uid |bet | |1 |20 |1 | |2 |20 |2 | |1 |21 |X | |2 |21 |1 | |1 |22 |X | |2 |22 |X | I ...
1
vote
1answer
46 views

Don't add empty fields to database after submission?

Is there any PHP code which will allow me to NOT submit any empty fields to the database. I have a form with about 200 fields, and a lot of the times many of them are empty. How can I not add the ...
2
votes
1answer
43 views

Joomla Migrating Live Site To Localhost -Navigation Not Working

I just migrated a Joomla site from live to localhost. Have the front end up and can access the backend without problem. Front end wise none of the menu items work. I have renamed the live site ...
3
votes
1answer
82 views

What is the prefered method for sharing code and SQL queries in joomla 3.9+?

I'm developing a component that is targeting Joomla 3.9+. The code is not using the legacy classes and is instead using the new namespaces. The component will duplicate much of the functionality from ...