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
2answers
250 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
vote
1answer
41 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 ...
-1
votes
1answer
337 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
vote
1answer
81 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....
2
votes
2answers
360 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
2answers
913 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-...
4
votes
3answers
22k views

Joomla DB Insert, how to get last inserted id?

I have to insert my data into 2 different tables, in the first table I have the following query which works perfectly: $insertProjectUser = 'INSERT INTO #__pmanager_user (user_cms_id, user_email, ...
1
vote
2answers
215 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 ...
3
votes
4answers
2k views

How to write my MySQL query with JOIN logic using JDatabase methods?

I'm having a difficult time translating this SQL script to JDatabase methods because I can't find the AND query method. SELECT user.firstname, user.lastname, leadership.leadname, leadership.lead_des ...
0
votes
1answer
102 views

implode - URL doubling - image display error

Trying to display the avatar(image) from a folder already stored using a form. Error: image not displayed. I found the URL doubled in the inspect element: ----------inspect element-------------------...
3
votes
1answer
512 views

Get date value with jinput

In my form I have selecting date with datetimepicker which i'm using only date picker. I need to get the selected date value to do some calculation in php through ajax. Here is my code but the ...
2
votes
1answer
654 views

Correct ways to verify update query is successful under conditions

I was trying to find out correct ways to verify db update query is successful but some problems i am fetching. Even if update query($db->execute()) is not done/row does not exists.... but it ...
2
votes
3answers
1k views

How to launch an asynchronous php process

I am developing an ecommerce component. I have noticed that when the user makes the purchase, the process takes between 18 and 20 seconds, which is quite unacceptable. Following up the code, I have ...
6
votes
1answer
438 views

Abandonware user self-registration procedure in Joomla core

Joomla 3.6 has two different controllers intended to create a new user: UsersControllerRegistration::register() defined in components/com_users/controllers/registration.php and UsersControllerUser::...
1
vote
1answer
15 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
1k views

Fabrik Cross database joins

I have two separate databases with the same credentials: in db1.table1 there is a column containing filepaths that I need to update with a filename that is stored in db2.table2 and that I can retrieve ...
0
votes
1answer
967 views

How can I access module files externally?

I would like to call a PHP helper file (helper_ppal.php) included in a custom module (mod_ms_lib). Accessing the helper file would simplify processing PayPal IPN (Instant Paypal Notifications) ...
3
votes
1answer
2k 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
1answer
19 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 ...
0
votes
3answers
569 views

Show the language according to the IP

I have a multi-language Joomla 3.4 that at the moment only has 2 languages: my-domain.com/en/ my-domain.com/es/ I want to redirect the visitor to EN/ES according to their IP (with this library). I ...
0
votes
1answer
264 views

Uploading files using jfile and saving to database - project with RSticket

In RSTicket, you have the option to add or edit a ticket. But it does not allow you to add personalized files (images or pdf), i.e. files such as invoices, receipts, photos, etc. I have created this ...
0
votes
2answers
712 views

Why does strpos function in first condition always return true?

Something is wrong with my code. No matter what the $_SERVER['REQUEST_URI'] value is, gkPageContent is always displayed. if (strpos($_SERVER['REQUEST_URI'], "online") >= 0) { $left_col_class =...
1
vote
1answer
302 views

How to prevent a single user from voting multiple times on a single article?

I am using the Joomla Rating System, and I'm trying to change the code slightly. Right now, there is a possibility that a user can rate more than once on one article. I have already changed the star ...
2
votes
2answers
2k views

Show intro image in Category List

I added this line in my custom template to display the image: <?php echo $article->images; ?> And I got this as a result: {"image_intro":"images\/articles\/liang2.jpg","float_intro":""} ...
1
vote
4answers
5k views

Administration area keeps redirecting to homepage

I'm having a problem with accessing the administrator site... I googled too much and tried every suggestion that is mentioned in those websites.. but none of them working :S.. After going to mysite....
1
vote
1answer
907 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
180 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 ...
0
votes
1answer
589 views

Sublime Text 3: Joomla coding standard (PHP Code Sniffer) is not executed

2 years ago I installed Joomla coding standard definition for PHP Codesniffer (https://github.com/joomla/coding-standards) for Sublime Text and everything worked well. I just moved to a new laptop ...
4
votes
1answer
39 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 ...
2
votes
1answer
211 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 ...
2
votes
3answers
228 views

PHP get each line of textarea in jform

I am building a joomla 3 component. I have a text area set up in my xml document where the user can add additional JavaScripts (one per line). I then have some php which takes each line and adds the ...
0
votes
2answers
5k views

How to override/customize pagination links?

In my component, I am using Joomla default pagination calling $this->pagination->getPagesLinks() in the view template file. Say, my component url is like this at a certain point: http://...
1
vote
2answers
935 views

Transforming a Query for JDATABASE

I need to transform a simple php query into a query that JDATABASE will understand. Here is the example: $resDays = 7; // On how many days to build the top? $resLimit = ...
5
votes
2answers
1k views

Rapid Ajax calls causing some MySQL queries to be ignored

I am currently working on a Joomla website on a Unix server. There are no users connected at the moment because I'm the only one who can access it (so no heavy traffic). During testing, I proceed to ...
-2
votes
2answers
365 views

How to access the email of the user who created a submission?

I have the following working javascript code: var user_email = document.getElementById("jform_user_email"); user_email.value = "<?php echo JFactory::getUser()->email; ?>"; The next lines ...
4
votes
2answers
712 views

Get Timestamp from Database

I have data stored in a db table, with an auto timestamp. In a module I want to then display a result based on the latest timestamp. It's not working and I'm getting an error Warning: strtotime() ...
0
votes
2answers
321 views

How add days to date into query joomla?

I need to run a query that selects records whose date is not within a date range. More exactly, I need the records whose date is not found among their own date and 5 days later. For example, suppose ...
3
votes
4answers
606 views

How to only transfer new column values from one table to another?

I'm attempting to create a new table: _clients that will be simply populated with, for now, with the user_id column from #__user_usergroup_map. Ideally, the below code should pull all id's from #...
2
votes
1answer
36 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 ...
5
votes
1answer
1k 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 ...
0
votes
1answer
632 views

Display Image via Imagick

I would like to display an image which is not accessible for users (.htaccess denies all). This is my source: header('Content-Type: image/png'); $filePath = ...
2
votes
3answers
407 views

Help chaining a query?

i am struggling to get the correct syntax for my query. The query is: $query = "SELECT product_sku FROM #__virtuemart_products WHERE created_on <= NOW();"; I currently have: $query ->...
2
votes
2answers
582 views

Transform PHP SQL to Joomla SQL query

I am moving a PHP page to my Joomla website and I was advised that I "should use Joomla's coding standards and methods for everything, this includes database queries" My question is: How should I ...
2
votes
1answer
515 views

Access PHP Session from Joomla backend

I have a php session value like this, $_SESSION['variable'] = "value"; How to access this session value in Joomla admin? This session value is stored in PHP file and not in Joomla front end (php ...
0
votes
2answers
867 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
404 views

Joomla 1.5 to 2.5 : JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND

I migrated from Joomla 1.5 to Joomla 2.5 with jUpgrade. Re-installed several components with 2.5 versions, migrated Joomfish, etc... At first I had troubles getting the rewriting to work (SEF and ...
1
vote
1answer
614 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?
1
vote
1answer
1k views

Display data based on multiple where clause?

I would appreciate some help with the following. I have two customfields with ID "6" and "7". I want to display the customfield_value for customfield(6), only when a specific condition for ...
4
votes
3answers
231 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
612 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 ...

1
3 4
5
6 7
14