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
2answers
441 views

onUserAfterSave called twice because of addUserToGroup

The process of registration is taking way too long (22 secs) so I've been profiling the plugin execution to see what is happening. My registration process is something I do with a custom component (...
1
vote
1answer
339 views

Adding all form parameters in a custom item of the component

I prepared a component and i have to add different categories and custom items with lots of fields in my component.But What i want is to display all the joomla's fields for adding a new item in my new ...
1
vote
2answers
76 views

Show products based on my custom attributes to second addon domain site

I'm using virtuemart 2.0 and joomla 2.5 with a commercial template mowebso_ecommerce - Default. I want to show some products on my first website eg. firstsite.com and some products on second site eg. ...
2
votes
3answers
2k views

Plugin development - parse error: syntax error, unexpected 's' (T_STRING)

I'm having a shot at developing my first plugin for Joomla, its just a simple plugin which places some javascript just before the close of the body. The javascript works fine if I place it directly in ...
3
votes
3answers
540 views

Security: best practices for disabled_functions and classes

Because Joomla uses so much third party components and such, what are some safe functions and classes to add to the php.ini for disabled_classes and disabled_functions? The reason I ask this is for ...
11
votes
1answer
128 views

Docs use assign by reference (=&) but is this necessary with PHP 5?

I've noticed in the Joomla documentation, such as for JFactory/getSession, that the examples use assign-by-reference (=&), rather than a simple assignment (=). $session =& JFactory::...
3
votes
1answer
550 views

Correct way to verify if the logged in user is super user

As my question implies what i want, i used google to search through the web to get correct answer though simple about how to verify if current logged in user is super user or not in both joomla 2.5 ...
10
votes
2answers
4k views

Adding joomla's default toolbar in a component view page

I am developing a mvc component for both joomla 2.5 and 3.In many components i saw they added joomla's default command buttons like new, edit, publish, trash, options at top of their settings page in ...
13
votes
2answers
2k views

How can I programmatically get the Joomla database prefix using php?

I sometimes access the Joomla DB via external scripts. The problem I have is that if I ever need to change the prefix, I'll need to edit my scripts again too. Is there a way to programmatically ...
2
votes
3answers
276 views

Correct manner of using View- and Model-Abstracts in Joomla 3+

There are a lot of API changes in Joomla between 2.x and 3.x versions. In development of Joomla 3-components I still use the legacy class abstracts: jimport('joomla.application.component.view'); ...
10
votes
2answers
2k views

What's the difference between JHtml:script() and $doc->addScript?

I developed a module recently that required certain JS and CSS files to be injected into the <head> of each page. Initially, I used: $doc =& JFactory::getDocument(); $doc->addScript(JURI:...
11
votes
3answers
3k views

Best method to check if a component is installed/enabled?

Between joomla 2.5 and 3.x what is the best way to check if another component is installed and/or enabled? There exist a helper class called JComponentHelper but I believe the isEnabled function will ...
5
votes
1answer
690 views

Gantry PHP Notice: Undefined property: Gantry::$belatedPNG

So I'm running the master Gantry template however I'm constantly hitting the following PHP notice in my error log - like 20/30 times a day: PHP Notice: Undefined property: Gantry::$belatedPNG in /...
19
votes
3answers
7k views

Whats the correct way for exception handling?

In Joomla core I find still many calls like this: // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); ...
8
votes
3answers
5k views

How do I pull data from a K2 extra field that is an array?

I'm building a site that uses K2 extra fields, but I'm customizing the output so I'm not just pulling the entire extra field block. Normally something like this works for single entry fields: <?...
3
votes
4answers
702 views

Override default php session

I'm building a AngularJs app using joomla in background. The AngularJs app get loaded once and then calls the server always through ajax. Some calls happen simultaneously. If I'm using the default PHP ...
7
votes
3answers
267 views

How to resolve `Strict standards` warning for different method signatures across Joomla versions

In updating an extension to support Joomla 3.x we've run into a few cases where the signature for a function has changed since 2.5 and results in a Strict standards warning. For example in the JTable ...
7
votes
1answer
3k views

SMTP no error but not sending email

I have been battling with this for some time now. I have built a custom component for forms and it uses Joomla's mail functions to send email. I have checked all the data to make sure it is correct ...
26
votes
3answers
10k views

What's the proper way to get the entire $_POST?

In Joomla! 2.5.x I could simply run JRequest::get('post'); but seeing as JRequest is deprecated in Joomla! 3.x I should use JInput. At them moment this is the code I'm using to get the entire $_POST: ...
8
votes
3answers
6k views

How do I generate a SEF URL in a custom module instead of the real URL?

In my module, this code is being used to generate the URL of the page: JURI::base() . ContentHelperRoute::getArticleRoute( $article->id, $article->catid ) This works exaclty as it should and ...
17
votes
9answers
10k views

How to improve server response time?

What can I do, other than using a cache plugin like jotcache, to improve the server response time of my website? I have already removed all inactive articles modules, plugins and components, is there ...
8
votes
3answers
3k views

Custom menu get title of the active menu's parent item

I can get the title of the active menu using $menu = &Jsite::getMenu(); $menuname = $menu->getActive()->title; But how can I access it's parent title?
30
votes
3answers
4k views

Method for creating a subquery using JDatabase

At http://docs.joomla.org/Selecting_data_using_JDatabase, there isn't a documented method for writing a subquery using JDatabase. https://gist.github.com/gunjanpatel/8663333 exemplifies one way of ...