Käynnissä

Create a simple Wordpress plugin (mood01)

Create a new plugin for Wordpress (called "mood01"). The plugin will do four main things

1) Upon installing the plugin, it will create a custom table in MySQL (detail below)

2) Create a shortcode to generate HTML for a form (detail below)

3) Create a hook to process the data from the form defined in #2 (see detail below)

4) Create a shortcode to render HTML for an unordered list of 7 records from the custom table (detail below)

#1: CREATING CUSTOM TABLE

The custom table should be created ( [url removed, login to view] ) for storing records created by the [collect_mood_form] plugin. The PHP snippet used for creating this table should be:

$table_name = $wpdb->prefix . "mood_sample";

$sql = "CREATE TABLE $table_name (

id mediumint(9) NOT NULL AUTO_INCREMENT ,

wp_user_id mediumint(9) NOT NULL,

sample_time datetime DEFAULT NOW() NOT NULL,

mood_code int NOT NULL,

annotation varchar(255) DEFAULT '' NOT NULL,

serial_month_num int,

serial_day_num int,

related_post_id mediumint(9),

PRIMARY KEY pk_id (id),

INDEX ix_user_day (wp_user_id,serial_day_num ASC)

);";

#2: SHORTCODE FOR HTML FORM

Create a shortcode called [mood_log_form] which renders the following HTML:

Enter wordpress user id:

Happy

Hopeful

Determined

Stable

Guilty

Overwhelmed

Angry

Alone

Scared

Sad

Brief Comments:

Save

#3: PROCESS FORM

When data is POSTed to the /process_mood_sample by the above form, the plugin should insert a record into the mood_sample table created in step 1. It should then redirect to the currently logged in user's profile page.

#4: SHORTCODE FOR LATEST RECORDS

Create a shortcode called [latest_mood_list] which runs a SELECT query on the mood_sample table and finds the most recent 7 records for the currently logged in user's id ( mood_sample.wp_user_id == get_current_user_id() ). It outputs the records so that they appear as HTML like shown below, with the entries in descending date order (newest sample_time records appearing at the top).

sample_time: 2013-02-09 mood_code:7

sample_time: 2013-02-08 mood_code:7

sample_time: 2013-02-07 mood_code:7

sample_time: 2013-01-29 mood_code:7

sample_time: 2013-01-25 mood_code:7

sample_time: 2013-01-19 mood_code:7

sample_time: 2013-01-04 mood_code:7

Taidot: MySQL, PHP, WordPress

Näytä lisää: wordpress codex, sad 17, prefix top, php create table, creating php table, create table php, create profile form php, codex wordpress org, codex wordpress, asc it, wordpress installing, create custom wordpress plugin, wordpress custom redirect, create user profile html, simple redirect wordpress, wordpress mysql insert data, wordpress create, php select insert sql, simple annotation, wordpress logged, create simple wordpress form, wordpress mysql query, php form create, wordpress shortcode, html wordpress plugin

About the Employer:
( 27 reviews ) Mesa, United States

Projektin tunnus: #4232907

Myönnetty käyttäjälle:

upekshawisidaga

I can build this plugin for you.

100 $ USD 5 päivässä
(16 arvostelua)
4.9

5 freelanceria on tarjonnut keskimäärin 174 $ tähän työhön

dinotech

understood your requirement and ready to start................

220 $ USD 18 päivässä
(38 arvostelua)
6.1
webmantratech

Let's Start... Accept our BID. Check PMB. Thanks

150 $ USD 3 päivässä
(9 arvostelua)
4.2
kunaleipl

Hello, We are the masters in word press. Please check PM. Thanks

250 $ USD 14 päivässä
(8 arvostelua)
4.1
reformconsulting

Dear Sir, Greetings! We are Reform Consulting with 5 years of experience under our belt. We are really interested to work on your project. Please see PM. Thank you. Regards, RCPL.

150 $ USD 5 päivässä
(3 arvostelua)
3.2