Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

May 24 2019

05:13

myplasticheart @ 5 Points: Fortune Uamou Black Gold Liberty

As part of its lineup for the upcoming Five Points Festival (6.1 - 6.2) in Brooklyn, myplasticheart will release their Exclusive Fortune Uamou Black Gold Statue of Liberty edition ($30) from Uamou.  A clever NYC-themed version of the figure, the Statue of Liberty variant has proven quite popular with an initial green edition (Five Points 2018), a sparkly green edition (NYCC 2018) and now this Black Gold edition.  Each of the previous editions has sold out, so if you'd like to add the newest Fortune Uamou Statue of Liberty figure to your collection, you might want to put the myplasticheart booth [#336] at the top of your 5 Points shopping list.
03:26

Feed parameter missing or not valid.

Unable to generate this feed. Parameter user_id is missing or not valid.

Please see our online help about feeds.

May 23 2019

19:19

Create a Home Page With the Elements Plugin for WordPress

Without the right tools, creating professional-looking static pages for a WordPress site is hard, even for an experienced web developer. It involves tasks such as designing responsive layouts, finding appropriate creative assets, and acquiring the right licenses to use them. If you've ever tried doing all these tasks on your own, I'm sure you understand how time-consuming and expensive they can get.

With the Envato Elements WordPress Plugin, you'll be able to perform all the above tasks with just a few clicks. This unique plugin gives you immediate access to hundreds of free template kits and over 700,000 premium royalty-free photos right inside your WordPress admin panel. By using it alongside a page builder plugin such as BeaverBuilder or Elementor, you can create stunning pages for your site in minutes.

In this tutorial, I'll show you how to use the Envato Elements WordPress plugin and the Elementor page builder plugin to create a compelling, responsive home page for your site.

Prerequisites

To make the most of this tutorial, you'll need:

If you need help installing the plugins, refer to the following tutorial:

  • WordPress
    Create Websites Fast With the Elements Plugin for WordPress
    Ashraff Hathibelagal

1. Initialize a New Page

Log in to your WordPress admin dashboard and create a new page by going to the Pages section and pressing the Add New button.

If you see WordPress's default page editor open, click on the Edit with Elementor button to switch to the Elementor page builder user interface.

Elementor UI

Next, click on the gear icon near the bottom left corner of the screen to open the Page Settings tab. Here, change the layout of the page to Elementor Canvas.

At this point, you have a blank white page you can start adding blocks to.

2. Add the First Block

The Envato Elements plugin currently offers over 600 free block templates, all of them neatly organized into intuitively named block kits. Each block template is designed to not only blend seamlessly with several other block templates, but also to look good on all screen sizes.

To add a block to your blank page, all you need to do is click on the green Envato button.

In this tutorial, we'll be creating a home page for a fictional web-hosting business named "Purple Tech".

The first block kit we'll be working with is the Hero kit, which currently has 54 blocks. Open it, scroll down to find the following template, and press the Add Block to Page button:

Hero block preview

It's a good idea these days to follow a mobile-first approach. So I suggest you now switch to the mobile view by pressing Ctrl + Shift + M in your browser.

The template's first content box is a heading displaying the name of the business. Click on it and type in the name in its Title field. Optionally, you can make it clickable by filling in the Link field.

Modifying a heading

Similarly, change the Hero Heading content box so it displays some catchy slogan.

The template also contains two text boxes, which appear next to each other on wide screens. We can use them to briefly talk about what the company has to offer. When you click on them, you'll see that a text editor opens up.

In the first text box, use the intuitive rich-text editor to create a bulleted list that looks like this:

Using the rich-text editor

We'll use the second text box to talk about starting prices and special offers. By default, the text alignment here is set to Justified. I suggest you change it to Left by switching to the Style tab and modifying the Alignment field. In this tab, you can also change the text's font family, its size, and color.

Changing text alignment to left

If you press the Preview Changes button now, your page should look like this on a large screen:

Completed hero block

3. Change the Background Image

You don't have to limit yourself to changing only the text contents of the Envato Elements blocks you use. You can change details such background images and colors too.

To change the hero template's background image, open the Navigator and select the first Section it displays.

Next, in the Edit Section panel, switch to the Style tab and click on the current background image.

You'll now be taken automatically to the Envato Elements tab of the Insert Media dialog, which gives you easy access to over 700,000 premium royalty-free photos. Note that unlike the template and block kits, these photos are not free, so you need an active Envato Elements subscription to be able to use them.

Envato Elements tab

After selecting the photo you prefer, you may have to change the background overlay to make it more visible. To do so, switch to the Background Overlay tab and experiment with the Color and Opacity fields.

Modifying the background overlay

4. Add a Features Block

As the second block of our page, we'll be adding a block that can, in more detail, enumerate the services the website offers.

So click on the Envato button again, select the Features and Benefits block kit, find the following template, and press the Add Block to Page button:

Features and Benefits block

This template too starts with a heading. Leave its text unchanged, but change its color to a shade of purple by going to the Style tab and modifying the Text Color field.

Changing text color

In the text area that's below the heading, replace the placeholder text with something meaningful. For inspiration, you can try visiting a few popular web hosting services.

Next, this block has a new type of content box called Icon Box. As its name suggests, it displays an icon, along with a title and a description.

Let's say our fictional website offers managed WordPress hosting and we want to talk about this. So click on the icon box and change the Icon field to wordpress. By default, the icon is shown framed inside a circle. You can change this by modifying the View and Shape fields.

Once you're satisfied with the looks of the icon, add appropriate text to the Title and Description fields.

Editing the icon box

Lastly, we need to change the background color of the icon box. It's blue by default, and we want it to be purple. So open the Navigator, expand the second Section, and select Inner Section > Column. Then switch to the Style tab of the Edit Column panel and update the Color field.

Changing the color of a column

This template has three more icon boxes. After you update them all, your second block should look like this on a large screen:

Completed features and benefits block

5. Add a Pricing Block

The Envato Elements WordPress plugin has a Pricing Table block kit currently containing 15 free blocks. Using any of them, you can quickly display the packages a business offers and the services they include.

Let's say our example site offers three different hosting packages. To display them, we'll be using the following block:

Pricing table block

It's worth mentioning that the Envato Elements plugin also offers a Pricing Menu block kit. This is more suited for pages that need to display the prices of individual items or services. As such, it's ideal for websites of restaurants and grocery stores.

Our pricing block is very similar to the features block we added in the previous step. It has three icon boxes, which you're already familiar with. So we can start modifying their contents right away.

You may have noticed that the font this block uses is different. To fix this, switch to the Style tab and open the Typography dialog. Here, set the Family field to Quicksand, the font family the features block used.

Changing the font family

Below each icon box is a heading box. After changing its text, switch to the Advanced tab and open the Background section. Here, you'll be able to change the background color so it matches our color scheme.

Using the Navigator is a great way to understand the internal structure of the blocks you add to your page. With it, you'll see that our current block contains a new type of box called an Icon List box.

This box is meant to display a list of items, and allows you to edit each item inside it separately. Compared to a text box, which can only display lists with basic styles, an icon list box gives you much more control over the look and feel of your list items. For instance, it allows you to easily assign a different icon to each item of a list.

Editing the icon list

For now, click on the list items and change their text contents until you have a pricing table that looks like this:

Completed pricing table

6. Add a Footer

As the last block of our page, we'll be adding the following footer, which is available inside the Footer block kit.

Footer block template

The only new element in this block is the Social Icons box, which is almost identical to an icon list box, except that it limits the icons you can use to only the brand icons of popular social platforms, such as Facebook and Twitter.

Editing social icons box

After replacing the placeholder text in the About Us, and Pages sections, your footer should look like this:

Completed footer block

The page is ready. You can now go ahead and press the Publish button to make it available on your WordPress site.

Conclusion

In this step-by-step tutorial, you learned how to use the free block kits and premium stock photos offered by the Envato Elements WordPress plugin to create a polished, responsive home page for a web-hosting business. You now know enough to start using the Envato Elements and Elementor plugins productively.

  • WordPress
    Create Websites Fast With the Elements Plugin for WordPress
    Ashraff Hathibelagal

Envato Elements, is a massive repository of creative digital assets. By subscribing to it, you gain access—with unlimited downloads and commercial rights—to over a million premium themes, templates, plugins, stock images, videos, and other handy items that facilitate website development.

Visit Envato Elements to learn more about all the exciting digital assets it offers for a low cost monthly subscription!

19:03

Create a Google Login Page in PHP

In this article, I’m going to explain how to integrate Google Login in your PHP website. We’ll use the Google OAuth API which is an easy and powerful way to add Google Login to your site.

As a web user, you've probably experienced the hassle of managing different accounts for different sites. Specifically, when you have several passwords for the different services, and a website asks you to create yet another account on their site.

To deal with this, you could offer a single sign on feature to allow visitors to use their existing credentials to open an account on your site. A lot of websites nowadays let users login by using their existing accounts at Google, Facebook or some other popular service. This is a convenient way for new users to register with a third party site instead of signing up for a new account with yet another username and password.

In this post, we’ll use the Google OAuth Login API which allows users to login with their existing Google Accounts. Of course, users should still be able to register with the usual registration form on your site, but providing Google Login or something like it can help maintain a healthy user retaining ratio.

  • PHP
    15 Useful PHP Login Forms on CodeCanyon
    Eric Dye
  • PHP
    20 Best PHP Email Forms
    Monty Shokeen
  • PHP
    Create a Contact Form in PHP
    Monty Shokeen
  • PHP
    Comparing the 5 Best PHP Form Builders
    Nona Blackman

How Google Login Works

Firstly, let’s understand the overall flow of how Google :ogin works on your site.

On the login page of your site, there are two options users could choose from to login. The first one is to provide a username and password if they already have an account with your site. And the other is to login on your site by their existing Google account.

When they click on the Login With Google button, it initiates the Google login flow and that takes users to the Google site for login. Once there, they login with their Google credentials, and after that they will be redirected to the consent page.

On the consent page, users will be asked for permission to share their Google account information with the third party site. In this case, the third party site is a site where they want to use their Google account for login. They will be presented with two options: they can either allow or deny.

Once they allow to share their information with the third party site, they will be taken back to the third party site from where they initiated the Google login flow.

At this point, a user is logged in with Google, and a third party site has access to the user profile information which can be used to create an account and do user login. 

So that’s the basic flow of integrating Google login on your site. In the rest of the post,  we’ll implement this login flow in a working example in PHP.

Setting Up the Project for Google Login

In this section, we’ll go through the basic setup which is required to integrate Google Login with your PHP website.

Create Google API Project

Firstly, you need to create an application with Google which will allow you to register your site with Google. It allows you to set up basic information about your website and a couple of technical details as well.

Once you’re logged in with Google, open the Google Developers console. That should open up the Google Dashboard page as shown in the following screenshot.

Google Dashboard

From the top left menu, click on the Select a project link. That should open up a pop up as shown in the following screenshot.

Select a project pop up

Click on the New Project link and it will ask you to enter the Project Name and other details. Fill in the necessary details as shown in the following example.

New Project page in Google Dashboard

Click on the Create button to save your new project. You will be redirected you to the Dashboard page. Click on the Credentials from the left side bar, and go to the OAuth consent screen tab.

OAuth Consent Screen

On this page, you need to enter the details about your application like application name,  logo and a few other details. Fill in the necessary details and save them. For testing purposes, just entering the application name should do it.

Next, click on the Credentials from the left side bar. That should show you the API Credentials box under the Credentials tab as shown in the following screenshot.

API Credentials selection in Google Dashboar

Click Client credentials > OAuth client ID to create a new set of credentials for our application. That should present you a screen which asks you to choose an appropriate option. In our case, select the Web application option and click on the Create button. You will be asked to provide a few further details about your application.

Create OAuth Client ID

Enter the details as shown in the above screenshot and save it! Of course, you need to set the Redirect URI as per your application settings. It is the URL where the user will be redirected after login.

At this point, we’ve created the Google OAuth2 client application and now we should be able to use this application to integrate the Google login on our site. Please note down the Client ID and Client Secret values that will be required during the application configuration on our end. You can always find Client ID and Client Secret when you edit your application.

Install the Google PHP SDK Client Library

In this section, we’ll see how to install the Google PHP API client library. There are two options you could choose from to install it: using Composer or by downloading and installing the library files manually.

The Composer Way

If you prefer to install it using composer, you just need to run the following command.

And that's it!

Download the Release

If you don’t want to use composer, you could also download the latest stable release from the official API page.

In my example, I just used Composer.

If you’re following along, by now you should have configured your Google application and also installed the Google PHP API client library. In the next and final section, we’ll see how to use this library in your PHP site.

Client Library Integration

Recall that while configuring the Google application, we had to provide the redirect URI in the application configuration. And we set it to redirect to http://localhost/redirect.php. Now it’s time to create the redirect.php file.

Go ahead and create the redirect.php with the following contents.

Let’s go through the key parts of the code.

The first thing we need to do is to include the autoload.php file. This is part of Composer and ensures that the classes we use in our script are autoloaded.

Next, there’s a configuration section which initializes application configuration by setting up the necessary settings. Of course, you need to replace placeholders with your corresponding values.

The next section instantiates the Google_Client object which will be used to perform a various actions. Along with that, we’ve also initialized our application settings.

Next, we’ve added email and profile scopes, so after login we have access to the basic profile information.

Finally, we have a piece of code which does the login flow magic.

Firstly, let’s go through the else part which will be triggered when you access the script directly. It displays a link which takes the user to Google for login. It’s important to note that we’ve used the createAuthUrl method of the Google_Client to build the OAuth URL.

After clicking on the Google Login link, users will be taken to the Google site for login. Once they login, Google redirects users back to our site by passing the code query string variable. And that’s when the PHP code in the if block will be triggered. We’ll use the code to exchange the access token.

Once we have the access token, we can use the Google_Service_Oauth2 service to fetch the profile information of the logged in user.

So in this way, you’ll have access to the profile information once the user logs into the Google account. You can use this information to create accounts on your site or you could store it in a session. Basically, it’s up to you how you use this information and respond to the fact that the user is logged in your site.

Useful PHP Form Scripts

Today, we discussed how you could integrate Google Login with your PHP website. It allows users to sign in with their existing Google accounts if they don’t want to create yet another account for your service.

If you're looking for PHP scripts that you could use right away, I recommend you visit the following posts which summarize a some excellent scripts for that are available for a low cost.

  • PHP
    15 Useful PHP Login Forms on CodeCanyon
    Eric Dye
  • PHP
    20 Best PHP Email Forms
    Monty Shokeen
  • PHP
    Create a Contact Form in PHP
    Monty Shokeen
  • PHP
    Comparing the 5 Best PHP Form Builders
    Nona Blackman

Let me know in the comments below if you have any questions!

19:03

How to Create a WordPress Child Theme

If you're using a theme you downloaded from the free WordPress theme repository, or maybe one you've bought from ThemeForest, you may want to make some tweaks to it.

Maybe you want to register a new font. Or add a new template file. Maybe you want to add some code from one of the tutorials or courses here on Envato Tuts+. Or perhaps you want to use the theme as the basis for a theme of your own design.

You might be tempted to just go and edit the source code for a third-party theme (ie. a theme you didn't write yourself), but don't! The next time you update that theme, new files will be downloaded and you'll lose all the changes you made.

Frustrating, to say the least.

But what can you do, if you do need to edit the theme?

Luckily there is a way to edit the code in a theme, and still have the ability to download the latest updates: that's by creating a child theme using the original theme as a parent theme.

This means that you'll activate the child theme in the WordPress admin, but within that theme's code are instructions to WordPress telling it that this is a child theme, and what the parent theme is. You keep the parent theme installed on your site, but you don't activate it. (It's essential to keep it installed, as without it, the child theme will break.)

In this tutorial I'm going to show you how to create a child theme in WordPress. I'll also give you some tips on how child and parent themes work, so you know which set of code is being used to display the content in your site.

Creating The Child Theme

The first thing to do is to create the child theme in your wp-content/themes folder. The child theme must have two files to work: a stylesheet and a functions file. You can also add optional files, such as template files or include files.

Create a folder for your child theme in the themes folder and give it a suitable name. I'm calling mine tutsplus-child-theme.

Inside that folder, create a file called style.css.

At the top of that file, add the following commented out code:

This tells WordPress that this is a theme, and provides the same information about the theme as you'd find in any theme—with one addition. The Template: twentynineteen line tells WordPress that this is a child of the Twenty Nineteen theme.

You can use any theme as a parent theme, by using the name of the folder where it's stored. Don't use the title of the theme: instead, use the folder name.

Now save the stylesheet and create another file in your child theme, called functions.php.

In this file, you need to enqueue the stylesheet from the parent theme. It used to be that you did this by using an @import line in the stylesheet, but this is no longer the recommended way to do it.

Instead, in your functions file, add this code:

This correctly enqueues the stylesheet from the parent theme, using get_tempate_directory_uri() to find that theme (the template directory is the folder where the parent theme is stored, while the stylesheet directory is the folder where the current theme is stored).

If you want to add any styling to your child theme to override or augment the styling in the parent theme, you go back to the stylesheet for your child theme and add it there. Don't add in in the functions file or try enqueuing any more stylesheets.

You can also add functions to the child theme's functions file, and template files to the theme folder, which will override the same template files in the parent theme.

So now you have your child theme set up—it's that easy! However, it's worth understanding exactly how child and parent theme template files interact.

Creating Template Files

Now let’s take a look at theme template files. Which template file WordPress uses to display a page on your site will depend on two things: the template hierarchy and the files you add to your child theme.

Imagine you’re viewing the Travel category archive page in your site. WordPress will use the template hierarchy to find the most relevant file:

  1. a category archive template file for that specific category, using the slug: category-travel.php
  2. a category archive template file for that specific category, using the ID: category-23.php
  3. a general category archive file: category.php
  4. a general archive file: archive.php
  5. the catch-all: index.php

WordPress will look for these in both your parent and child theme. WordPress will use the first file in the hierarchy that it finds, whether it’s in the parent theme or the child theme.

There’s one exception. When the most relevant template file has a version in both the parent and child themes, WordPres will use the file from the child theme, and ignore the one from the parent theme. This is one of the most common uses for child themes—to override a specific file in the parent theme.

Here are a few examples, using the category example above:

  • If your child theme has archive.php and index.php, and your parent theme has category.php and index.php, then WordPress will use category.php from the parent theme because it’s highest in the hierarchy.
  • If your child theme has category.php and index.php and your parent theme has archive.php and index.php, WordPress will use the category.php file from the child theme, as this is highest in the hierarchy.
  • If your child theme has archive.php and index.php and your parent theme has archive.php and index.php, WordPress will use the archive.php file from your child theme. This is because there are two copies of the file highest in the hierarchy, and the child theme overrides the parent theme.

So if you want to override a template file in your parent theme, create a duplicate of that file in the child theme with the code you want. Or create a file that's higher in the template hierarchy and add that to your child theme.

Adding Functions to the Child Theme

Functions work differently than template files, and are a little less straightforward.

If you add a function to your child theme with the same name as one in your parent theme, WordPress will throw an error, because it's trying to call the same function twice.

But this won't happen if the function in the parent theme is pluggable.

A pluggable file is enclosed in a conditional check for another function with the same name, which looks like this:

Here, WordPress will check that no function has already been called that has the same name. If so, it will run this function. This is because functions from the child theme are called before functions from the parent theme. If you write a function in your child theme with the same name, that will run instead.

But what if the parent theme function isn't pluggable and you want to override it?

Well, you can do that by writing a new function that essentially cancels out the function in the parent theme, and giving it a higher priority than the function in the parent theme, so that it runs after it the parent theme funciton. Alternately, you can unhook the function from the parent theme and write a new function in the child theme, hooked to that same hook.

Imagine the function in the parent theme looks like this:

If your function in your child theme could undo the parent theme's function without you having to actually stop the parent theme function from running, you'd write it like this:

But if you had to prevent the parent theme's function from running, you'd unhook it first, like this:

Note that you still have to put the remove_action() function inside another function, hooked to the wp_head() hook in this case.

Then you could write the function for the child theme as if the one from the parent theme never existed—remembering not to give it the same name, though!

Child Themes Are a Useful Tool for Editing Themes

Child themes have two main uses: 

  • With a theme that's been designed for use as a parent theme (often refered to as a framework). The framework isn't designed for use on its own: instead, you add styling and extra template files with a child theme.
  • To allow you to edit the parent theme without actually directly editing it, or to add extra template files. This means that when the parent theme is updated in the future, you won't lose your work.

So next time you read a tutorial telling you to use a child theme instead of editing a third-party theme, you'll know what to do!

  • WordPress Themes
    Twenty Nineteen Teardown: Using the New WordPress Default Theme
    David Gwyer

01:36

Feed parameter missing or not valid.

Unable to generate this feed. Parameter user_id is missing or not valid.

Please see our online help about feeds.

May 22 2019

13:28

Um cheirinho de alecrim


PRÉMIO CAMÕES 2019 - CHICO BUARQUE
FIQUEI CONTENTE!...






06:56

Feed parameter missing or not valid.

Unable to generate this feed. Parameter user_id is missing or not valid.

Please see our online help about feeds.

05:41

DTA Dunny 2019 Show at Five Points Festival (6.1 - 6.2)

The DTA Dunny Show returns for 2019 at the Five Points Festival in Brooklyn (6.1 - 6.2).  Clutter, Kidrobot and the Designer Toy Awards have teamed up once again to bring you custom Dunnys (5", 8" and 20") from a talented lineup.  This year's DTA Dunny roster includes Battle Damage Dave, Beanie Bat, CZEE13, Fakir, Fer MG, Fluke, Frank Montano, Jared Flores, Jfury, Lisa Toms,  Mr KumKum, Muju World,  Mus Musculus, Muxxi, One-Eyed Girl,  Owl Berry Lane,  PJ Constable, Remjie, Sad Salesman, Travie McCoy, Vanessa Di Tullio and more.  All proceeds from the DTA Dunny Show will be donated to support the DTA Dunny Show. After its initial run at Five Points Fest, remaining pieces from the DTA Dunny Show will be on display at the Clutter Gallery in Beacon and available online from Clutter on 6.11.
04:03

Kidrobot SDCC 2019 Exclusives Pre-Sale (3.22 - 3.24)

The wondrous, never-ending convention schedule rolls on.  While we're mostly focused on Five Points Festival, SDCC is already on the board—just under two months out—as Kidrobot has just announced its four exclusives which they will offer via a three-day pre-sale starting on Wednesday (3.22) and running through Friday (3.25).   KR's 2019 SDCC exclusives include the Buzzkill Chia Pet 5" Dunny  [200 pieces, $40] by Kronk,  Mecha Godzilla 8" Chrome vinyl art toy [500 pieces, $100], SpongeBob 20th Anniversary 8" Shellebration art toy[300 pieces, $50] and the Aggretsuko 6" Rage Red GID vinyl art toy [500 pieces. $40 each]. The Buzzkill Chia Pet Dunny continues KR's new Chia Dunny tradition which began with last year's Jeremyville's Grow Love Daily Chia Dunny.  The stylish and shiny—thanks to an electroplating process—8" Mecha Godzilla arrives shortly after the new Godzilla: King of the Monsters film (5.31) and begs the question, of whether the character will make an appearance in the film.  As you might know, we have a weakness for translucent and clear toys, so that SpongeBob 8" Shellebration figure is pretty tempting. The best (safest) way to purchase KR's SDCC Exclusives is to get them through their pre-sale release (3.22 - 3.25) with limited quantities of each available at 9 AM PDT from Kidrobot.com. KR will ship pre-sale exclusives as week after SDCC.  Limited quantities of the SDCC exclusives will be available at the show from the Kidrobot booth.

May 21 2019

22:09

ToyQube x Tezuka Productions Greeting Astro Boy Black on Black Edition (5.23)

U: Release is on Thursday (5.23), not Friday. ToyQube will complete its Black on Black editions of its Astro Boy City series with the pre-order release of the Greeting Astro Boy—featuring the tradiitional Thai greeting—in the all-black colorway ($99.95) on Thursday (5.23) at 12 PM PDT from ToyQube.com. This one is slated to ship in July. Officially licensed through Tezuka Productions, the Astro Boy city series celebrates New York City (Liberty design), Bangkok (Greeting design) and Los Angeles.  While the NYC Black on Black is sold out, the Los Angles Black on Black is currently available from ToyQube ($145).
20:53

Shoko Nakazawa Beasts In The Lower East at myplasticheart (5.31)

Shoko Nakazawa will open Beasts in the Lower East, her first NYC solo show, at myplasticheart on Friday (5.31) from 7 to 10 PM. Byron is front and center as the star of the show with paintings, customs, production editions, exclusives and more all featuring Shoko's signature character.   In fact, look for a Byron retrospective showcasing his production editions from 2014 to 2018.  Shoko will be making the trip all the way from Japan and will be live painting (8-9 PM) during the opening and signing from 9 to 10 PM.  mph will be handing out numbered line tickets starting at 1 PM EDT at the store to determine the order for the line which will start forming at 6:30 PM. As they say, the early bird gets the Byron. Her solo is a great way to kick off the Five Points Festival weekend (6.1 - 6.2) where she will be signing and sketching at the Little Hut [#334] on Saturday (6.1) from 2 to 3 PM and at myplasticheart [#336] on Sunday (6.2) from 2 to 3 PM. Shoko Nakazawa || Beasts In The Lower East Opening: Friday, May 31st 2019 (7 to 10 PM) myplasticheart 210 Forsyth St. New York NY 10002 646.290.6866
19:42

Law Sun-Yeung x adFunture Space Woody New York Edition for Five Points Fest (6.1 - 6.2)

adFunture is returning to NYC for its first appearance at Five Points Festival (6.1 - 6.2) and they are bringing along some brand new drops.  The New York Edition of Space Woody by Law Sun-Yeung is a fun word association riff.  Quick, what movie do does 'Woody' make you think of ?  Space Woody features the purple + green colors worn proudly by a courageous cosmic toy to 'Infinity and Beyond'.  adFunture will release Space Woody and the rest of their 5 Points lineup at their booth [#232].
19:17

Strangecat Toys @ Five Points Fest Exclusive Daydream Nimbus Fawn

With Five Points Festival just a few weeks away (6.1 -6.2), Strangecat Toys is starting to reveal what's in store for collectors.  First up is their Exclusive Daydream Nimbus Fawn vinyl toy, part of Kurobokan's AKC series. Fawn features an adorable light brown version of the pup with a mouth and pink ears.   Limited to 150 pieces, Fawn (3.5" L x 2.5" H) will be available for $45 from Strangecat's booth [#423] at 5 Points. Any remaining stock will be available online at a later date.
15:21

Create a PHP Login Form

A user login and registration system is super helpful when we want to store information about users of our website. This applies to everything from educational websites which might store course progress and marks to e-commerce website which will store information about customers' past purchases.

In tutorial I'll teach you how to create your own PHP login and registration forms from scratch.

Creating the Login and Registration Forms

Our first step will be the creation of a login form and a registration form. The forms will actually be pretty simple. The registration form will only ask for a username, email and password. The username and email will be unique for everyone who registers. If any one tries to create two accounts using the same email address we will show them an error message letting them know that the email is already in use.

Coding the Registration Form

Here is the HTML for creating the registration form. You have to put it in a file named register.php.:

The form is very basic but we do use HTML5 in order to do some very basic input validation. For instance, the use of type="email" will alert users when the email address that they entered is not in proper format. Similarly, the use of the pattern attribute on the username will make sure that the username only consists of alphanumeric characters.

You can read the tutorial titled form input validation using only HTML5 and regex if you want to learn more about the topic. You can also take client-side form validation to the next level with jQuery by getting you more power over the error messages that are shown and their placement as well as appearance. If you want to learn more about client-side validation, check out those posts.

Coding the Login Form

Here is the HTML for the login form. You can to put it in a file named login.php.

Style the Forms With CSS

Here is some CSS that you can apply to these forms:

This contains some additional styling rules for error messages and headings. The HTML and CSS from this section can be used as the basis of your project when you create your own forms which might require different styling and input fields.

Creating the User Table and Connecting to the Database

The next step is creation of a user table that will store all the information about the registered users. In our case, the table simply consists of four columns: an auto-incrementing id, a unique username, an email, and a password.

You can use the following SQL to create the table quickly.

Now, create a file called config.php and write the following code in it to connect to the database.

Change the database name to whatever the name of your database is. This file will be used to establish a connection to the database.

Code the User Registration

It is finally time to implement the registration functionality. The main function of this code would be to check if the supplied email is already registered. If it is not, we enter the username, email and password into the database.

Place the following code at the top of registration.php.

The first step is to include of config.php and start the session. This helps us store any information that we want to preserve across the pages.

Next, we check if the user has clicked on the Register button to submit the form by checking if $_POST['register'] has been set. Always remember that it is not a good idea to store passwords as plain text. For this reason, we use the password_hash() function and then store that hash in our database. This particular function creates a 60 character hash using a randomly generated salt.

Finally, we execute the query and check if a non-zero number of rows exist for a given email address. If they do, users will get a message saying the email address is already registered.

If no row exists with given email address we enter the supplied information into our database and let the users know that the registration was successful.

Implementing Login Functionality

In our last step, we write the code for logging users in. This time we simply check the information in the database to see if the username and password combination entered into the form is correct.

Here is the code that goes at the top of login.php.

One important thing to note here is that we don't compare the usernames and password in a single step. Because the password is actually stored in a hashed form, we first need to fetch the hash with the help of the supplied username. Once we have the hash, we can use the password_verify() function to compare the password and the hash.

Once we successfully confirm the password, we set the $_SESSION['user_id'] variable to the ID of that user in the database. You can also set the value of other variables here.

Restricting Access to Pages

Most websites where users are asked to register generally have some other pages where users access and store private data. You can use session variables to protect these pages. If the session variable is not set, simply redirect the users to login page. Otherwise, show them the contents of the page.

The only thing that you have to do is to ensure the script contains session_start() at the beginning.

Final Thoughts

In this tutorial, we learned how to create a basic user registration and login system using PHP. Once you grasp the basics of login and registration systems, you can create more complicated logic that allow users to reset their password or verify their email address, etc.

You can also add more front-end validation with HTML5 attributes or jQuery to make the form more user-friendly. 

  • HTML5
    Form Input Validation Using Only HTML5 and Regex
    Monty Shokeen
  • JavaScript
    Easy Form Validation With jQuery
    Monty Shokeen

If you want to speed up your web development, you can check out some of the premium PHP form scripts available from CodeCanyon.

  • PHP
    20 Best PHP Email Forms
    Monty Shokeen
  • PHP
    12 Best Contact Form PHP Scripts
    Nona Blackman
  • PHP
    Comparing the 5 Best PHP Form Builders
    Nona Blackman
  • PHP
    15 Useful PHP Login Forms on CodeCanyon
    Eric Dye

If have have any questions related to this post, please let me know in the comments.

05:06

Feed parameter missing or not valid.

Unable to generate this feed. Parameter user_id is missing or not valid.

Please see our online help about feeds.

May 20 2019

23:35

Create Beautiful Forms With PHP Form Builder

If you are a PHP developer, creating forms, validating form submissions, and managing PHP sessions are probably tasks that are part and parcel of your job. All these tasks, although rather repetitive, require lots of time and attention, especially if you care about best practices relating to design and security.

By using a well-tested form builder library, you can significantly improve not only your own efficiency, but also the robustness of your PHP applications. CodeCanyon has a large variety of premium form builder libraries for you to choose from. PHP Form Builder, developed by Envato author migli, is one of them.

PHP Form Builder supports modern CSS frameworks such as Materialize, Foundation, and Bootstrap 4, and both client-side and server-side form validation. It also includes several pre-built form templates, jQuery plugins, and database utilities.

In this tutorial, I'll show you how to perform common form-related operations using PHP Form Builder.

Prerequisites

To make the most of this tutorial, you'll need:

  • PHP 7.0 or higher, with the cURL extension enabled
  • an Envato account

1. Installing the Library

PHP Form Builder is premium PHP library available on CodeCanyon. So log in to your Envato account and purchase a license for it.

PHP Form Builder on CodeCanyon

You'll now be able to download a file named codecanyon-8790160-php-form-builder.zip. Make sure this file is available on your development server.

I suggest you create a new project directory to store all the files you'll be creating and using in this tutorial.

Next, extract the ZIP file you downloaded. Inside the parent directory named phpformbuilder, in addition to the source code, you'll find various templates, assets, and help files.

Usually you'll only need the phpformbuilder sub-directory. So move it to the project directory.

2. Registering the Library

If you purchased a regular license, you'll be able to use the library locally on your development server and on one domain in production. For now, let's register the library only from the development server.

Start by launching a PHP development server. Here's how you can start one to listen on port 8000:

Alternatively, feel free to use the Apache web server instead.

You must now open a browser and visit the local registration URL, which looks like this: http://localhost:8000/phpformbuilder/register.php

In the form shown, enter your purchase code, which you'll find in the purchase confirmation email sent by CodeCanyon, and press the Register button.

PHP Form Builder registration page

Once the registration is successful, you can start using the library.

It's important to note that if you want to use this library in production, you'll have to complete this registration process from your production server too.

3. Creating a Simple Form

Create a new file named index.php and open it using a text editor. We'll be writing all our code inside this file.

PHP Form Builder's Form class has most of the method's you'll need to create your forms. Here's how you import it:

It's usually a good idea to use a PHP session while handling form data. So now would be a good time to start a new session:

To create a new form, you must create an instance of the Form class, whose constructor expects the name of the form as an argument. For now, let's create a simple user registration form:

To add input fields to the form, you can use the addInput() method, which expects the type of the field, its name, its default value, and its label. Except for the name and type, all other arguments are optional.

The following code shows you how to create a few different types of fields:

To add a submit button to the form, use the addBtn() method, which is very similar to the addInput() method.

4. Rendering the Form

Our form is now complete. But we're going to need some HTML boilerplate before we can render it. So, after closing the PHP tag, add the following code, which creates an empty HTML document:

At this point, by calling the render() method of the Form object inside the <body> of the document, you can render your form. It will, however, be very plain looking.

Form without any styles

Therefore, before calling the render() method, you must remember to add a few stylesheets and JavaScript files to the document.

PHP Form Builder supports many popular CSS frameworks. It's your responsibility to include the latest CSS and JS files of the framework you wish to use. In this tutorial, we'll be using the Twitter Bootstrap 4.3 framework.

So, inside the <head> of the document, add a <link> tag that points to Bootstrap's stylesheet. If you don't have it locally, you can always use a CDN. Here's how:

PHP Form Builder has its own styles too, which you must add to the document. You can do so by calling the printIncludes() utility method.

Furthermore, for best results, I suggest you add some padding and margins to the form by enclosing it in a div.

Towards the end of the <body>, you must also include jQuery and Bootstrap 4's JavaScript files.

Lastly, you must include PHP Form Builder's own JavaScript files and code by calling the printIncludes() and printJsCode() methods.

If you open index.php in a browser now, you'll be able to see that the form looks like this:

Form with styles applied

In case you were wondering, here's what the form looks like with Materialize as the CSS framework:

Same form but with MaterializeCSS

4. Validating Inputs

PHP Form Builder has a Validator class you can use to simplify server-side form validation. Here's how you import it:

For the sake of another example, let us now create a simple form whose inputs we can validate. Because we'll be validating the inputs on the server-side, we must pass novalidate as an argument to the constructor of the Form class. This turns off the browser's default, client-side validation logic, allowing users to submit the form regardless of validation errors.

Our new form is going to accept a name, an age, and an email address with the following conditions: the name must be at least eight characters long, the age must be an integer that's less than 45, and the email address must be a valid one.

Here's how to use the addInput() and addBtn() methods, which you are already familiar with, to create the three fields and a submit button:

As you can see in the code above, PHP Form Builder supports method chaining. The startFieldSet() and endFieldSet() methods, as you may have guessed, allow you to group your inputs and add a header to them.

The form validation process should run only after the user has submitted the form. To detect this event, all you need to do is check if the page was accessed using the HTTP POST method.

Inside the if statement, you can go ahead and create an instance of the Validator class by calling the validate() method, which expects the name of the form you want to validate.

The Validator object has several intuitively-named methods to validate input fields. For instance, you can use the minLength() method to check if the value of the name field is at least eight characters long. Similarly, you can use the integer() and max() methods to check if the age is an integer that's less than 45.

All the validation methods automatically generate meaningful error messages when necessary. If you're not satisfied with them, however, you are free to provide your own custom messages.

After you've added all the checks, you must remember to call the hasErrors() method to check if any of them failed.

In case of failed checks, the getAllErrors() method returns all the error messages. To display them, you must update the $_SESSION variable. The following code shows you how:

If you try submitting the form with invalid values now, you'll be able to see the validator in action.

Form showing error message

5. Adding Styles

PHP Form Builder allows you to manually assign CSS classes to your form fields. Both the addInput() and the addBtn() methods accept a fifth parameter, which you can use to customize the associated field.

The following code shows you how to add the btn and btn-primary CSS classes to the submit button:

With the above change, the button will look like this:

Submit button using a different style

One of the best things about using PHP Form Builder is that it supports most Bootstrap themes right out of the box. This means, switching from one Bootstrap theme to another is extremely easy.

All this while, we were using the default Bootstrap theme. To switch to one of the free themes available on Bootswatch, all you need to do is change the <link> tag you added earlier. Here's how you can use the Slate theme:

With this new theme, as you can see in the screenshot below, the form's look and feel is very different.

Form with Slate theme

Conclusion

You now know how to create good-looking forms and handle form submissions using PHP Form Builder. In this tutorial, you also saw how easy it is to use custom CSS styles and themes to beautify your forms.

To learn more, do refer to the extensive documentation present in the ZIP file you downloaded.

  • PHP
    Comparing the 5 Best PHP Form Builders
    Nona Blackman
  • PHP
    Create a Contact Form in PHP
    Monty Shokeen
  • PHP
    12 Best Contact Form PHP Scripts
    Nona Blackman
  • PHP
    Create a PHP Email Script and Form
    Monty Shokeen

23:27

5 React Native UI Kits, Themes and App Templates

React Native has caught fire as one of the most prominent JavaScript libraries for making stunning mobile apps, especially those with expanded interaction capabilities.

If you’re a cross-platform mobile developer though, it can be tough to keep up with all the different frameworks, but that’s where UI kits, themes, and app templates come in! Let’s take a look at how these pre-made kits and templates can give you a huge edge on your mobile React Native projects, helping to create a better project and saving your sanity at the same time.

  • React
    10 React Native Applications for You to Use, Study, and Apply
    Eric Dye
  • Mobile App
    10 Best React Native App Templates of 2019
    Nona Blackman

Why Use a React Native UI Kit or Template?

Building a mobile app from scratch can be a daunting task, even with the help of frameworks like React Native. 

There can easily be dozens of screens, navigation elements, interactive elements, and micro interactions. With a UI kit to start from, however, you get a collection of ready made, visually consistent UI components, so you can focus more heavily on adapting existing actions to fit your purposes and refining your user experience, rather than wasting large amounts of time creating the same standard interactions over and over again.

For experienced developers, using a UI kit or app template can get you from zero to minimum viable product more easily and quickly than with starting from an empty repository. This means that you can spend less time on the boring parts, ensure a standard of quality throughout your whole project, start with a clean code base, and get a higher return on your invested effort.

Also, if you’re new to making mobile interfaces with React Native, a template can help you to learn the lay of the land. They often contain code and UI components for types of screens that aren’t immediately apparently necessary, and for elements that you might miss.

Can Anyone Use These UI Kits and App Templates?

While the UI kits we talk about here do significantly reduce the amount of resources and expertise it takes to make an app, they aren’t quite at the same level as drag-and-drop builders when it comes to ease of use.

For the templates that integrate with WordPress sites, getting an app up and running is significantly easier, especially if you already have a website finished. In these cases, only a minor amount of coding knowledge is needed, just enough to stitch together the pieces.

The UI kits focus more on the front-end of an app though, and often need some form of back-end or content management system to be integrated with them to fully function. In these cases, some programming knowledge may be necessary to complete your project.

Compared to creating an app from scratch though, the relative difficulty is much lower, as is the amount of time and resources needed to make a finished product.

Let’s take a look at some of the best templates and UI kits that are available.

Antiqueruby UI/UX Elements

One of the best selling mobile templates on CodeCanyon, Antiqueruby is a robust collection of React Native components that promises to save you more than 200 hours in development time per project.

This isn’t surprising based on the more than 250 individual screens that are contained within the UI package.

In addition to some generic screen layouts, such as sign in screens, navigation, and profiles, Antiqueruby also includes clusters of screens based around different types of apps. Most notably are its screen collections for apps dealing with music, e-commerce, travel, food, crypto, and more!

Antiqueruby React Native UI Kit screenshot

Besides including beautiful UI and UX components, this package includes the full source code for all of the screens in React Native, and is ready to be used on either Android or iOS devices.

Here’s some of the highlights of the Antiqueruby React kit:

  • support for iOS 8.0+ and Android 4.1
  • can handle RTL text by default
  • includes templates for more than 250 different screens
  • 15 individual screen clusters and specialized app types
  • integration with WordPress and WooCommerce sites
Antiqueruby React Native UI Kit screenshot

The authors of this kit are also publishing new UI clusters all the time, with screens for news apps and recipe apps on the horizon. If you’re looking to make a mobile app, the Antiqueruby React Native UI kit will give you a massive headstart.

BeoStore: Complete Mobile UI Template

While Antiqueruby focused on a providing a large number of screens and elements, BeoStore aims to provide a cohesive set of designs around a single topic.

This UI template pack is largely built for the eCommerce space, and offers a number of benefits that aren’t common among other React Native UI themes. Category pages, shopping carts, checkout flows, user profiles, and more are all included within this comprehensive collection.

BeoStore Complete Mobile UI Template

Here are some of the stand out features of BeoStore:

  • pre-built animations and transforms
  • well-documented code, including video tutorials
  • support for the most popular icon fonts, including Font Awesome and MaterialIcons
  • code in modern JavaScript ES6
  • support for styling in SCSS
  • Support for iOS 7.0+ and Android
  • connects to WordPress and WooCommerce
BeoStore App Template e-commerce app example

With all of these features, you can use BeoStore to get your app started quickly with a sleek and easy to use UI. For those that are already using WordPress or WooCommerce, the process gets even easier! By using these two frameworks together you can build an native app in its entirety, with only a small amount of coding necessary to pull together the pieces.

DUIS School App Template

A niche UI theme, the DUIS School React Native app template gives you all of the elements necessary to build a school management mobile app.

The template looks great and provides a comprehensive set of screens around schools, but if you’re looking to do a significant amount of development, keep in mind that this template requires Mac for development. However, the end product will work on both iOS and Android.

DUIS School React Native UI

Though the documentation for this template is sparse, a clear project structure makes it a suitable enough theme to use for app makers in the school and education space. Screens include general app features, as well as attendance screens, student profiles, and screens for grading.

ReactXS: React Native Material Design Kit

A UI kit for material design, ReactXS provides a variety of elements and screens that can be customized to fit into your project. Like most of the kits on this list, ReactXS gives a leg up when developing your own themes or mobile apps, shaving off weeks of work from your development time.

Here’s some of the stand out features for this UI Kit:

  • both a light and dark theme
  • cluster of screens specifically for onboarding users
  • performance testing and optimization
  • reusable code components
ReactXS UI Kit

If you’re looking to build a mobile app outside of the more popular niches, this UI kit can give you a solid base to start your design from.

Myyaow Realtor

A niche UI Kit, Myyaow Realtor provides an in-depth series of screens and elements for those looking to build a React Native app in the real estate industry.

Its wide range of screens fit together cohesively, and making it a good choice if your app works with home or apartment listings, real estate agents, or other search-heavy formats.

Myyaow Realtor UI Kit

Some of its standout features are:

  • builds for iOS and Android (though requires a Mac for development)
  • more than 20 screens designed for the real estate niche
  • screens for complex forms and search functions
  • React Native components users and agents

If you want to make an native app in the realty or real estate space, then check out this app template!

How Will You Build Your React Native App?

With all of these mobile app templates and UI kits available, which will you choose to build your own React Native app?

Let us know how the process goes in the comments below, and about how you used a pre-made UI kit or app template in your own projects!

21:43

Kartoon Kubism

Now I’ll be the first to admit that I only have a superficial understanding of Cubism or abstract art but the cartoonist in me likes it because it’s funny. Picasso is pretty funny. Juan Gris is not as funny but he has great color and design sense. Of course every cartoonist knows Miro is the funniest.    Anyway I always liked this stuff even though I'm no expert on fine art.  I
03:16

Feed parameter missing or not valid.

Unable to generate this feed. Parameter user_id is missing or not valid.

Please see our online help about feeds.

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl