Just The Facts

Pages

  • Home
  • Joomla
  • PHP
  • .Net , C# & Firebird
  • Links

Wednesday, 16 December 2015

Joomla: Create Automatic Contacts with Contact Creator Plugin


Joomla allows you to automatically save new contacts in your Contact component when a user create an account.
In this tutorial we will show you how to use Contact Creator plugin to build a simple user's directory.

Enable the Contact Creator plugin

  • Go to Extensions > Plugins
  • Search for "User - Contact Creator" plugin
Contact Creator plugin joomla
  • Automatic webpage is optional
  • Select the category for new contacts
  • Set automatically publish the contact as yes
  • Set status as enable
  • Save when you’re done
Contact Creator plugin joomla

Test: register a new user

  • Go to the register area in your frontpage
  • Fill all the information such as username, email, password, etc
  • When you're done, click register button
Contact Creator plugin joomla
In your backend, go to Components > Contacts to confirm the new contact item was created automatically.
Contact Creator plugin joomla

Create a menu item

Let’s create a public page to display all the contacts
  • Go to Menus > Your menu > Add new menu item
  • In menu item type choose Contact > List contacts in a category
  • Select the category
  • Save when you're done
Contact Creator plugin joomla
Visit your public site to see the end result:
directory
 
Posted by bigmcgeek at 05:52 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: joomla

Saturday, 12 December 2015

How to Create Tabs without Third Party Extensions for a Joomla Article

Joomla comes with native tabs support for single articles. The plugin that render this feature is the same that split an article into several pages.
In this tutorial we will show you how to add tabs in your articles with the Page break plugin.

The article

  • Go to Content > Articles > New
  • Add some content, in my example I’m using dummy text.
joomla page break plugin tabs
  • Put the mouse cursor at the beginning of the first paragraph, which later will be displayed as a tab.
  • Click Page break
joomla page break plugin tabs
  • Set a Page title
  • Add an Alias, such as some-text-with-no-spaces (optional)
  • Insert page break
joomla page break plugin tabs
Repeat the process to create a new tab. Put the mouse cursor in the end of the first set of content. For example: the second paragraph.
  • Set a title for the article
  • Save and close

The Page Break plugin

  • Go to Extensions > Plugins
  • Search “Content - Page Break”
joomla page break plugin tabs
  • Set Presentation Style as “tabs”
  • Be sure the plugin’s status is enabled
  • Save and close
joomla page break plugin tabs

The menu item

We need a link to display the article in frontend.
  • Create a menu item through Menus > Your menu > Add new menu item
  • Menu item type: Articles > Single article
  • Choose the article
  • Set a Title
  • Save and close
joomla page break plugin tabs

End result

Preview the article with tabs from the new menu item in your public site:
joomla page break plugin tabs
 
Posted by bigmcgeek at 01:03 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: joomla

Saturday, 21 November 2015

Joomla database escape() and quote() functions

The escape() function is used to escape bad characters in order to protect against SQL injection.

The quote() function is used to quote strings, because different database dialects have different quoting characters.
So depending on the database system you use, Joomla will choose the appropriate quoting characters.
Posted by bigmcgeek at 04:40 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: joomla, joomla component, joomla database

Friday, 20 November 2015

To add a filter to Joomla component side bar using options

To add a filter to Joomla component side bar  using options

$db   = JFactory::getDbo();
$query = 'SELECT mycolumn FROM MyTable';
$db->setQuery($query);
$rows = $db->loadObjectList();
$options = array();
foreach ($rows as $row) {
   $options[] = JHtml::_('select.option', "$row->mycolumn", JText::_($row->mycolumn));

}
JHtmlSidebar::addFilter('- Select mycolumn -','mycolumn', JHtml::_('select.options',$options,'value', 'text', $this->state->get('filter.mycolumn'), true));
Posted by bigmcgeek at 04:46 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: joomla, joomla component

Monday, 2 November 2015

PHP- function for format file size unit

function formatSizeUnits($bytes) {
    if ($bytes >= 1073741824) {
        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
    } elseif ($bytes >= 1048576) {
        $bytes = number_format($bytes / 1048576, 2) . ' MB';
    } elseif ($bytes >= 1024) {
        $bytes = number_format($bytes / 1024, 2) . ' KB';
    } elseif ($bytes > 1) {
        $bytes = $bytes . ' bytes';
    } elseif ($bytes == 1) {
        $bytes = $bytes . ' byte';
    } else {
        $bytes = '0 bytes';
    }
    return $bytes;
}
Posted by bigmcgeek at 22:45 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: php

PHP alternative syntax for some of its control structures: if, while, for, foreach, and switch

for PHP 4, PHP 5

PHP offers an alternative syntax for some of its control structures; namely, if, while, for, foreach, and switch. In each case, the basic form of the alternate syntax is to change the opening brace to a colon (:) and the closing brace to endif;, endwhile;, endfor;, endforeach;, or endswitch;, respectively.

<?php 
if ($a == 5): ?>

A is equal to 5
<?php endif; ?>

In the above example, the HTML block "A is equal to 5" is nested within an if statement written in the alternative syntax. The HTML block would be displayed only if $a is equal to 5.

The alternative syntax applies to else and elseif as well. The following is an if structure with elseif and else in the alternative format:

<?php
if ($a == 5):
    echo 
"a equals 5";
    echo 
"...";
elseif (
$a == 6):
    echo 
"a equals 6";
    echo 
"!!!";
else:
    echo 
"a is neither 5 nor 6";
endif;

?>

Note
:  
Mixing syntaxes in the same control block is not supported.  
Posted by bigmcgeek at 04:57 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: php

Friday, 23 October 2015

Establish connection with an Amazon S3 client.using PHP

If PHP S3 client connection is not set correctly, you will get following error:
1) Error retrieving credentials from the instance profile metadata server
2) AWS HTTP error: cURL error 60: SSL certificate problem:

For S3 PHP SDK version 3, the correct connection for S3 client as follows:

 <?php
  require $_SERVER['DOCUMENT_ROOT'] . '/aws/aws-autoloader.php';
  use Aws\S3\S3Client;
  use Aws\S3\Exception\S3Exception;
  use Aws\Common\Credentials\Credentials;


//AWS access info
if (!defined('awsAccessKey')) define('awsAccessKey', 'mykey');
if (!defined('awsSecretKey')) define('awsSecretKey', 'mysecret');


$bucket = 'defashion2u';

try {
$client = S3Client::factory(array(
    'version' => 'latest',
    'region'  => 'us-east-1',
    'credentials' => array(
    'key' => awsAccessKey,
    'secret'  => awsSecretKey
  ),
    'http'    => [
        'verify' => $_SERVER['DOCUMENT_ROOT'] . '/aws/cacert.pem'
    ]
));
} catch (S3Exception $e) {
    echo $e->getMessage() . "\n";
}

?>


The parameter version, region, credentials and SSL cert must be set.
More info on the ca cert, here
Posted by bigmcgeek at 06:35 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: amazon s3, php
Older Posts Home
Subscribe to: Posts (Atom)

Advertisement

Popular Posts

  • Opportunistic Locking & SMB2
    What is Opportunistic Locking? Opportunistic locking (oplocks) is a Windows-specific mechanism for client/server databases to allow multip...
  • c# - TextFieldParser
    using Microsoft.VisualBasic.FileIO; string csv = "2,1016,7/31/2008 14:22,Geoff Dalgas,6/5/2011 22:21,http://stackoverflow.com,\"...
  • Network discovery stays off in Windows Server 2012
    In order to enable the Network Discovery on a domain make sure the following services are enabled and running: DNS Client Function Discove...
  • How the PCB for bonus is calculated
    The Potongan Cukai Bulanan (PCB, a.k.a. Scheduled Monthly Tax Deduction) calculation for bonus is not so straight forward. Here is how it ...
  • Firebird - Context variables
    ----------------------------------------- Generic user and system context variables ----------------------------------------- for firebir...
  • Beginner’s Tutorial on Using the Firebird ADO.NET Client 2.5
    http://www.codeproject.com/Articles/33675/Beginner-s-Tutorial-on-Using-the-Firebird-ADO-NET
  • SourceGrid - Open Source C# Grid Control
    http://www.codeproject.com/Articles/3531/SourceGrid-Open-Source-C-Grid-Control
  • InnoSetup Dependency Installer
    http://www.codeproject.com/Articles/20868/NET-Framework-1-1-2-0-3-5-Installer-for-InnoSetup
  • Validating Properties In A .Net Propertygrid Control
    The easiest way to validate a certain property in a .Net propertygrid control is using the PropertyValueChanged event.The code bellow shows...
  • To remove the font size, search box & space above the header in joomla 2.5
    To remove the font size, search box & space above the header in which they preside in the Beez 20 template there are 2 steps. All you mu...

Followers

Blog Archive

  • ▼  2015 (14)
    • ▼  December (2)
      • Joomla: Create Automatic Contacts with Contact Cre...
      • How to Create Tabs without Third Party Extensions ...
    • ►  November (4)
    • ►  October (8)
  • ►  2013 (10)
    • ►  September (1)
    • ►  June (6)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
  • ►  2012 (49)
    • ►  November (6)
    • ►  October (7)
    • ►  September (3)
    • ►  August (5)
    • ►  July (2)
    • ►  June (7)
    • ►  May (3)
    • ►  April (10)
    • ►  March (2)
    • ►  February (3)
    • ►  January (1)

Labels

  • .Net
  • amazon s3
  • android
  • bonus pcb
  • business
  • button
  • C#
  • css
  • css print
  • File System
  • firebird
  • gimp
  • html
  • iis
  • image
  • income tax
  • innoSetup
  • investment
  • ipad
  • iphone
  • java
  • javascript
  • joomla
  • joomla component
  • joomla database
  • joomla model
  • jquery
  • large photo
  • mobile phone
  • mssql
  • ODBC
  • open source
  • Opportunistic Locking
  • passport
  • passport renewal
  • pcb
  • php
  • PropertyGrid
  • remote app
  • slideshow
  • smartphone
  • SMB
  • SMB2
  • web
  • web browser
  • windows 8
  • Windows form
  • windows server
  • Xml

About Me

bigmcgeek
Knowledge, Information and Useful tips
View my complete profile

Advertisement

Simple theme. Powered by Blogger.