People who code: we want your input. Take the Survey

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
407 views

How to remove the suffix .html in Joomla 3

How I can remove the suffix .html in joomla 3 in my menu link even if I turn on Add URLs suffix. I want to remove in one specific article/page only. Thank you for help.
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
1answer
401 views

Include K2 tags in RSS feed

I want to show the tags, that are assigned to a K2 item, in an RSS feed. I have added: $feedItem->tags = $tag; to /components/com_k2/views/itemlist/viewfeed.php and then added: $feed .= " ...
3
votes
1answer
1k views

Show module based on Referer URL

I have a site where I need to display a module based on the URL which the user has typed into their browser. If the user types in thisdomain.co.uk they will be redirected to thenewdomain.co.uk/camps ...
3
votes
1answer
1k views

String to language constant?

How can i create a language constant instead of a classic text? I tried it so: $langConstant = strtoupper(str_replace (' ', '', $this->fieldsClass->getFieldName($oneExtraField))); $...
2
votes
2answers
5k views

Fatal error: Can't use method return value in write context

I have written a module to display images on my site, but I'm getting the following error on the site: Fatal error: Can't use method return value in write context in /public_html/camps/modules/...
2
votes
1answer
781 views

Refreshing a part of the page after Dropdown list selection

How can I refresh a part of the page when I select from a dropdown list using the onchange in HTML? I have a Reports dropdown list. Once I select a Report, a list refreshes only displaying those that ...
2
votes
0answers
349 views

jQuery inside the backend of a joomla module is not working [closed]

This is the current state of a module I'm trying to make. From the backend I select some names , and the photos of that names and in the frontend names and photos i selected will get printed at index ...
11
votes
1answer
2k views

How can I add 3rd party libraries to Joomla to have them generally available with my code

We use a number of 3rd party open source products such as PhpExcel and HtmlPurifier. In the past we have always had a separate folder for them and called them accordingly, but would now like to know ...
3
votes
1answer
3k views

Creating custom field type multiselect list - how to save the values?

I want to make a module that parses the manufacturers from virtuemart, and the user will select which manufacturers he wants to be shown in the index page. Its the first time I try to create a custom ...
3
votes
1answer
799 views

Joomla 3: applying custom module style doesn't work

I'm trying to set custom style for Joomla module. I have created the file: modules.php in /templates/MY_TEMPLATE_NAME/html directory. Content of this file below: defined('_JEXEC') or die; ...
5
votes
1answer
1k views

Custom component login task

I'm trying to do a very basic login function through my component, but I'm always getting back a TRUE response from the auth, whether I use valid credentials or not. The docs seem to indicate that it ...
12
votes
2answers
4k views

Create categories, subcategories and articles using php

Is it possible to dynamically create Joomla categories, subcategories and articles using PHP scripts? Is there any example link?
1
vote
1answer
56 views

Function getLanguage() on domain? [closed]

Function getLanguage() works on .de but not on .com domain? Did I forgot sth. right in the code? The Code Directories:
3
votes
1answer
2k views

How to use JFactory::getLanguage() from another directory?

How can I get the current selected language using the Function JFactory::getLanguage(); from another directory? I know how to do it when I am there: /web/include /web <---- [...
2
votes
1answer
610 views

RokSprocket automate Load More

for people that have used Joomla for a while you are probably familiar with RokSprocket - a content module from RocketTheme, very useful. It has a 'Load More' button, that can load the next bit of ...
-1
votes
1answer
231 views

JFBConnect and jfbclogin module in joomla 3

Hi everyone I've been used JFBConnect in joomla ver 1.5 and jfbclogin module but I am migrating in joomla version 3 the jfbclogin module are not working. Any idea will appreciated and if there an ...
7
votes
2answers
2k views

How to insert “php code” inside the .xml manifest file of a Joomla module?

I want at the fieldset of a joomla module to echo an option with some fetched results from my db: <config> <fields name="params"> <fieldset name="basic"> <field> <?php $db ...
1
vote
2answers
73 views

Text disappeared after taking style from database params

I've decided to extract the params for my module directly from the database, to put them in my variable stylesheet. I know this is not the recommended way, but for learning sake I find this to be a ...
2
votes
1answer
1k views

Function getLanguage() does not return current language?

I'm trying to get the current selected language. Here is the part of my code: define('_JEXEC', 1); define('DS', DIRECTORY_SEPARATOR); if (file_exists(dirname(__FILE__) . '/defines.php')) { ...
4
votes
2answers
6k views

Error 503 service unavailable in my Godaddy hosting with Joomla 2.5 website

I create a Joomla website before 1 year, but before 1 month my Godaddy hosting said we have reached all resources and the CPU 100%, when I contact the support they said we have a PHP Script that start ...
1
vote
2answers
4k views

Error “Fatal error: Call to a member function getKeyName() on a non-object”, but without table?

I write a small component to export data from a shop component, this is my first component, i get the error "Fatal error: Call to a member function getKeyName() on a non-object PATH\legacy\model\admin....
3
votes
1answer
1k views

Component development, how to update submenu in administration?

I added in my helper file new sub-menu item, also in xml file like every other sub-menu item, but there is still not visible in administration, i tried wit discover functionality but this is not the ...
1
vote
1answer
2k views

Old Joomla New server - Warning: Creating default object from empty value

I've just moved an oldish joomla (2.5.14) site to a newer sever. My php knowledge is very poor. The error is as follows. Warning: Creating default object from empty value in /components/...
15
votes
2answers
38k views

Where is $this->baseurl defined in joomla?

I asked this question on stackoverflow.com first (question here). In the comments you can read that it would be better if I ask that question here. On my joomla website I'm using echo $this->...
2
votes
1answer
342 views

Joomla 3 overwrite user validation rule

I have currently a joomla3 install, and I want to overwrite the server-side validation, and the clientside validation of the username (I only want users to be able to sign up with a phonenumber)... ...
1
vote
1answer
1k views

I can load data from Joomla database and external database?

It is possible to join 2 databases at the same time in a single query? For example: I want to see how many users I have on my server and how many users I have on an external server, all in a single ...
6
votes
3answers
3k views

Joomla! JFactory::getDate wrong

According to the documentation JFactory/getDate $tzOffset default value is 0. However, the following example: $date_default_offset = JFactory::getDate('now'); echo $date_default_offset->toRFC822(...
2
votes
1answer
516 views

Pagination in custom RSS feed reader

I have built a module to read a specific RSS feed and output a list of the feeds. The feed is read like this: <?php $FeedURL = $params->get('FeedURL'); $rss = simplexml_load_file($FeedURL); ...
2
votes
1answer
3k views

How can I retrieve data from MySQL table and insert it into QR code using PHP?

I have this PHP code that should retrieve data from a MySQL database and embed it into a a QR code: <?php include(JPATH_LIBRARIES . '/phpqrcode/qrlib.php'); $db = JFactory::getDbo(); ...
2
votes
2answers
665 views

2.5 template/css issues: article links not working in Chrome, link colors locked globally to white and email cloaking

I'm a Joomla, CSS and php newbie. I was tasked with creating a site for the school I just started working for based on its already hacked-up Joomla 2.5 template. I hacked it some more to get the ...
3
votes
1answer
321 views

Joomla file with classic cronjob don't work?

I have in root folder of my joomla website a php where i load joomla framework and create a xml output file, the first lines before i do a db request are: define( '_JEXEC', 1 ); define( 'DS', ...
6
votes
2answers
1k views

New Install session.save_path Error

I need to do some work locally on a Joomla 1 5.26 site. Local setup Win7, Xampp, Apache 2.4.3, PHP 5.4.7 I have numerous local Joomla 2.x and 3.x website that work fine however when installing a new ...
2
votes
1answer
1k views

Tag view Notice: Array to string conversion in

OK i have a major problem under Joomla 3. When i generate a search URL for tagged items i get the following message and i am missing a lot of items: Notice: Array to string conversion in /www/htdocs/...
1
vote
3answers
5k views

If URL is equal to X then do this

Is there any way I can echo some code if the URL matches a set URL? I know I can do this using the menu ID such as: //This is the code for the page with menu ID 3 $menuID = JSite::getMenu()->...
3
votes
1answer
3k views

&JModuleHelper::getModule doesnt return parameters in joomla 3

I am using an external to joomla script and I need to get a module's parameters. In joomla 2.5, the code was working fine, but in j3 I have problems. the code is: define( '_JEXEC', 1 ); define('...
2
votes
3answers
2k views

Detect current template style

I'm building a website with with one template but several styles. I need each style to have it's own logo, and a customized link for the logo. The template is based on the Gantry Framework. Is it ...
2
votes
2answers
2k views

Delete <li> tag of “Forgot Password”, “Registration”

I have a little problem on one of my Joomla website. I had to delete the Forgot Password... the 2/3 Links that appears under the login module. They're gone now, but still there is 3 <li> section,...
1
vote
1answer
982 views

Database error, do i need to worry about it?

I am getting this error in my error_log file. Do I need to worry about it? Although, I am having broken image link problems and SEF problems on some pages. [06-Sep-2014 20:55:05 UTC] PHP Warning: ...
5
votes
3answers
4k views

Php doesn't display special characters

I have a .php that retrieves the publish_up field and echo it. But it doesn't display the special characters such as é,è,û... Instead I get a �. I have set this content="text/html; charset=utf-8" but ...
3
votes
2answers
549 views

How to sort my query's results by publish_up value?

I have a .php script that retrieve fields from my database table and then displays them in a foreach loop (here are the relevant parts of the code): <?php $jquery1 = "SELECT `...
0
votes
1answer
174 views

How to handle RSS data coming from WordPress for Joomla's RSS Module?

I am trying to develop Bootstrap's carousel module for news which are fetched from a remote website using its RSS feed for my Joomla 3.3.3 web site. It is a WordPress web site. I have added the ...
1
vote
2answers
237 views

Database query outputting twice

I have the following database query: $database = JFactory::getDBO(); $database->setQuery("SELECT items.headline, items.image, items.copy, items.source FROM ...
1
vote
2answers
184 views

Adding/Importing a ready coded (AboutUs) page into Joomla

I am busy converting a HTML website into a Joomla temaplate, I got some help doing the home page (index.php), but now the menu items are not linking anywhere. I have a ready coded AboutUs.php page, ...
1
vote
1answer
550 views

Remove head script not working in custom component

I'm using this lines to remove header scripts of Joomla I don't need it : $doc = JFactory::getDocument(); $dontInclude = array( '/media/jui/js/bootstrap.min.js' ); foreach($doc->_scripts as $...
6
votes
2answers
3k views

Logging in user without getting password from them

My requirement is something like login by Facebook, so the user does not provide password but gets logged in. I want to make a user logged in from within extension code by knowing his user id and/or ...
3
votes
3answers
332 views

How can I diferentiate between guests and members?

How can I execute a different code in my plugin depending on if the user is logged in or not in Joomla? Basically I want to do this: <?php if (loggedin) { // Do something } else { // Do ...
1
vote
1answer
948 views

Google indexing k2 urls wrong

I moved one of my site to new domain. And also upgraded it to joomla3. i have around 200 articles/tips displaying using k2. Before moving to new domain google was indexing site well and i was getting ...
2
votes
2answers
190 views

How to make shorthand for countModules?

I'm tired of typing $this->countModules('...'). Is there a way to make alias to that function, something similar as in JavaScript when I just do var alias = myFunction? I have tried assigning $...
4
votes
1answer
708 views

Joomla Mailer won't send a second Email

I'm currently working on a big Joomla website created by a professional company, my job is to take some of the forms and update them. I've been using the Joomla Doc most of the time, but I'm still ...