× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Custom Plugins

More
6 months 2 weeks ago - 6 months 2 weeks ago #6774 by dglazeii
Custom Plugins was created by dglazeii
I need help with your {Joomdb field|[name]} format.

I created my plugin to use the ,

{joodb myplugin | [Name]} where the Name is $field. How do I define an addition field?

Example: {joodb myplugin | [Name] | [XXX]}

Name = $field
XXX = ?

Thanks
Last edit: 6 months 2 weeks ago by dglazeii.

Please Log in to join the conversation.

More
6 months 2 weeks ago #6778 by Dirk
Replied by Dirk on topic Custom Plugins
Look into
/components/com_joodb/plugins
e.G. there is a file called example.
Too call this plugin insert
{joodb example}
into a template.

Name ist just a parameter you can send to the plugin.
/components/com_joodb/plugins/hiddenfield.php
With this plugin you can insert a hidden form field in your form template.
Example {joodb hiddenfield|category}

Please Log in to join the conversation.

More
6 months 2 weeks ago #6782 by dglazeii
Replied by dglazeii on topic Custom Plugins
Here is my plugin:

{joodb myplugin|verified} - verified assigns "$field"

CODE:
<?php
// no direct access

defined('_JEXEC') or die('Restricted access');
if (count($part->parameter)>=1) {
$db = JFactory::getDbo();
$field = $db->escape($part->parameter[0]);
if ($result = $db->setQuery("SELECT COUNT(`".$field."`) FROM database_name WHERE `".$field."` = 'Yes'")->loadResult()) {
$output .= (string)$result;
}
}

Question:
How do I set,{joodb myplugin|verified|[parameters]}, parameters to use in place of the 'Yes' parameter in the plugin, ".$field." = 'Yes'

Please Log in to join the conversation.

Moderators: Dirkjoest