You are on page 1of 298

This book is work in progress.

Please check back


regularly as new content is added frequently.

The Complete
Guide To
WP Symposium
Pro

From absolute
beginner to expert
WP Symposium Pro v15.1.1
Document version: 0.45
www.wpsymposiumpro.com
Simon Goodchild
1

Looking for something and not sure where to start?

DON'T PANIC!
The index on page 275 (at the end) of the book is a
good place to go, and if you're viewing online, click on
the page number to jump quickly to the page.

Contents
1. Introduction

11

What is WP Symposium Pro?


Getting WordPress
Getting WP Symposium Pro
WP Symposium Pro Extensions
Support and Help

11
11
12
12
13

Getting Started Quickly


15
Add Profile pages, Friends and Activity
15
Add Forums
16
You want more?
16
Video Tutorials
17
Blog17
Mailing List
17
Facebook and Twitter
17
How this book is arranged
18

2. Core Features

19

Profile Page
19
Quick Start
19
The Default Profile Page
20
[wps-activity-page]21
Shortcodes32
[wps-display-name]33
[wps-avatar]34
[wps-avatar-link]35
[wps-activity-post]36
[wps-activity]38
Administration47
Change Avatar Page

49
3

Quick Start
49
Shortcodes50
[wps-avatar-change]50
Edit Profile Page
53
Quick Start
53
Shortcodes54
[wps-usermeta-change]54
[wps-usermeta]56
[wps-usermeta-change-link]58
[wps-usermeta-button]59
[wps-close-account]60
Administration61
Friends Page
63
Quick Start
63
Shortcodes64
[wps-friends]64
[wps-friends-pending]65
[wps-friends-status]66
[wps-friends-add-button]67
Administration68
Alerts69
Quick Start
69
Shortcodes70
[wps-alerts-activity]70
Adding alerts to your theme
72
Administration73
Forums75
Quick Start
75
Shortcodes76
[wps-forum-page]76
[wps-forum-post]77
[wps-forum]78
[wps-forum-comment]88
[wps-forums]91
[wps-forum-backto]94
[wps-forum-show-posts]95

[wps-forum-sharethis]99
Administration101
Building Your Own Profile Page

103

WP Symposium Pro Extensions Plugin

115

WP Symposium Pro Extensions Plugin


Getting the Extensions Plugin
Activating the Individual Extensions

117
117
118

3. Core Extensions

119

Custom Email Alerts


119
Administration119
Login and Redirect
121
[wps_login_form]121
Login Form
123
Registration Form
124
Forgotten Password? Form
126
Redirecting users from the admin dashboard
127
Setting a registration code
128
System Messages

129

Menu Alerts

131

4. Activity Extensions

133

Choosing Activity Recipient(s)

133

Activity share lists

135

Activity attachments
137
Images137
YouTube videos
138
SoundCloud139
Website link previews
139
How website link previews work
141
Removing the image/preview
142
5

Dynamic Previews?

142

Likes and Dislikes


143
Shortcode options
144
Like/dislike alerts
146
Rewards for Likes/Dislikes
146
Administration146
Favorite Activity
147
Shortcodes148
[wps-favourites]148
Activity to Facebook

149

5. Members Extensions

153

Profile Extensions
153
Creating Profile Extensions
154
[wps-extended]158
Showing a Profile Extension
158
Profile Security
Areas of security
Levels of security

161
162
162

Member Directory
163
Quick Start
163
Shortcodes164
[wps-directory]164
[wps-directory-search]167
Adding Profile Extensions to the Directory
169
Default Friends

171

Rewards173
Quick Start
173
Shortcodes176
[wps-reward]176
[wps-badge]176
[wps-rewards]177
Administration177
Image Galleries
6

181

Quick Start
181
Shortcodes182
[wps-gallery]182
[wps-gallery-list]189
[wps-gallery-grid]190
Administration192

6. Forums Extensions

193

Image and Document attachments

193

Custom Forum Fields (Forum Extensions)


Creating a Forum Extension
Adding an Extension to a Forum
Showing forum extensions as a column on forums

195
195
196
197

Forum Search
199
Quick Start
199
Shortcodes200
[wps-forum-search]200
[wps-forum-search-results]201
Forum Permissions

203

Forum User Signatures

205

Forum Subscriptions
207
Shortcodes207
[wps-subscribe-forum]207
[wps-subscribe-post]209
[wps-manage-subscriptions]210
Send forum posts/replies to activity stream

213

Forum Toolbars
BB Codes Toolbar
WYSIWYG Toolbar

215
216
216

Forum YouTube videos

217

Custom Forum Page

217

7. Groups Extensions

219

Groups219
Quick Start
219
Shortcodes (for Groups page)
220
[wps-group-create]220
[wps-groups]221
[wps-my-groups]223
Shortcodes (for Group page)
224
[wps-group-title]225
[wps-group-image]225
[wps-group-description]225
[wps-group-admin]226
[wps-group-edit]226
[wps-group-delete]228
[wps-group-join-button]228
[wps-group-post]229
[wps-group-activity]229
[wps-group-members]230
[wps-group-id]231
[wps-group-url]231
Administration232
Default Groups

233

8. Private Messaging Extensions

235

Private Messages
235
Quick Start
235
Shortcodes236
[wps-mail]236
[wps-mail-post]240
[wps-mail-comment]243
[wps-mail-recipients]244
[wps-mail-backto]245
[wps-mail-search]246
[wps-mail-to-user]246
[wps-alerts-mail]248
8

Message Attachments
Images and Documents
YouTube videos

251
251
252

Email alerts

253

Site-wide chat room


255
Quick Start
255
Shortcodes255
[wps-lounge]256
Calendar257
Quick Start
257
Shortcodes257
[wps-calendar]258
[wps-calendar-post]260
[wps-calendar-backto]262

9. Using shortcodes in theme page templates

265

Functions available
265
Activity266
Directory266
Members266
Rewards266
Forums267
Groups267
Private Messages
267
Calendar268
Core/Miscellaneous268
Passing options

268

Examples268
Unread mail messages icon
269
New friend request icon
269
New alerts icon
269
Dropdown list of alerts
270
Quick member select dropdown
270

10. Core Functions (API)

273

Accessing the API

273

API Functions
Insert Activity Post
Get user's last active date/time

273
273
274

Index277
Hooks and Filters

295

Change Control

297

10

1. Introduction

What is WP Symposium
Pro?
WP Symposium Pro is a WordPress plugin that will allow you to run
your own social network either as an entire site, or as part of your
site.
If you have a WordPress website, then you are good to go! If you
dont then you will require a self-hosted installation of WordPress.

Getting WordPress
WordPress can be downloaded from http://www.wordpress.org, or
installed with a hosting company.
Whilst out of scope for this book, rest assured that installing
WordPress, especially if via your own hosting company, is a
11

straightforward and normally painless experience.


WordPress provides a number of guides and instructions on
installing WordPress at http://codex.wordpress.org/Installing_
WordPress.

Getting WP Symposium Pro


Once youve installed WordPress, installing WP Symposium Pro
couldnt be easier.
Via your admin dashboard, select Plugins from the left menu and
choose Add New.
Search for WP Symposium Pro and then click on the Install
button. It will download, install and give you the option to activate
the plugin - go for it!
Youve just installed the core plugin of WP Symposium Pro!

WP Symposium Pro Extensions


In addition to the core plugin, there is a second plugin, referred to
as the Extensions plugin which whilst not required, adds a massive
number of extra features and functionality. This can be purchased
via http://www.wpsymposiumpro.com/shop.
Once you have purchased a licence, you can download a ZIP file of
this plugin from your account page at http://www.wpsymposiumpro.
com/my-account.
To install this ZIP file, via your admin dashboard, go to Plugins
and then Add New. This time, click on Upload Plugin instead of
searching. You can then select the ZIP file that you downloaded,
install it and activate like before.
And thats all there is to it!
12

Youll want to get going quickly, and the Getting Started Quickly
chapter of this book will show you how to quickly get your social
network up and running with some basic pages.
However, as you read through the chapters of this book, you will see
that there are hundreds of options available that will allow you to
tailor your social network just how you like it.
For example, you can include:







Activity page, with attachments and videos


Unlimited forums
Private messaging, including group conversations
Photo galleries
Friendships
Member directory
Groups
and much more!

Support and Help


In addition to this book, there are a number of options for support
available:

Helpdesk Support
Available via http://www.wpsymposiumpro.com/helpdesk for
licensed members.

Forums
A general community which is moderated, but priority is given to the
helpdesk. http://www.wpsymposiumpro.com/forums.

Live chat support


Normally, you will find friendly support staff online at http://www.
wpsymposiumpro.com who will be happy to chat!
13

14

Getting Started Quickly


Okay, youve read the previous chapter (maybe) and want to get
your social network up and running quickly. Im going to assume
youve got your WordPress website installed, along with at least the
core WP Symposium Pro plugin (see the previous chapter if not).

Add Profile pages, Friends and


Activity
On the dashboard menu, go to WPS Pro->Setup and click on Add
Profile Pages.
Erm, thats all there is to it!
Four new pages are created on your WordPress site for each of the
profile pages (View, Edit, Friends and Avatar).
15

You may want to add your new pages to your WordPress menu.

Add Forums
You can have an unlimited number of forums, each setup the
following (incredibly easy) way.
On the dashboard menu, go to WPS Pro->Setup and click on Add
Forum.
Enter a name and description, and click on the Publish button.
And, er, thats all there is to that too!
A new WordPress page is created on your site for your new Forum.
You probably want to add your new page to your WordPress site
menu.

You want more?


Already you have a profile page, friends page, and forums. Your
members can edit their profile and upload an avatar.
But trust me, you only scratched the surface!
How about letting your users select which friends to share activity
with, and attach images? Or groups perhaps? Maybe a directory of
members? What about forum subscriptions?
How about YouTube, maps (and more!) automatically detected and
shown on Activity, Forums and Private Messaging - not just between
two members, but even group conversations! So much more can be
added to your own social network!
To understand the complete list of features that you can add to your
social network, youre already doing the best thing - reading this
book!
16

You can also see the full list at http://www.wpsymposiumpro.com/


shop.

Video Tutorials
To supplement this book, there is a growing number of videos, check
them out at http://www.wpsymposiumpro.com/getting-startedvideos.

Blog
All releases come with release notes, the latest of which is available
via your admin dashboard, WPS Pro->Release Notes.
Previous release notes, tips and articles are all added to the WP
Symposium Pro blog at http://www.wpsymposiumpro.com/blog.

Mailing List
Every article is also published via a mailing list. I recommend you
subscribe so you are automatically informed of new releases,
features and articles. Simply go to the blog page above, and down
the side of the page pop in your email address (after logging in).

Facebook and Twitter


Whilst we dont provide support via Facebook and Twitter (we keep
that all in one place on the WP Sympsosium Pro website), all new
blog posts are copied there, so worth liking and following us!
https://www.facebook.com/wpsymposium
https://twitter.com/@WPSymposium
17

How this book is arranged


The first set of chapters explains each type of page that you might
have on your social network, for example the Profile Page.
Then within each chapter you will find:
Quick Start
Shortcodes
Options for each shortcode
Hooks and Filters for each shortcode
Administration (WPS Pro menu on the admin dashboard)
Further guidance
Further guidance will vary. For example, in the Profile Page chapter,
after covering all the applicable shortcodes, a section shows how to
build your own profile page.
In addition to the table of contents, at the end of the book is a list of
all hooks and filters, and an index.
A tips and tricks chapter provides answers to common questions we
receive.

Style Guide
Code within the book is shown in a fixed width font, for example:
[wps-activity-page user_avatar_size="200"]

Hyperlinks are shown blue and underlined. In the electronic version,


the website of the hyperlink can be visited by clicking on the
underlined text.
http://www.wpsymposiumpro.com

18

2. Core
Features

Profile Page
The profile page is the users main page, or home page if you like.
Its where the go by default to see their activity, their friends activity
and if you want, where they can go to edit the profile, change their
avatar (their user picture), accept friendship requests and so on.
Because WP Symposium Pro is so flexible, you get to choose what
appears on their profile page, so we will go through from creating a
basic page, to a more complex one.

Quick Start
The quickest way to create your profile pages is to go to WPS Pro>Setup and click on the Add Profile Pages button. This will create
4 pages:
Profile page
19

Change Avatar page


Edit Profile page
Friends page
Having created the 4 pages, you probably want to add them to your
WordPress menu, via Appearance->Menus.
So, having done that, you will have 4 new pages, and your users can
access them via your site menu.
If you menu doesnt look like it does via Appearance->Menus, you
may need to check that youve told your theme which menu to use.
On the Apperance->Menus screen, click on the Manage Locations
tab, and select which menu you want, and where, according to what
your theme offers.

The Default Profile Page


You can edit your WordPress pages by going to Pages, clicking on
All Pages, and from the list of your pages shown, hover over any
page and click on Edit.
When you edit a page, just like editing any WordPress page, you can
see the content on that page.
When you edit the new Profile Page that was created above, you will
see just a single shortcode.
[wps-activity-page]

This single shortcode instructs WordPress, and WP Symposium Pro,


to display a default profile page.
It includes all the basic requirements for your profile page:
the users avatar, with ability to change it
the users display name (how their name is shown)
their town/city & country, and a map (if they have entered
one)
any friendship requests
20

the ability to post activity


all the users activity posts, and their friends activity posts
It gets things up and running straight away, with a profile page that
looks something like this:

Because Im logged in as Joanne, I get to see the Change Picture


and Edit Profile links, otherwise I wouldnt.
But straight away, I can edit my profile, change my avatar (user
picture), and start posting activity.
Not bad for one click of a button!
As with all chapters in this book, we will not look at this shortcode,
and all the other shortcodes that are related to the profile page.
For each shortcode, after a discussion around the shortcode, all
the options available for the shortcode are displayed, with more
information on what they all mean.

[wps-activity-page]
This shortcode will display the default profile page, as discussed
above. It gets you going, but can be replaced with other
shortcodes that then give you more control over all the elements of
your profile page.
21

All shortcodes have options, some more and some less. The
following options can be added to the [wps-activity-page] shortcode
as follows.
Lets take the first option, user_avatar_size, which allows you to
change the size of the users avatar on the page (the users picture,
which they can change). Edit the default profile page and replace
whats there with the following:
[wps-activity-page user_avatar_size="200"]

You will see that the avatar has increased in size (from the default of
150) to 200 x 200 pixels. Play around and try other values.
In fact, the best way with all the options shown below, and with all
shortcodes, is to play! As another example, lets change the size
of the Google map, and switch it from a static image to a more
dynamic version:
[wps-activity-page user_avatar_size="200" map_size="200,200"
map_style="dynamic"]

Notice that we can use more than one shortcode option at a time.

22

If you look at the previous screenshot, youll see that the user avatar
and map are bigger (by 50 pixels), and the style of the map is one
that you can zoom in and out of (but includes the other overlays that
perhaps you dont want).
Remember, to the right of the town/city and country, friendship
requests will appear, so be sure to send your user a friendship
request and check the layout is still ok! If you are using a wider
screen layout, then you should be okay.
Dont worry, with the other shortcodes available, you are not limited
to this layout, and can choose what goes where!
So here are the options for [wps-activity-page].

Shortcode Options
user_avatar_size
Default: 150

Sets the size, as a square, of the users


avatar in pixels.

map_size
Default: 150,150

Sets the size of the Google map displayed, in


pixels (width followed by height).
The location is based on the town/city and
country enter by the user on their edit profile
page. If nothing has been entered, the map
will not be displayed (until they do).

map_style
Default: static

Can be set to static or dynamic, offering a


choice as to what Google will return.
static will return an image, with no overlays.
dynamic will be a Google map that can be
zoomed in and other, and include other
overlays that Google maps provides.

map_zoom
Default: 4

If using a dynamic map_style, you can set


the default zoom level, between 0 and 19.
23

town_label
Default: Town/City

Change the label shown for the users town/


city. Can be anything, even office if your
social network is in a company, for example.

country_label
Default: Country

Change the label shown for the users


country. If you are operating in a single
country, can be used in combination with
town_label to make things more applicable.
Lets say you are doing a social network
in the UK, then you could set town_label
to Town/City and country_label to County
instead of Country.

user_id
Default: false

If you set user_id, then you will always see


the profile page for this user. user_id is the
WordPress user ID, which can be found via
the admin dashboard->Users.

mimic_user_id
Default: false

If set to 1 (true), then you will view this profile


page as if you were the user. This is really
only for site administrators to perhaps test
things out.

Hooks and Filters


Hooks and filters allow programmers to extend the functionality
of WP Symposium Pro. If you have no idea what these are, youll
probably want to skip ahead (you don't need to know about them!),
or copy and paste some of the following examples. The first example
assumes you have no knowledge of hooks and filters.
More information on what these are can be found by Googling.
Here are some useful links:
http://codex.wordpress.org/Plugin_API
http://wpcandy.com/teaches/how-to-use-wordpresshooks
http://www.smashingmagazine.com/2011/10/07/definitiveguide-wordpress-hooks
https://www.tipsandtricks-hq.com/wordpress-action-hooksand-filter-hooks-an-introduction-4163
24

For every shortcode discussed in this book, all relevant hooks and
filters and covered, with as many examples as make sense. For this
first section, there is additional help for those that have never used a
hook or filter.

An Introduction To Hooks And Filters


So what are hooks and filters?
A WordPress hook allows you to receive some information, from
something that is going on (when a user registers on your site, for
example) and then do something.
A WordPress filter allows you to receive information, modify it, and
send it back from where it came from. Changing content that will be
displayed on screen, based on a certain circumstance, for example.
So lets take the first filter thats used by [wps-activity-page]. Its to
do with displaying the users display name with the [wps-displayname] shortcode, i.e. the name of the user thats shown on the site.
The filter information below is as follows:
Filter:
Applied:
$a:

wps_display_name
whenever users display name is shown.
output that will be displayed for the display name

So, first things first. We need to add some code that will receive the
display name, do something, and then return it so it can be finally
displayed.
Now, you will need to contact the company that hosts your website,
and ask for FTP details, and how you can connect to your website
using an FTP application. They should help you out, and after
being helped by them, you will be able to connect to your site and
download/upload files.
I would suggest you download the following file:
wp-content/themes/[your-theme]/functions.php

25

The actual path will differ, and your theme will have its own name,
not [your-theme]!
The functions.php file is a file that you can edit, and add code to.
This is where we are going to add code to use the filter.
So, once youve downloaded it, edit it with a suitable application.
There are many, but avoid word processors! Here are a couple of
suggestions, both of which are free:
https://www.editplus.com (Windows)
http://www.sublimetext.com (Mac)
After editing it, with either the examples, or your own code, you can
then re-upload and your website will apply your code.
Keep a copy of your changes, for when you update your theme!
So, we are going to use the wps_display_name filter, and as
mentioned it takes one parameter. So the first thing we must do,
using our editor, is add the following to the top of functions.php.
Because this is PHP code, it must be added after the <?php on the
first line, so start on the second line, adding the following:
add_filter('wps_display_name','my_function',10,1);

Here, you are saying, whenever WP Symposium Pro allows you to,
via the wps_display_name filter, you are going to do something,
using your own function, in this case one called my_function.
The two number on the end represent the priority that your function
will take, 10 being a good default. You can increase the priority by
reducing the number, so 1 would be the highest priority.
The 1 at the end, represents how many parameters is passed from
the filter to your function. Looking at the reference list, the wps_
display_name filter has 1 parameter, which is the display name about
to be displayed.
So our function, which you can put after the previous line of code
would be:
26

function my_function($a) {
// code goes here
return $a; // return $a filtered with the code above
}

The function receives the parameter (ie. the display name), doesnt
do anything (yet!) and then returns it.
If you save your new functions.php file and upload it via FTP back
from where it came, and visit your sites profile page, youll not see
anything new. So lets do something!
Lets say we want to show the display name in a blue box. Not likely,
and probably something you would do with CSS, but its a good
example to work with. Change your function to the following:
function my_function($a) {
$div = '<div style="background-color:#aaf">';
$div .= $a;
$div .= '</div>';
return $div; // return $a in a light blue box
}

Now if you visit your profile page (after uploading your functions.php
file), you will see every display name shown in a blue box - in fact
right across your site!

27

In WordPress terms, whats happening is every display name shown


by WP Symposium Pro is literally being filtered, and your function
(thats filtering the display name) is putting it inside a box (a div)
that is (styled) with a light blue background (#aaf is the hexadecimal
code for a light-ish blue).
And thats what filters do, wherever they are applied, your filter will
be called and the content passed can be changed and/or used by
you. So, without further ado, only if you want to get into coding,
heres the relevant list of filters and hooks for the default profile page
shortcode [wps-activity-page].
wps_display_name
Filter
after display name is shown
$a

the users display name

add_filter('wps_display_name','my_function',10,1);
function my_function($a) {
$div = '<div style="background-color:#aaf">';
$div .= $a;
$div .= '</div>';
return $div; // return $a in a light blue box
}

wps_activity_pre_filter
Filter
before all activity
$a
$b
$c
$d

HTML generated so far, usually nothing important


an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

The following example will add a message above the activity stream.
add_filter('wps_activity_pre_filter','my_function',10,4);
function my_function($a,$b,$c,$d) {
$a .= '<p>Do no post anything racist or sexist</p>';
return $a;
}

wps_activity_items_filter
Filter
after creating array of all activity to show
28

$a



$b
$c
$d

array of activity items:


ID => ID of the activity post
date => date of post
is_stick => whether the post is stuck to top of activity
an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

The following example will add an activity item (with ID of 1602) to


every users activity stream, setting the date/time stamp and also
setting it to sticky.
You could possibly use this to insert advertisements of information
posts to every user. With the receipt of the users ID, you could even
target this additional activity item.
add_filter('wps_activity_items_filter','my_function',10,4);
function my_function($a,$b,$c,$d) {
$r = get_post(1602);
array_push($a, array(
'ID' => 1602,
'date' => '2014-11-07 15:13:00',
'is_sticky' => true
));
return $a;
}

wps_activity_single_item_filter
Same as wps_activity_items_filter, but when viewing a single activity
item. Perhaps from a link sent out in an email alert.
wps_activity_item_settings_filter
Filter
after content of settings box has been set
$a
$b
$c
$d
$e

HTML of settings box generated thus far


an array of the shortcode options
the activity item as an object
ID of the user whose page it is
ID of the user who is logged in

This is actually a very useful way to put some content at the top of
every activity item on the users activity page.
29

This example targets user with ID 5, reminding them that they need
to pay their bill with an annoying message until they do!
add_filter('wps_activity_item_settings_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
if ($d == 5)
$a .= 'This message will be removed when you pay your
bill!';
return $a;
}

wps_activity_item_meta_filter
Filter
after an activity items meta information
$a
$b
$c
$d
$e

HTML generated so far for the activity item


an array of the shortcode options
ID of the item (WordPress post ID)
ID of the user whose page it is
ID of the user who is logged in

The following example will add a fairly unnecessary message after


the meta information, and before the content, of every activity
post!
add_filter('wps_activity_item_meta_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
$a .= '<strong>Activity Post</strong>!';
return $a;
}

wps_activity_item_filter
Filter
at the end of the activity item
$a
$b
$c
$d
$e
$f
$g

30

HTML generated so far for the activity item


an array of the shortcode options
ID of the item (WordPress post ID)
The activity item content
ID of the user whose page it is
ID of the user who is logged in
number of items shown so far (starts at 0)

To add a message at the end of the activity item, prompting to add a


comment:
add_filter('wps_activity_item_filter','my_function',10,7);
function my_function($a,$b,$c,$d,$e,$f,$g) {
$a .= '<em>Add your comment below...</em>';
return $a;
}

wps_activity_comment_meta_filter
Filter
at the start of the activity item, prior to the comment
$a
$b
$c
$d
$e
$f

HTML generated so far for the activity item


an array of the shortcode options
ID of the item the comment is on (WordPress post ID)
ID of the item comment (WordPress comment ID)
ID of the user whose page it is
ID of the user who is logged in

wps_activity_post_comment_filter
Filter
at the end of the activity item, after the comment
$a
$b
$c
$d
$e
$f

HTML generated so far for the activity item


an array of the shortcode options
ID of the item the comment is on (WordPress post ID)
ID of the item comment (WordPress comment ID)
ID of the user whose page it is
ID of the user who is logged in

wps_activity_new_comment_filter
Filter
after the form for a new comment
$a
$b
$c
$d
$e

HTML of the form


an array of the shortcode options
ID of the item the comment is on (WordPress post ID)
ID of the user whose page it is
ID of the user who is logged in

The following will add a message after the comment form.


add_filter('wps_activity_new_comment_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {

31

$a .= '<em>Please don\t be rude</em>';


return $a;

wps_activity_init_hook
Hook
prior to any activity shortcode
Before any WP Symposium Pro shortcode is interpreted, an
initialisation function is called that sets up Javascript and CSS. The
function is called to avoid loading unnecessary Javascript and CSS
where shortcodes are not used.
What it does mean is that you can also hook into the initialisation
routine. For example, if you want to be sure you loaded another
Javascript file whenever activity shortcodes are used, you would do
the following:
add_action('wps_activity_init_hook', 'my_function');
function my_function() {
wp_enqueue_script('my-js, 'path/to/my.js',
array('jquery'));
wp_enqueue_style('my-css', 'path/to/my.css', 'css');
}

Shortcodes
Whilst the [wps-activity-page] is a great way to get started, you will
soon want to start making your own profile page. To do so, you will
replace [wps-activity-page] with a number of individual profile page
related shortcodes, which are described now.
After covering all the relevant shortcodes, we will go on to explain
methods for laying out your profile page, techniques that can be
used to layout any WP Symposium Pro page and a full example.
That discussion will also include the use of widgets, to display (just
as an example, the users avatar down the side of your site).
For now, I would suggest that you simply trying putting the following
shortcodes on a page and playing with the options so you can
understand what is possible, and then move on to laying things out.
32

[wps-display-name]
This shortcode will display the user's display name, as set on the
Edit Profile page.
In its simplest form, simply add the following to a WordPress page:
[wps-display-name]

As with all the shortcodes for WP Symposium Pro, there are options
you can use to tailor the output. The options will range in the
complexity, and for this shortcode they are faily simple.

Shortcode Options
user_id
Default: false

Set this to the ID of a WordPress user and


their display name will always be shown.

link
Default: true

If set to true, i.e. link="1", the display name


will also be a link to that users profile page.

before/after
Default: false

Prepend and append HTML to the output.

To use the shortcode options, include them in your shortcode as in


the following example:
[wps-display-name link="1"]

The above will show the display name, but it will also be a link to the
profile page. If being used on a profile page, you are unlikely to set
link to be "1", but there may be other situations when it is required.
The options can be combined too, for example, the following will
show the display name for user 99, and as a link to their profile page:
[wps-display-name user_id="99" link="1"]

At the end of this chapter, a complete custom profile page is created


that you can use as inspiration for your own
33

[wps-avatar]
WordPress will tend to use avatars for your users from its
www.gravatar.com service. You can always change that via the
admin dashboard->Settings->Discussion.
However, in a social network, users will expect to be able to upload
a picture to use as their own avatar. How they do that is through the
use of the [wps-avatar-change] shortcode. This shortcode is used to
display their avatar.

Shortcode Options
size
Default: 256

Sets the size, as a square, of the users


avatar in pixels.

change_link
Default: false

Whether a link is shown over the top of the


users gravatar to let them change it. See
[wps-avatar-change] for more information.

profile_link
Default: true

If set to true, the avatar, if not the current


user, will be a link to that users profile page.

user_id
Default: false

If set to a WordPress users ID, will force the


avatar to show that users avatar.

before/after
Default: false

Prepend and append HTML to the output.

So, for example, to show the current users avatar, you would add
the following to a WordPress page:
[wps-avatar size="128"]

A more advanced example, setting the size, and using before and
after with HTML to float the avatar to the right of the screen:
[wps-avatar size="128" before="<div style='float:right'>"
after="</div>"]

34

Which would show something like this:

Instead of using before and after, you can enter HTML straight into
the text editor, this is a recommended approach if you are more
familiar with coding.
Dont forget to always use the Text view of the editor.
So, to repeat the above, using HTML directly, you would enter the
following into the text editor:
<div style="float:right">[wps-avatar size="128"]</div>

As you will see later, when we create a custom profile page, the
above technique tends to be used, as it is a more familiar way for
those that already code.
With clever use, you can create an amazing profile page for your
social network that will be completely unique!

[wps-avatar-link]
This simple shortcode will display a link to your change avatar page.
You will more than likely have your change avatar page on your
menu, and/or use the link provided with [wps-avatar-link].
However, you may want to provide a link elsewhere, which can be
achieved with this shortcode.

35

Shortcode Options
text
Default: string

The text for the link, defaults to Change


Picture.

before/after
Default: false

Prepend and append HTML to the output.

So, for example, to show the link but change the text, you would use
the following:
[wps-avatar-link text="Change your avatar picture..."]

[wps-activity-post]
This shortcode will dislay an area that a member can post something
on to their activity, sometimes referred to as status, but can be
anything they want.
Their are extensions available to enhance the basic operation, refer
to the Extensions Plugin chapters for more information.
However, in its basic form, it provides a text box area that members
can type into, and add to their activity:

36

After clicking on Add Post, the page refreshes, and the activity will
appear.
All friends of this user will also see the activity post on their profile
page.

Shortcode Options
class
Default: false

An optional class that can be passed that is


added to the Add Post button for styling.

label
Default: string

The label that appears on the Add Post


button.

private_msg
Default: string

The text that is shown if a member is viewing


another members profile page, but is not a
friend, and therefore cannot post.

account_closed_
msg
Default: string

The message shown if viewing a profile page


of a member that has closed their account,
or had their account closed by the site
admin.

user_id
Default: false

Can be set to force this profile page to show


a specific users profile page. Set to the
WordPress user ID.
Whilst this would not be used for the normal
profile page, this could be used to link to a
page of a specific user.

before/after
Default: false

Prepend and append HTML to the output.

Using some of the above as an example, you could add a class and
change the button label as follows:
[wps-activity-post class="my_class" label="Add Status"]

37

Hooks and Filters


There are two filters available for [wps-activity-post].
wps_activity_post_pre_form_filter
Filter
before the text area for a new activity post
wps_activity_post_post_form_filter
Filter
after the text area for a new activity post
$a
$b
$c
$d

HTML generated so far for the activity item


an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

The following example will add a message above the new activity
post box:
add_filter('wps_activity_post_pre_form_filter','my_
function',10,4);
function my_function($a,$b,$c,$d) {
$a .= '<strong>Nothing rude please!</strong>';
return $a;
}

[wps-activity]
This powerful shortcode displays all the activity of a member (their
activity stream), and any other activity posts of other members that
they have permission to view.
In addition to showing the activity post, members can then also
comment on the post.
When an activity post has a comment added to it, it will move to the
top of the activity stream (as most recently active).
The user, or site administrator, can delete a post and its associated
comments by hovering over the settings icon (wrench) and choosing
Delete. A member can also hide another members post.
38

Users can also choose to make a post stick to the top of their
activity stream, perhaps because its particularly important. This is
also available by hovering over the wrench settings icon.
A typical activity stream will look like this:

Emoticons will automatically be converted into graphical


representations if set on via the admin dashboard, Settings->Writing.
There are quite a lot of options for this shortcode! The best thing
to do is play around with them, see how they change the activity
stream, and choose the parameters that you like best for your site.

Shortcode Options
avatar_size
Default: 64

The size of avatars shown beside an activity


post.

comment_avatar_
size
Default: 40

The size of avatars shown beside an activity


post comment.

count
Default: 100

The maximum number of activity posts


shown, which can be set as a balance
between completeness and performance.

39

get_max
Default: 100

The maximum number of posts returned


from the database, allowing that some may
not be shown due to permissions.

more
Default: 50

The maximum number of words shown


from a post on the activity stream, to avoid
lengthy posts taking over the stream.
If a post is longer than this, it is cut off with
... and the more_label afterwards.

more_label
Default: string

The text shown in conjunction with the more


option.

hide_until_loaded
Default: false

If set to true will load all the activity before


displaying it on screen. Whilst this can offer
a more complete initial view, avoiding slowloading items, it can give a different user
experience.

comment_size
Default: 5

Maximum number of most recent comments


shown below a post, to avoid screen
overload.

comment_size_
text_singular

Text shown if there is 1 previous comment


which can be viewed, or more than 1 (the
plural version0.

comment_size_
text_plural
Default: string
label
Default: string

The label on the button to add a comment.

class
Default: string

An optional class for the button to add a


comment.

40

link
Default: true

Whether to link to the users profile page. set


to 0 to disable.

delete_label
Default: string

Text for delete in settings icon.

sticky_label
Default: string

Text for sticky in settings icon.

unsticky_label
Default: string

Text to un-stick a post in settings icon.

sticky_others
Default: false

Set to 1 (true) to make sticky posts stick


to top of all activity streams, otherwise
only sticky on author's profile page activity
stream.

hide_label
Default: string

Text to hide another members post (not all


posts of that member, just that post).

allow_replies
Default: true

Set to 0 to disable comments on activity


posts.

date_format
Default: %s ago

%s is replaced by how old the post is in


minutes, hours, etc. Quick way to translate
text.

include_self
Default: true

Whether to include only posts from current


user.

include_friends
Default: true

Whether to include posts from friends.

post_id
Default: false

Can be used to view a single post and its


comments. Normally only used in links from
alerts sent out.
41

user_id
Default: false

If set the activity will be for the user, using


the WordPress user ID.

mimic_user_id
Default: false

If set will view the activity as though you


were that user, really on used for admin
purposes.

private_msg
Default: string

The text shown if the activity is private and


cannot be seen.

not_found
Default: string

The text shown if the activity post cannot be


found. Probably occurs if a post is made, an
email alert is sent out, and then the post is
deleted. But recipients of the email may click
on it to view it.

before/after
Default: false

Prepend and append HTML to the output.

The following example will display the activity stream, changing the
size of the post avatar and comment avatar.
[wps-activity avatar_size="128" comment_avatar_size="64"]

Hooks and Filters


The following are applicable within the [wps-activity] shortcode.
wps_activity_pre_filter
Filter
before the activity stream
$a
$b
$c
$d

HTML generated so far for the activity item


an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

The following example will add a message above the new activity
post box:
42

add_filter('wps_activity_pre_filter','my_function',10,4);
function my_function($a,$b,$c,$d) {
$a .= '<strong>This is your activity stream</strong>'t;
return $a;
}

wps_activity_items_filter
Filter
after creating array of activity posts, can be used to

add further items to the array
$a



$b
$c
$d

array of activity items


ID => ID of the activity post
date => date of post
is_stick => whether the post is stuck to top of activity
an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

The following example will retreive activity post ID 1, and add it to


the activity stream, setting it as sticky:
add_filter('wps_activity_items_filter','my_function',10,4);
function my_function($a,$b,$c,$d) {
$the_post = get_post(1);
array_push($a, array(
'ID' => $the_post->ID,
'date' => $the_post->post_date,
'is_sticky' => 1));
return $a;
}

wps_activity_single_item_filter
Filter
after creating an array, of one row, when viewing a

single activity post.
$a
$b
$c
$d

array of the activity item


an array of the shortcode options
ID of the user whose page it is
ID of the user who is logged in

It is unlikely that this will be used, but, as an example, if the activity


post has an ID of 1, it will be changed to post 2.
add_filter('wps_activity_items_filter','my_function',10,4);
function my_function($a,$b,$c,$d) {
if ($a['ID'] == 1):

43

$the_post = get_post(2);
$a['ID'] = $the_post->ID;
$a['date'] = $the_post->post_date;
$a['sticky'] = 0;
endif;
return $a;

wps_activity_item_setting_filter
Filter
before end of settings DIV on activity
$a
$b
$c
$d
$e

settings HTML thus far


array of the shortcode options
an object of the activity item
ID of the user whose page it is
ID of the user who is logged in

This filter would allow you to add additional items to the settings box
that appears when the settings icon (wrench) is hovered over.
add_filter('wps_activity_item_setting_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
$a .= ' HERE';
return $a;
}

wps_activity_item_settings_filter
Filter
after end of settings DIV on activity
$a
$b
$c
$d
$e

settings HTML
array of the shortcode options
an object of the activity item
ID of the user whose page it is
ID of the user who is logged in

This filter will add content after the settings DIV and will appear
outside of the DIV. By default content will therefore appear above the
name of the activity post author.
add_filter('wps_activity_item_settings_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
return $a . 'HERE';
}

44

wps_activity_item_meta_filter
Filter
after an activity items meta information
$a
$b
$c
$d
$e

HTML generated so far for the activity item


an array of the shortcode options
ID of the item (WordPress post ID)
ID of the user whose page it is
ID of the user who is logged in

The following example will add a fairly unnecessary message after


the meta information, and before the content, of every activity
post!
add_filter('wps_activity_item_meta_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
$a .= '<strong>Activity Post</strong>!';
return $a
}

wps_activity_item_filter
Filter
at the end of the activity item
$a
$b
$c
$d
$e
$f
$g

HTML generated so far for the activity item


an array of the shortcode options
ID of the item (WordPress post ID)
The activity item content
ID of the user whose page it is
ID of the user who is logged in
number of items shown so far (starts at 0)

To add a message at the end of the activity item, prompting to add a


comment:
add_filter('wps_activity_item_filter','my_function',10,7);
function my_function($a,$b,$c,$d,$e,$f,$g) {
$a .= '<em>Add your comment below...</em>';
return $a;
}

wps_activity_comment_meta_filter
Filter
at the start of the activity item, prior to the comment
$a

HTML generated so far for the activity item


45

$b
$c
$d
$e
$f

an array of the shortcode options


ID of the item the comment is on (WordPress post ID)
ID of the item comment (WordPress comment ID)
ID of the user whose page it is
ID of the user who is logged in

wps_activity_post_comment_filter
Filter
at the end of the activity item, after the comment
$a
$b
$c
$d
$e
$f

HTML generated so far for the activity item


an array of the shortcode options
ID of the item the comment is on (WordPress post ID)
ID of the item comment (WordPress comment ID)
ID of the user whose page it is
ID of the user who is logged in

wps_activity_new_comment_filter
Filter
after the form for a new comment
$a
$b
$c
$d
$e

HTML of the form


an array of the shortcode options
ID of the item the comment is on (WordPress post ID)
ID of the user whose page it is
ID of the user who is logged in

The following will add a message after the comment form.


add_filter('wps_activity_new_comment_filter','my_
function',10,5);
function my_function($a,$b,$c,$d,$e) {
$a .= '<em>Please don\'t be rude</em>';
return $a;
}

wps_activity_init_hook
Hook
prior to any activity shortcode
Before any WP Symposium Pro shortcode is interpreted, an
initialisation function is called that sets up Javascript and CSS. The
function is called to avoid loading unnecessary Javascript and CSS
where shortcodes are not used.
46

What it does mean is that you can also hook into the initialisation
routine. For example, if you want to be sure you loaded another
Javascript file whenever activity shortcodes are used, you would do
the following:
add_action('wps_activity_init_hook', 'my_function');
function my_function() {
wp_enqueue_script('my-js', 'path/to/my.js',
array('jquery'));
wp_enqueue_style('my-css', 'path/to/my.css', 'css');
}

Administration
Once the WP Symposium Pro plugin is activated, a new menu item
is available in the WordPress admin dashboard, called WPS Pro. As
features are added, with the WP Symposium Pro Extensions plugin,
further sub menu items will appear.
In addition, global settings can be found on the WPS Pro->Setup
page.
So, for the profile page global settings, go to WPS Pro->Setup and
scroll down the page to where the black bars are shown. One of
them will have Profile Page as its title.
To display the options available, click on the black bar and it will
extend downwards. This is the same for all the various settings.
The set of drop down lists is where you would tell WP Symposium
Pro which WordPress pages you are using for the profile page, edit
profile page and change avatar page.
The first drop-down, Profile Page, is relevant to the profile page and
the shortcodes covered in this chapter. The Edit Profile Page dropdown list refers to those shortcodes in the Edit Profile chapter, and
the same for the Change Avatar Page.
If you used the quick start Add Profile Pages button (at the top of
the same screen) then these will be automatically set for you.
47

If you manually created the WordPress pages, you should set the
pages as applicable.
Profile Parameter is used to hide usernames from profile page links
on your site, possibly due to security considerations on your site.
Finally, there are some instructions on how to manually create
the pages, which will change depending on how far you have
progressed.
These instructions are an overview of the content within this book.
You can make changes in all of the settings sections, and save them
all. But dont forget to save them! Click on the Save Changes
button at the bottom of the screen to update with your changes.
48

Change Avatar Page


This page is used by the user to upload, optionally crop, and save
a picture to represent themselves on your site. This is referred to as
their avatar.

Quick Start
If you followed the quick start for the Profile Page, this page will
automatically be created for you, with the default shortcode added
to it, and the page set up in WPS Pro->Settings->Profile Page.
However, as with all WP Symposium Pro shortcodes, there are
options that allow you to tailor how the shortcode works, to help
match your site.
Note that, covered in the Profile Page chapter, the [wps-avatar-link]
shortcode will show a link to the members change avatar page.
49

Shortcodes
[wps-avatar-change]
Via WPS Pro->Setup->Profile Page you should, and hopefully have,
set the page that you are using to allow users to upload, and crop,
an avatar. Cropping is always skipped on mobile devices.
This shortcode should be used on that page, which prompts the
user to upload an image, and then allows them to (optionally) crop
the image.

Shortcode Options
choose
Default: string

The prompt shown to users to upload an


image, defaults to Click here to choose an
image....

try_again_msg
Default: string

The try again text, defaults to Try again....

file_types_msg
Default: string

The message informing the users what files


they can upload. Defaults to Please upload
an image file (.jpeg, .gif, .png)..

not_permitted
Default: string

The message shown if the user does not


have permission to change that particular
users avatar. Defaults to You are not
allowed to change this avatar..

label
Default: string

The word(s) on the upload button. Defaults to


Upload.

50

crop
Default: true

You would normally allow users to crop


the image they upload, that is, select an
area of the image. However, there are some
circumstances that you would want to skip
this step. Set to false to skip.

The avatar upload process is in three steps.


1. The user uploads an image
2. The user can select an area of the image (crop)
3. The user saves the selected area.
Note that the cropping step is skipped if using a mobile device.
To preserve the overall style of WP Symposium Pro, the selected
area must be a square, with the preview shown whilst the area is
selected.
The avatar upload process is a three steps.
1. The user uploads an image
2. The user can select an area of the image (crop)
3. The user saves the selected area.
To preserve the overall style of WP
Symposium Pro, the selected area
must be a square, with the preview
shown whilst the area is selected.
As an example, the avatar being
used here, is selected from a larger
image, with the preview shown
beside the Crop button:

51

52

Edit Profile Page


Every member can edit their profile, via their Edit Profile page.
As features are activited, primarily with the WP Symposium Pro
Extensions plugin, extra choices will be available.
If you add custom profile extensions, things like gender perhaps, or
interests (or whatever you want!), they will also appear on this page.

Quick Start
If you followed the quick start for the Profile Page, this page will
automatically be created for you, with the default shortcode added
to it, and the page set up in WPS Pro->Settings->Profile Page.
Like all WP Symposium Pro shortcodes, there are options that allow
you to modify how the shortcode works.

53

Shortcodes
[wps-usermeta-change]
Via WPS Pro->Setup->Profile Page you should, and hopefully have,
set the page that you are using to allow users to edit their profile.
This shortcode should be used on that page, which allows the user
to edit information on their profile.

Shortcode Options
class
Default: ''

An optional class that is applied to the


submit button.

label
Default: string

The label that shows on the submit button.

town
Default: string

The label shown above the town/city field.


Set to "" to hide.

country
Default: string

The label shown above the country field. Set


to "" to hide.

display_name
Default: string

The label shown above the field for the users


display name, the name shown across the
social network.

password
Default: string

The label shown above the field that allows


the user to change their password.

password2
Default: string

The label shown above the field that requires


the user to re-enter their password, to ensure
they have entered what they think they have.

54

password_msg
Default: string

The text shown after the user has changed


their password.

email
Default: string

The label shown above the email field.

user_id
Default: false

By default, the profile being edited will be for


the currently logged in user. You can override this by setting this with a WordPress
user ID.

meta_class
Default: string

Around every label (eg. display_name) is a


DIV with this class applied to it. Defaults to
wps_usermeta_change_label.

Town and Country shortcode options


The town and country options are integral to WP Symposium Pro,
and when the profile is saved, they are geo-coded for generating a
map for your user.
You can change this accordingly, perhaps town="City" and
country="State", or town="Office" and country="Town".
If it's not relevant to your social network (perhaps all in the same
club), then you can hide town and country by setting each to "", but
this will mean that the profile map cannot be used.

Hooks and Filters


The following are applicable within the [wps-user-meta] shortcode.
wps_usermeta_change_filter
Filter
after all the default edit profile fields
$a
$b
$c

HTML generated so far for the form


an array of the shortcode options
ID of the user whose page it is
55

The following example will add an additional form field that the user
can fill in on the Edit Profile page.
add_filter('wps_usermeta_change_filter','my_function',10,3);
function my_function($a,$b,$c) {
$value = get_user_meta( $c, 'my_field', true );
$a .= '<div class="wps_usermeta_change_item">';
$a .= '<div class="wps_usermeta_change_label">My Field</
div>';
$a .= '<input type="text" name="my_field"
value="'.$value.'" />';
$a .= '</div>';
return $a;
}

wps_usermeta_change_hook
Hook
used to save the edit profile form
$a
$b
$c
$c

ID of the user whose page it is


an array of the shortcode options
the $_POST of the form
the $_FILES of the form

Having displayed your field with the wps_usermeta_change_filter,


you can save the value of the field with the following hook. In this
example, and as used to the right, the saved
value is stored as a usermeta value. If nothing is
entered into the field, the value is deleted.
add_action('wps_usermeta_change_hook','my_
save_function', 10,4);
function my_save_function($a,$b,$c,$d) {
if ($my_field = $c['my_field']):
update_user_meta($a, 'my_field', $my_field);
else:
delete_user_meta($a, 'my_field');
endif;
}

The value can be displayed on your website, such as on the user's


profile page, with the [wps-usermeta] shortcode.

[wps-usermeta]
56

With this shortcode, you can display any "user meta" field that has
been entered. You will need to use it with the shortcode options.

Shortcode Options
user_id
Default: false

Set to a WordPress user ID to over-ride the


currently logged in user.

label
Default: ''

An optional label shown before the value.


The label is enclosed within a SPAN with a
class of wps_usermeta_label.

before/after
Default: false

Prepend and append HTML to the output.

meta
Default: wpspro_
home

This is the key shortcode option, it sets


which meta value is displayed and is
explained below in more detail with values
that you can use.

wpspro_home
Displays the town/city of the user.
wpspro_country
Displays the country of the user.
wpspro_map
Displays a google map, based on the town/city and country
values entered. The map is only shown if both fields have
been entered by the user. There are then further map
specific shortcode options:
size
map_style
zoom

Width and height of the map.


static or dynamic (Google style).
The level of zoom that Google will use.

57

So, for example, to display a Google map, assuming the user


has entered a town/city and country, you could use the following
shortcode:
[wps-usermeta meta="wpspro_map" size="400,400"
style="dynamic" zoom="6"]

This shortcode also supports the custom profile fields that you add
with the Profile Extensions plugin, part of the WP Symposium Pro
Extensions plugin.
It can also be used with the wps_usermeta_change_filter and wps_
usermeta_change_hook, if you have custom coded an additional
profile field.
The use of Profile Extensions is covered in a later chapter, but using
the filter/hook example shown previously, you could show your
saved value with the following shortcode:
[wps-usermeta meta="my_field"]

[wps-usermeta-change-link]
Displays a link to the edit profile page. If added to the profile page
will only be shown if the user logged in, is viewing their own profile
page.

Shortcode Options
text
Default: string

The text of the link.

user_id
Default: false

Set to a WordPress user ID to over-ride the


currently logged in user.

before/after
Default: false

Prepend and append HTML to the output.

58

[wps-usermeta-button]
If you want to display buttons on your profile page that go to a URL,
passing the user's ID as part of the querystring, then this is the
shortcode to use.

Shortcode Options
user_id
Default: false

Set to a WordPress user ID to over-ride the


currently logged in user.

url
Default: ''

The URL that the user will go to when


clicking on the button. user_id=x is
automatically appended to the end.

value
Default: string

The label on the button

class
Default: ''

An optional class that is applied to the


button.

before/after
Default: false

Prepend and append HTML to the output.

For example, let's say you want to have a button that linked to a
page on your site that displayed that user's photo galleries (using the
Gallery extension from the WP Symposium Pro Extensions plugin).
On www.wpsymposium.pro, the URL your would want is:
http://www.wpsymposiumpro.com/gallery/?user_id=3

where 3 is replaced by the user's ID. So the shortcode would be:


[wps-usermeta-button url="/gallery" value="Gallery"]

You can use relative or absolute URLs.

59

[wps-close-account]
It's important to say that deleting users from your site is not a good
idea when so much data on a social network is related to users. It
can cause broken links, etc.
This shortcode will allow users to close an account - it anonymises
their account, removes their avatar, display name, email address
(etc) and de-activates all email alerts, but will ensure that links from
data that they've created (forum posts, etc) are not broken.
Once a user has closed an account, they cannot reopen it. However
site administrators can do as discussed in the administration section
below.

Shortcode Options
are_you_sure_text
Default: string

The "are you sure?" text.

logout_text
Default: string

The "Your account has been closed." text.

label
Default: string

The label on the button

class
Default: ''

An optional class that is applied to the


button.

url
Default: '/'

A URL that the user is taken after closing


their account, by default the root of the site.

before/after
Default: false

Prepend and append HTML to the output.

60

Hooks and Filters


wps_usermeta_init
Hook
prior to any edit profile shortcode
Before any WP Symposium Pro shortcode is interpreted, an
initialisation function is called that sets up Javascript and CSS. The
function is called to avoid loading unnecessary Javascript and CSS
where shortcodes are not used.
What it does mean is that you can also hook into the initialisation
routine. For example, if you want to be sure you loaded another
Javascript file whenever edit profile shortcodes are used, you would
do the following:
add_action('wps_usermeta_init', 'my_function');
function my_function() {
wp_enqueue_script('my-js', 'path/to/my.js',
array('jquery'));
wp_enqueue_style('my-css', 'path/to/my.css', 'css');
}

Administration
Note that after closing, the account is anonymised, any user meta
information (such as profile extensions) and their avatar is removed.
This cannot be undone.
A closed account can be re-opened, but it does not restore the
associated information for the user, as closing account must remove
this to adhere to applicable Data Protection Acts.
Site administrators can close a user's account by editing the user via
the admin dashboard (Users->Edit User).
Towards the edit of the user profile is a checkbox that, if ticked, will
close the user's account.
Also via the same Edit User screen, as a site administrator, you can
update the town/city and country fields.

61

You can also replace their avatar (perhaps their chosen one wasn't
suitable!).

62

Friends Page
A social network is all about making friends!

Quick Start
If you set up your site following the quick start process for the Profile
page, you will already have one.
If not, create a new WordPress page, add the shortcode [wpsfriends] and add it to your menu.
There are a number of shortcodes available to display friends, and
allow your users to make friends.
It's important to make your site as easy as possible for user's to
make friends, and so you should read through all the available
shortcodes and their options. Generally, clicking on a user's link will
go to their profile page where they should be able to make friends.
63

Shortcodes
[wps-friends]
This is the basic shortcode that displays a user's set of friends on
the site. From the list, the can choose to "unfriend" or visit that
user's own profile page.

Shortcode Options
user_id
Default: false

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

count
Default: 10

How many friends are shown. They are


shown in the order of when the last logged
in.

size
Default: 64

Size of the member's avatar.

link
Default: true

Whether the user's display name is a link to


their profile page. Set to "0" to disable.

show_last_active
Default: true

Whether to show when the user was last


active, set to "0" to hide.

last_active_text
Default: string

Text for when they were last active.

last_active_format
Default: "%s ago"

Format of when they were last active.

private
Default: string

Text if this information is private.

64

none
Default: string

The text if this user has no friends.

layout
Default: 'list'

How the friends are displayed, can be 'list' or


'fluid' which is more like a grid.

before/after
Default: false

Prepend and append HTML to the output.

To display the list of friends for a user, you would put the following
shortcode on a WordPress page, setting the maximum number to
100:
[wps-friends count="100"]

To show as a a fluid grid, you would use:


[wps-friends layout="grid"]

[wps-friends-pending]
Displays the pending friendship requests, from which the user can
choose to Accept or Reject. Putting this shortcode above [wpsfriends] is a good place.

Shortcode Options
user_id
Default: false

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

count
Default: 10

How many friends are shown. They are


shown in the order of when the last logged
in.

size
Default: 64

Size of the member's avatar.

65

link
Default: true

Whether the user's display name is a link to


their profile page. Set to "0" to disable.

class
Default: ''

Optional class for buttons.

accept_request_
label
Default: string

Text for the "Accept" button.

reject_request_label Text for the "Reject" button.


Default: string
none
Default: ''

Text shown if no pending requests, whilst ''


no text is shown.

before/after
Default: false

Prepend and append HTML to the output.

To display up to 25 pending friendship requests:


[wps-friends-pending count="25"]

[wps-friends-status]
Displays the friendship status between the currently logged in user,
and the user who is being viewed. Good idea to add this to the
profile page.

Shortcode Options
user_id
Default: false

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

friends_yes
Default: string

Text if friends.

66

friends_pending
Default: string

Text if friendship is pending.

friend_request
Default: string

Text if the currently logged in user has a


pending friendship request from this user.

friends_no
Default: string

Text if not friends.

before/after
Default: false

Prepend and append HTML to the output.

So, to display the status of the "friendship" between the currently


logged in user, and the user whose profile page is being viewed, you
simply add the following to the profile page:
[wps-friends-status]

[wps-friends-add-button]
For the currently logged in user, and the user who is being viewed
(their profile page), this shortcode will display a button making it
quick and easy to request to be friends, cancel, etc.

Shortcode Options
user_id
Default: false

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

label
Default: string

Label for the button to make friends.

cancel_label
Default: string

Label to cancel the friendship.

67

cancel_request_
label
Default: string

Label to cancel a friendship request.

class
Default: ''

Optional class for the button.

before/after
Default: false

Prepend and append HTML to the output.

To display a friendship button, which will change according to the


two user's friendship status, add the following to a profile page:
[wps-friends-add-button]

Hooks and Filters


wps_friends_init
Hook
prior to any friends shortcode
Refer to the wps_activity_init_hook, the purpose is the same.

Administration
Via WPS Pro->Setup->Friendships you can set it that all members of
the site are automatically friends with every other member.
If set, they can't remove friendships. It is an option that is ideal for
a social network where you know that all members are likely to be
friends in real life and avoids the "making friends" process.

68

Alerts
Through WP Symposium Pro alerts, users can be notified of all sorts
of things, whether friendship requests or new posts on their activity.
As you add more features with the WP Symposium Pro Extensions
plugin, they will receive alerts for all sorts of things, from forum
subscriptions to Private Message alerts.
Most of the work of the alerts is behind the scene, however there is
one shortcode that can also be used to good affect in themes, all of
which is covered below.
Users can choose whether or not to receive email alerts regarding
activity posts via their Edit Profile page.

Quick Start
To make a page showing all a user's alerts, create a WordPress page
and put the [wps-alerts-activity style="list"] shortcode on it. Then
69

add that page to your WordPress menu.

Shortcodes
[wps-alerts-activity]
Displays all the alerts that have been sent to the user, whether or not
they have chosen to receive alerts via email.
By default this is shown as a drop down list. Remember, all WP
Symposium Pro shortcodes can be used in a Text/HTML widget,
which is ideal in this case.

Shortcode Options
style
Default: dropdown

How the alerts are shown. dropdown is as


a drop-down list, list will show individually
(good on a WordPress page) and flag will
show as an icon, with the number of unread
alerts showing as a number on top.
The following are related to the flag style:

70

flag_size
Default: 24

Size of the icon.

flag_unread_size
Default: 10

Size of the unread


bubble.

flag_unread_top
Default: 6

Top offset for the


bubble in pixels.

flag_unread_left
Default: 8

Left offset for the


bubble in pixels.

flag_unread_radius
Default: 8

Radius of the corners


of the unread bubble.

flag_url
Default: ''

The URL that the user


goes to when clicking,
probably a page with
[wps-alerts-activity
style="list"] shortcode
on it.

Mandatory

flag_src
Default: ''

Optional URL of an
image to replace the
default icon.

recent_alerts_text
Default: string

Text for "Recent alerts..."

no_activity_text
Default: string

Text for "No activity alerts"

select_activity_text
Default: string

A combination of strings to represent


1, multiple or no new alerts. Default is "
You have 1 new alert,You have %d new
alerts,You have no new alerts". Note, they
are comma seperated, so each of the three
strings cannot themselves contain a comma.

make_all_read_text
Default: string

Text for "Mark all as read"

delete_all_text
Default: string

Text for "Delete all"

date_format
Default: "%s ago"

Format of the age of the alert.

before/after
Default: false

Prepend and append HTML to the output.

71

To show the alerts as a drop-down list, in either a WordPress page or


a Text/HTML widget, you would use the default shortcode:
[wps-alerts-activity]

To show the alerts as a list, you would use the style option:
[wps-alerts-activity style="list"]

To show as a flag, with a highlight number of unread alerts (if


applicable), you would use the style option set as flag.
Note, that with the style of flag, you can tweek the look and feel of
the "bubble" (the number of unread alerts with the flag_unread_top,
flag_unread_left and flag_unread_radius.
You must set the flag_url, which will be where the user goes when
they click on the icon. This will probably be a WordPress page with
the first example above on it.
[wps-alerts-activity style="flag" flag_url="/alerts"]

You can also use your own icon by setting the flag_src option, eg:
[wps-alerts-activity style="flag"
flag_src="/path/to/icon.png"]

Adding alerts to your theme


You can run the same function from your theme (as you can with any
shortcode) which allows you, should you want, to integrate the alerts
into your theme. Depending on your theme this might be as a dropdown list and/or an icon alert for unread activity alerts.
For example, this is from the www.wpsymposiumpro.com website:
<?php
echo wps_alerts_activity(array('style'=>'flag','flag_url'=>'/
alerts'));
echo wps_alerts_activity('');
?>

72

Note that the function name uses underscores and not hypens. So
the shortcode is [wps-alerts-activity] and the PHP function is wps_
alerts_activity.
You pass shortcode options as an array via PHP, the above, laid out
to see, is as follows:
echo wps_alerts_activity(array(
'style'=>'flag',
'flag_url'=>'/alerts'
));

If not passing any parameters, you should still pass an empty string:
echo wps_alerts_activity('');

You can also show an icon alert for pending friendship requests as
follows:
echo wps_alerts_friends(array('flag_url'=>'/friends'));

and if you are using the Private Messaging extension, you can
display an icon alert for unread messages too:
echo wps_alerts_mail(array('flag_url'=>'/mail'));

Administration
You can review all the alerts that are due to be sent out via WPS Pro>Alerts. Against each alerts will be the status of the alerts, whether
it is "pending" (waiting to be sent), when it was sent, or if not sent
successfully, the reason why.
You can clear out your alerts using the links above them.
Alerts are sent out at a schedule and quantity that you set. This
schedule is set via WPS Pro->Setup->Alerts.
Disable Alerts
Switch off alerts completely.

73

Frequency of Email alert notifications


How often alerts are sent out. This will depend on your server, and if
you set too frequently your hosting provider may start to complain!
Emails to send
How many to send in each cycle, should be used in conjunction with
the above.
Summary email
You can optionally receive an email, as the site administrator, with
a summary of each cycle of alerts sent. This is useful if you want to
monitor how many alerts are being sent out.
From name
Who the email is sent from.
From email
The email address that sends out the alerts.
Test WordPress email
Sends out a test email directly using the WordPress wp_mail()
function.
Test WP Symposium Pro alert
Adds an alert, sent to the site administrator, for testing purpose.
If you have installed the WP Symposium Pro Extensions plugin, you
can also customise the alerts here, including whatever you want to
style your alerts to match your website.

74

Forums
WP Symposium Pro supports unlimited forums, and setting them up
couldn't be easier. The WP Symposium Pro Extensions plugin adds
a wealth of additional features that you can refer to in later chapters
of this book.

Quick Start
To add a forum, go to WPS Pro->Setup and click on the "Add
Forum" button. You will see two fields that you can fill in, and then
click the Publish button. For example:

75

This will create the forum, and add a new WordPress page. You will
be prompted to add this to your WordPress menu, which is probably
a good idea so your users can find the forum!

Shortcodes
[wps-forum-page]
If you did the quick start, your new WordPress page will have the
shortcode above. This shortcode will do everything that is needed
to get you up and running. It has some options that you can use to
tailor the output, but the real power is with the following shortcodes.

Shortcode Options
slug
Default: none
Mandatory

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

show
Default: false

Set to 1 (true) to show the form to add a new


topic by default.

header_title
Default: string

By default, set to "Topic".

header_count
Default: string

By default, set to "Replies".

header_last_activity
Default: string

By default, set to "Last activity".

76

base_date
Default: post_date_
gmt

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).

For example, will change the heading strings, changing from Topics
and Replies:
[wps-forum-page header_title="Questions" header_
count="Answers"]

As mentioned, you can use the following shortcodes to take more


control over your forum page.

[wps-forum-post]
This shortcode will show the "add new post" form, allowing user's to
add a topic to your forum.

Shortcode Options
slug
Default: none

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

show
Default: false

Set to 1 (true) to show the form to add a new


topic by default.

class
Default: ''

An optional class added to the submit button


to allow you to further style the button.

title_label
Default: string

By default, set to "Post title".

77

content_label
Default: string

By default, set to "Post".

label
Default: string

By default, set to "Add Topic", as the label


on the submit button.

moderate
Default: false

If set to 1 (true), all posts and comments


must be approved by a site administrator via
the admin dashboard before it is displayed.

moderate_msg
Default: string

By default, set to "Your post will appear once


it has been moderated.".

locked_msg
Default: string

By default, set to "This forum is locked. New


posts and replies are not allowed.".

private_msg
Default: ''

The text saying the the forum is private (the


user doesn't have permission to view).

before/after
Default: false

Prepend and append HTML to the output.

So, for example, you could use the shortcode as follows in it's basic
form, replacing ??? with your forum slug:
[wps-forum-post slug="???"]

Or add options, for example:


[wps-forum-post label="Add new question"]

[wps-forum]
This is the main shortcode for display a forum, and has a lot of
options!
You would probably put this shortcode straight after [wps-forumpost] on your WordPress page.
78

Shortcode Options (when viewing forum topics)


slug
Default: none

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

closed_switch
Default: ''

By default, user's cannot to select to see


closed forum posts. To enable this feature,
set to "on" or "off", which is the default state.
User's can then individually choose whether
to show them or not.

closed_switch_msg
Default: string

Defaults to " Include closed posts".

show_header
Default: true

Set to 0 (false) to hide the headings for the


columns.

show_closed
Default: true

Set to 0 (false) to not show closed forum


posts.

show_count
Default: true

Set to 0 (false) to not show the count


column.

show_freshness
Default: true

Set to 0 (false) to not show how "fresh" the


forum post is.

show_last_activity
Default: true

Set to 0 (false) to not show the last activity


column.

show_comments_
count
Default: true

Set to 0 (false) to not show the count of


replies to a forum post.

79

private_msg
Default: string

Defaults to "You must be logged in to view


this forum.".

login_url
Default: ''

If set, any links to login will be set to this


URL.

secure_msg
Default: string

Defaults to "You do not have permission to


view this forum.".

empty_msg
Default: string

Defaults to "No forum posts.".

pending
Default: string

Defaults to "pending" and has "(" and ")"


added around it.

comment_pending
Default: string

Defaults to "pending" and has "(" and ")"


added around it.

closed_prefix
Default: string

Prefix for closed forum posts, defaults to


"closed".

header_title
Default: string

Defaults to "Topic".

header_count
Default: string

Defaults to "Replies".

header_last_activity
Default: string

Defaults to "Last activity".

moved_to
Default: string

Text displayed when a topic is moved


between forums, defaults to "%s
successfully moved to %s". %s is
substituted with the forum names.

80

date_format
Default: string

Defaults to "%s ago", with %s replaced with


the age of the forum post.

count
Default: -1

Maximum number of forum posts to show, -1


means no limit.

reply_icon
Default: true

Set to 0 (false) to hide the icon indicating that


the user has replied to a forum post.

title_length
Default: 50

Make length of the post title, in characters.

base_date
Default: post_date_
gmt

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).

before/after
Default: false

Prepend and append HTML to the output.

So in its simplest form, you would use the shortcode thus,


substituting ??? with the slug of your forum:
[wps-forum slug="???"]

You can also add options, as with any shortcode:


[wps-forum slug="???" header_title="Questions"]

Alternative forum layouts


By default, the look of the forum topics is functional, but not match
the style of your site. An alternative layout is available, and more
friendly style, that mimicks the original WP Symposium forum.

81

The alternative style can be activated with the following shortcode:


style
Default: 'table'

Set to "classic" to change the style of the


forum to a more friendly layout.

For example:
[wps-forum slug="xxx" style="table"]

You then have some specific additional options you can use to tailor
the forum.

started
Default: string

Defaults to "Started by %s %s" with the %s


replaced by the user and when.

replied
Default: string

Defaults to "Last replied to by %s %s" with


the %s replaced by the user and when.

commented
Default: string

Defaults to "Last commented on by %s %s"


with the %s replaced by the user and when.

82

size_posts
Default: 96

Size of the user's avatar in pixels for posts.

size_replies
Default: 48

Size of the user's avatar in pixels for replies


and comments.

post_preview
Default: 250

Maximum number of characters in the post


preview.

reply_preview
Default: 120

Maximum number of characters in the reply/


comment preview.

view_count_label
Default: 'VIEW'

Label used to show the number of views


(singular).

views_count_label
Default: 'VIEWS'

Label used to show the number of views


(plural).

reply_count_label
Default: 'REPLY'

Label used to show the number of replies


(singular).

replies_count_label
Default: 'REPLIES'

Label used to show the number of replies


(plural).

Note that views starting counting from installation, and exclude post
owner views of the post.

Shortcode Options (when viewing a forum post)


size
Default: 96

Size of the avatar for the initial post and


subsequent replies when viewing a topic.

pagination
Default: true

Set to 0 (false) to switch off pagination for


the forum.
83

pagination_top
Default: true

Set to 0 (false) to switch off pagination pages


at the top of the forum.

pagination_bottom
Default: true

Set to 0 (false) to switch off pagination pages


at the bottom of the forum.

page_size
Default: 10

How many posts should appear on one


page.

page_x_of_y
Default: string

Defaults to "Showing page %d of %d".

post_deleted
Default: string

Defaults to "Post deleted.".

secure_post_msg
Default: string

Defaults to "You do not have permission to


view this post.".

timeout
Default: 120

How many seconds before the forum post is


locked for editing.

show_comments
Default: true

Set to 0 (false) to hide all replies made to


a post. This uses the term comments for
legacy reasons.

show_comment_
form
Default: true

Set to 0 (false) to hide the reply text area


by default. This uses the term comment for
legacy reasons.

allow_comments
Default: true

Set to 0 (false) to remove the ability to


comment on a reply.

comment_add_label Defaults to "Add comment".


Default: string

84

comment_class
Default: ''

Optional class added to the comment submit


button.

comments_avatar_
size
Default: 48

Size of the avatar beside comments.

private_reply_msg
Default: string

Text shown above private replies. See allow_


private option for [wps-forum-comment].
Defaults to "PRIVATE REPLY".

As the options for viewing a single post are shared within the same
shortcode as viewing a forum, you can combine options:
[wps-forum slug="???" page_size="20"]

Hooks and Filters (when viewing forum topics)


wps_forum_post_delete_hook
Hook
after deleting a forum post
$a
$b
$c

$_POST as submitted
$_FILES as submitted
ID of the post that was deleted

Allows you to act upon the deletion of a forum post, for example,
the following will email the site administrator. Deleted posts go into
Trash, in case they need to be recovered.
add_action('wps_forum_post_delete_hook','my_function',10,3);
function my_function($a,$b,$c) {
$the_post = get_post($c);
wp_mail(
get_bloginfo('admin_email'),
'Deleted Post',
$the_post->post_title.' ('.$c.') deleted'
);
}

wps_forum_post_name_filter
Filter
filter for the forum name
85

$a
$b

HTML generated so far


ID of the forum post

As a simple example, this will append the word "FORUM" to the end
of all forum names.
add_filter('wps_forum_post_name_filter','my_function',10,2);
function my_function($a,$b) {
$a .= " FORUM";
return $a;
}

wps_forum_post_item
Filter
filter for the forum row
$a

HTML generated for the row

As a simple example, this will append (a rather annoying) request to


read the blog after every forum topic.
add_filter('wps_forum_post_item','my_function',10,1);
function my_function($a) {
$a .= 'Please read my <a href="/blog">blog</a>';
return $a;
}

Hooks and Filters (when viewing a forum post)


wps_forum_post_post_title_filter
Filter
after the forum post title
$a
$b
$c
$d

HTML generated so far


the WordPress post (of the forum topic)
an array of the shortcode options
The ID of the currently logged in user

For example, the following will simplify to the title of the topic:
add_filter('wps_forum_post_post_title_filter','my_
function',10,4);
function my_function($a,$b,$c,$d) {
$a = '<p style="font-size:4em;">'.$b->post_title.'</p>';
return $a;
}

86

wps_forum_item_content_filter
Filter
after every post content for the topic (post, replies
and comments).
$a
$b

HTML generated
an array of the shortcode options

So to style all displayed content with a grey background, you could:


add_filter('wps_forum_item_content_filter','my_
function',10,2);
function my_function($a,$b) {
$a = '<div style="background-color:#efefef; marginbottom: 0px;">'.$a.'</div>';
return $a;
}

Although you should probably (actually, not probably, just should....)


use CSS.
wps_forum_item_sub_comment_filter
Filter
after every comment on a post reply
$a
$b
$c
$d

HTML generated
an array of the shortcode options
the comment object
the comment content

To style all reply comments with a blue background, you could:


add_filter('wps_forum_item_sub_comment_filter','my_
function',10,4);
function my_function($a,$b,$c,$d) {
$a = '<div style="background-color:#9fefef; padding:
4px;">'.$a.'</div>';
return $a;
}

87

Again, this would normally be done with CSS, but it illustrates how
the filter can be used.
wps_forum_post_comment_filter
Filter
after every reply, including the comments.
$a
$b
$c
$d

HTML generated
the comment object
an array of the shortcode options
the ID of the current logged in WordPress user

To style all reply areas with a light red background, you could:
add_filter('wps_forum_post_comment_filter','my_
function',10,4);
function my_function($a,$b,$c,$d) {
$a = '<div style="margin-top: 6px; backgroundcolor:#ef9f9f; padding: 0 8px 0 8px;">'.$a.'</div>';
return $a;
}

wps_forum_post_comment_filter
Filter
as above, for pending replies.

[wps-forum-comment]
This shortcode displays the fields to reply to a forum post, and
is normally added to a WordPress page below the [wps-forum]
shortcode.

Shortcode Options (when viewing forum topics)


slug
Default: none

88

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

content_label
Default: string

String shown above the text area.

label
Default: string

Label for the submit button.

moderate_msg
Default: string

Defaults to "Your post will appear once it has


been moderated.".

locked_msg
Default: string

Defaults to "This forum is locked. New posts


and replies are not allowed.".

private_msg
Default: ''

Text shown if the forum post is private.

moderate
Default: false

If set to 1 (true) then all new replies to the


forum required administrators to approve
them through the admin dashboard.
Until they are, they appear as pending to the
author and site administrators, but cannot be
seen by anyone else

moderate_msg
Default: string

Defaults to "Your comment will appear once


it has been moderated".

close_msg
Default: string

Defaults to "Tick to close this post".

comments_closed_
msg
Default: true

Defaults to "This post is closed.".

reopen_label
Default: string

Defaults to "Re-open this post".

89

allow_private
Default: true

Set to 0 (false) to not let people post a


private reply. Private replies are only seen by
the author, the original post author and site
administrators.

private_reply_
check_msg
Default: string

Defaults to "t", with %s replaced by the


original post author.

class
Default: ''

Optional class added to the submit button.

show
Default: true

If set to 0 (false), the form is not shown by


default.

before/after
Default: false

Prepend and append HTML to the output.

For example:
[wps-forum-comment slug="???" allow_private="0"]

Hooks and Filters


wps_forum_comment_pre_form_filter
Filter
before the text area.
$a
$b
$c

HTML generated for the form so far


an array of the shortcode options
ID of the current user WordPress user

Allows you insert content above the reply text area.


add_action('wps_forum_comment_pre_form_filter','my_
function',10,3);
function my_function($a,$b,$c) {
$a .= '<p style="float:right">Aligned right</p>';
return $a;
}

90

wps_forum_comment_pre_form_filter
Filter
after the text area.
$a
$b
$c

HTML generated for the form so far


an array of the shortcode options
ID of the current user WordPress user

Allows you insert content above the reply text area.


add_action('wps_forum_comment_post_form_filter','my_
function',10,3);
function my_function($a,$b,$c) {
$a .= '<div style="clear:both">Hello world</div>';
return $a;
}

[wps-forums]
If you have multiple forums set up, this shortcode will provide you
with an overview of all the forums, with a variety of options to tailor
the output. For example, visit www.wpsymposiumpro.com/forums to
see how it is used on the WP Symposium Pro website.

Shortcode Options
slug
Default: none

Optionally, set the slug to a forum (as shown


below via WPS Pro->All Forums) to limit the
output to just one forum.

show_header
Default: true

If set to 0 (false), the forum column headings


are not shown.

show_count
Default: true

Set to 0 (false) to hide the forum posts count.

show_freshness
Default: true

Set to 0 (false) to hide how recent the last


post is.
91

show_last_activity
Default: true

Set to 0 (false) to hide who made the last


activity post.

forum_title
Default: string

Defaults to "Forum".

forum_count
Default: string

Defaults to "Count".

forum_freshness
Default: string

Defaults to "Freshness".

forum_last_activity
Default: string

Defaults to "Last Poster".

base_date
Default: post_date_
gmt

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).

no_indent
Default: true

Set to 0 (false) to indent the forum headings.

level_0_links
Default: true

Set to 0 (false) to remove the hyperlinks from


the forum headings.

before/after
Default: false

Prepend and append HTML to the output.

Relating to the posts displayed from each particular forum.


show_posts_header Set to 1 (true) to show the headings for the
forum posts.
Default: false
show_posts
Default: 0
92

How many posts to show from the forum.

show_summary
Default: 0

Set to 1 (true) to show the count, freshness


and last activity values.

count_include_
replies
Default: true

Set to 0 (false) to exclude replies from the


forum counts.

title_length
Default: 50

Maximum number of characters shown from


the topic post title.

header_title
Default: string

Defaults to "Topic".

header_count
Default: string

Defaults to "Replies".

header_last_activity
Default: string

Defaults to "Last activity".

featured_image_
width
Default: 0

If you have added a featured image to the


forum (WPS Pro->Forum Setup->Edit), this is
the size of the featured image.

A simple way to mimic the WP Symposium Pro website forums page


is to use this shortcode with the following options. You would create
a new WordPress page, use add the following shortcode, and add
the page to your WordPress menu:
[wps-forums show_header="0" show_posts="3" show_summary="0"]

Hooks and Filters


wps_forum_name_filter
Filter
after the forum name.
$a
$b

the forum name.


the forum ID
93

This filter is also used by the forum subscriptions extensions to add


an icon after the name showing you have subscribed for email alerts
of new posts to the forum.
So here is a simple example to add some text after the forum name:
add_action('wps_forum_name_filter','my_function',10,2);
function my_function($a,$b) {
$a .= ' [<a href="/rules">rules</a>]';
return $a;
}

Which would then appear as:

[wps-forum-backto]
A simple shortcode that provides a link back to the main forum
page.

Shortcode Options
slug
Default: none

94

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

label
Default: string

Defaults to " Back to %s..." where %s is


replaced by the forum name.

before/after
Default: false

Prepend and append HTML to the output.

So to use, you would add the following to your forum page. You can
add it more than once if you like, and the top and/or bottom of the
page. ??? would be replaced by your own forum slug.
[wps-forum-backto slug="???"]

[wps-forum-show-posts]
To counter the previous simple shortcode, this final forum shortcode
has lots of options. However, it is powerful and will allow you to
display forum activity elsewhere on your site, whether as part of a
WordPress page, or in a Text/HTML widget.
Although you can tailor it to display other output, it is primarily
designed to show recent forum activity, whether in columns (which
are optionally shown) or as a summary.

Shortcode Options
slug
Default: none

This is optional. If used it must match


the slug as displayed via WPS Pro->All
Forums beneath the name of your forum, for
example:

If not used, all forums will be included.

95

order
Default: date

Which field is used to retrive the posts. Valid


options are date, date_gmt, author, title,
content or name (the post slug).

orderby
Default: DESC

Set to DESC (descending and the default) or


ASC (ascending).

max
Default: 10

Maximum number of posts displayed.

status
Default: ''

Set to open, closed or leave as '' to include


both.

include_posts
Default: true

Set to 0 (false) to exclude posts.

include_replies
Default: true

Set to 0 (false) to exclude replies.

include_comments
Default: false

Set to 1 (true) to include comments on


replies.

include_closed
Default: true

Set to 0 (false) to excude closed forum posts.


A preferred alternative to using status.

closed_prefix
Default: string

Text that is prepended to a forum post topic


if closed, defaults to "closed".

show_author
Default: true

Set to 0 (false) to hide the post author.

author_format
Default: string

Defaults to "By %s" where %s is replaced by


the post author.

96

author_link
Default: true

Set to 0 (false) to remove the link to the post


author's profile page.

show_date
Default: true

Set to 0 (false) to hide the post date.

date_format
Default: string

Defaults to "%s ago".

show_snippet
Default: true

Set to 0 (false) to hide the snippet.

title_length
Default: 50

Maximum number of characters included in


the forum topic title.

snippet_length
Default: 30

Maximum number of characters included in


the snippet.

base_date
Default: post_date_
gmt

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).

before/after
Default: false

Prepend and append HTML to the output.

summary
Default: false

Set to 1 (true) to display the output in a


summary format, where the following options
are then applicable:

summary_format
Default: string

By default is "%s %s %s %s ago %s",


where the %s are replaced in this order,
for example:
[simon] [replied to] [This topic] [5 mins]
ago [the snippet]

summary_started
Default: string

Defaults to "started".
97

summary_replied
Default: string

Defaults to "replied to".

summary_
commented
Default: string

Defaults to "commented on".

summary_title_
length
Default: 150

Maximum number of characters


included in the forum topic title.

summary_
snippet_length
Default: 50

Maximum number of characters


included in the snippet.

summary_avatar_
size
Default: 32

Size of the avatar in pixels.

summary_show_
unread
Default: true

Set to 0 (false) to exclude read forum


posts, if user is logged in.

A popular use of this shortcode is in it's summary format, eg:


[wps-forum-show-posts summary="1"]

which would display the following (in this case in a Text widget):

98

Hooks and Filters


wps_forum_get_post_item
Filter
after each single forum post.
$a

the HTML generated for the forum post

This filter can be used to alter the HTML of each forum post
generated. A simple example will add a <hr> tag after each.
add_action('wps_forum_get_post_item','my_function',10,1);
function my_function($a) {
$a .= '<hr />';
return $a;
}

So the previous image above would now appear thus:

[wps-forum-sharethis]
You can insert "ShareThis" icons, to allow user's to share forum
topics via social media, email, and so on. You will need an account
at http://www.sharethis.com, which is free.
Once you've signed up with ShareThis, click on their "Get Sharing"
99

option, and select "Website" (not WordPress).

Then select one of the buttons styles (only button styles are
supported):

And if you're happy, click on the "Get the Code!" button. Assuming
you've registered, you will see two boxes of code (Span tags and
Script tags). Copy these into the two boxes available via WPS Pro>Forum Setup, hove over a forum and click on Edit.
Scroll down, and copy each of the two blocks of code into the
"ShareThis" section:

100

Note that this is the same code for every forum, you only need to
add this once, to one forum.
You can then add the ShareThis icons to individual forum pages with
the following shortcode.

Shortcode Options
slug
Default: none

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum.

And, with my settings on ShareThis, I can use the following:


[wps-forum-sharethis slug="general-forum"]

Note that the icons will only display on single forum topics.

Menu showing under icons?


You may need to edit your site menu's CSS so that any drop down
menus appear over the icons. For TwentyTwelve theme, for example,
the following should be added to WPS Pro->Custom CSS:
.sub-menu { z-index: 9999999 !important; }

Administration
There are two areas on the WordPress admin dashboard related to
forum administration.
101

The best is WPS Pro->All Forums, on which you can see all your
forums and high level permissions. If you are using the Forum
Security extension (part of WP Symposium Pro Extensions plugin)
then you can also fine tune security here too.
For each forum you can do/see the following:
name
slug
Edit | Page | View
Order
Privacy
Status
Visibility
Autosubscribe

The name of the forum.


Below the name, the slug of the forum.
Edit the forum, go to the WordPress page
for the forum, and view the page via the
frontend.
Order displayed with [wps-forums].
Need to be logged in to view the forum?
Are new posts allowed?
See all posts, or just the user's own posts?
Are new users subscribed automatically?

The second area is WPS Pro->Forum Setup which allows you to


edit the forum in more details. Click on a Forum to edit it.
You can delete the forum here too, but remember to also delete the
associated WordPress page.
This is mostly a duplicate of "All Forums" discussed above.
In addition you can also change the WordPress page and if relevant
choose to always email all members with new topics (note, there is
no opt-out for this, so get permission from your users based on local
laws on sending unsolicited emails and/or make them aware when
registering for the site).
Remember if manually creating forums (as opposed to WPS Pro>Setup, "Add Forum"), your WordPress page should not have a
parent page - it should be at the root (top level) of your website. You
can always use menus to give the impression of parent/child forums.

102

Building Your Own


Profile Page
So now we've covered all the profile page related shortcodes, we
can look at creating a unique layout for your page.
I'm not suggesting that you use this layout, in fact there may be
some critics, but it's used to provide an example of what can be
done with a little imagination, and very little effort!
The first thing we are going to do is create our basic profile page,
and then we will add pending friendships, "make friends" button,
and so on.
This is what we are going to create:

103

The shortcodes we are going to need initially are as follows, so go


ahead, edit your WordPress Profile page, and enter the following.
When testing, be sure to use a user that has completed the town/
city and country fields via Edit Profile, so you can test properly.
[wps-avatar]
[wps-display-name]
[wps-usermeta meta="wpspro_home"]
[wps-usermeta meta="wpspro_country"]
[wps-usermeta meta="wpspro_map"]
[wps-activity-post]
[wps-activity]

104

When working with shortcodes, I would (highly) recommend that you


use the "Text" view of the editor in WordPress. It will help avoid any
typos or odd styling effects!
Go ahead and save your page and take a look. Don't be impressed
yet, it's just a vertical "list" of what you're going to arrange as per
the previous image. But hey, pat yourself on the back, you already
have your own profile page that works just fine!
But what we need to do is layout things out, and this is where it gets
a little technical with HTML and styles, and actually nothing to do
with WP Symposium Pro per sae. If you don't know, or don't want
to know, about such things, you can copy and paste the code below
and play around. You might be surprised just how addictive it can
become - and how powerful!
First things first, let's create the pale blue box. We won't put
anything in it just yet, but it's our place to start.
And if you are experienced using styles (i.e. CSS) before you all
email me, yes, you shouldn't really be mixing styles and HTML,
they should be seperate, and that is covered in the Styling WP
Symposium Pro chapter, with custom CSS. But for the sake of
simplicity, I'm keeping things together for now. Please don't email!
Back to our code, put this at the top of your WordPress page (now
you must use the Text view - it's very important at this stage!).
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
</div>

Did I hear you say Yikes (or worse)! If so, it probably looks like a
jumbled mess, don't panic! If not, you may well be familiar with
HTML and styling. Either way, good for you, at least you're following
things so far!
For those new to the above, let's take a step back and explain
(others who recognise the above can skip on a few paragraphs).
With web pages <something> tells the browser to do something,
105

and is referred to as a tag. It's the "language" of the web browser


and is called HTML (that's HyperText Markup Language so you
can impress people). In this situation we are using a <div>. Now all
good HTML tags open and then close. Start, do something, end.
Google likes well built pages, and it's a good habit to get into for lots
of other reasons too. So we also have a </div>. Note the forward
slash? That's what says "this is a closing tag".
So we have <div>something here</div>.
For the purposes of what we are doing, think of that <div></div> as
a box on the screen (the pale blue box in the previous image).
What about all that other stuff? Well, like WordPress shortcodes,
HTML tags can also have options - or parameters. The parameters
we are adding above are as follows, and what they mean:
margin-bottom
padding
border-radius
background-color
overflow

a margin, or white space, after the div


padding, or white space, insde the div
makes the corner of the div rounder
the, erm, background colour
more techie, makes everything show

Couple of points. First, trust me on the overflow and move on. And
second, note that the spelling is American English, so color must be
spelt like that, and not, as I would tend to do, spell it colour. Yes, I'm
English...
For each of the above we are adding a value, as follows:
margin-bottom
15 pixels (px)
padding
top and right 6px, bottom 0px, left 12px
border-radius
3 pixel (px) radius
background-color
#CCCCFF
overflow auto
So, forget overflow. There are some more immediate things to
explain. Pixels represent all the little dots on your screen. So marginbottom basically says, move everything after this <div> down by 15
pixels.
padding is the internal space around the inside of the box, like a
106

frame, and the four values represent top, right, bottom and left in
that order. Picture a clock hand going round - in that direction.
border-radius will make the corners round, in this case with a radius
of 3 pixels, and subtle corner. Try making it a bigger number and see
what happens!
background-color is set to #CCCCFF. What the??? This is a
hexadecimal code that represents a colour. Not much clearer eh?!
It will be quicker if you take a look at http://www.w3schools.com/
tags/ref_colorpicker.asp and pick colours at random. See how the
"hexadecimal" value changes? If you find one you like, you can
replace #CCCCFF with your own colour.
If there is one thing I want to get across is this ... play!! Mess
around, you can't damage anything and you can always start again.
Seriously, play!
Right, so on your WordPress page you should have the following:
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
</div>

If you refresh your profile page (after saving/updating your


WordPress page!) you should see something like this:

107

It might not seem much, but that thin blue "box" is what you've
added, and now we can add in the rest of the information.
Let's do the avatar next, popping it over to the right of the blue box.
Put the following in between the first long line (that starts with <div
....) and the second line (the </div>).
<div style="float:right">[wps-avatar size="128"]</div>

So you end up with:


<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
<div style="float:right">[wps-avatar size="128"]</div>
</div>

Another div!! Yes, again think of it as a box, and you'll notice two
things.
First, it has a parameter style="float:right" - what that's doing is
saying align (float) this div (this box) to the right.
And then inside the <div></div> you've got a shortcode, it's the
[wps-avatar] shortcode, so remove the other one - you don't need
both. But note that we're setting it to be 128 x 128 pixels.
Save your page, your blue box should now look like this:

108

Hey! Pretty awesome! We're on a roll now, so let get rid of the
existing [wps-display-name] and add the following straight after the
avatar line from above (just before the </div>).
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
<div style="float:right">[wps-avatar size="128"]</div>
<div style="font-size:3em; letter-spacing:-2px;">[wpsdisplay-name]</div>
</div>

Another div (you can see that these are used alot - alot - in laying
out a web page). This time we are using the style parameter to set
the font size. 3em means "3 times bigger that what would normally
be shown here", you could equally say 24px for 24 pixels in size, but
the "em" way is a good way for responsiveness, accessibility and so
on.
We are also moving all the letters together slightly by 2 pixels, just to
make it look a bit cool.
Inside this <div></div> is the [wps-display-name] shortcode,
simple as that. Take a look and then also move the [wps-usermeta]
shortcodes so that you now have:
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#CCCCFF; overflow: auto;">
<div style="float:right">[wps-avatar size="128"]</div>
<div style="font-size:3em; letter-spacing:-2px;">[wpsdisplay-name]</div>
[wps-usermeta meta="wpspro_home" label="<strong>Where am I?</
strong>"][wps-usermeta meta="wpspro_country" label=", "]
</div>

Don't forget to remove the other [wps-usermeta] shortcodes. The


two [wps-usermeta] shortcodes are all on the same line, so that I
don't get a line break half way through.
I'm simple showing the town/city and country using the label
shortcode option to set the label. Remember, they don't show if
there is no value, so if there is no country, the comma won't show.
109

This is really getting somewhere, you should now have something


that looks like this:

So all we have to do is adjust the map as we want it, using the [wpsusermeta] shortcode with the right shortcode options:
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
<div style="float:right">[wps-avatar size="128"]</div>
<div style="font-size:3em; letter-spacing:-2px;">[wpsdisplay-name]</div>
[wps-usermeta meta="wpspro_home" label="<strong>Where am I?</
strong>"][wps-usermeta label=", " meta="wpspro_country"]
</div>
[wps-usermeta meta="wpspro_map" size="1000,150" map_
style="static"]
[wps-activity-post]
[wps-activity]

I added the shortcode above, and


also the two shortcodes for activity
posts and the activity stream, so
the above is our final code for our
initial profile page, and you should
have a profile page that looks like
the image to the right.
The map, by the way, is set to a
maximum of 1000 pixels, but fits
into it's container on the screen.
110

Well done!
Grab yourself a cup of tea, and play around with all the settings
above, seeing if you can come up with something. If you're new to
HTML and styles (CSS) start with the simple stuff, like changing the
colour or the font size and then progress.
We will now add two more shortcodes to display pending friendship
requests, and a button to request to become a friend (or cancel the
friendship).
The shortcodes that we need to use are:
[wps-friends-pending][wps-friends-add-button]

What we're going to do is put them between the blue box and the
map, so go ahead and add them as follows, on the same line:
<div id="my_profile_header" style="margin-bottom:15px;
padding: 6px 6px 0 12px; border-radius: 3px; backgroundcolor:#ccf; overflow: auto;">
<div style="float:right">[wps-avatar size="128"]</div>
<div style="font-size:3em; letter-spacing:-2px;">[wpsdisplay-name]</div>
[wps-usermeta meta="wpspro_home" label="<strong>Where am I?</
strong>"][wps-usermeta label=", " meta="wpspro_country"]
</div>
[wps-friends-add-button][wps-friends-pending]
[wps-usermeta meta="wpspro_map" size="1000,150" map_
style="static"]
[wps-activity-post]
[wps-activity]

The first shortcode, when viewing another members profile page, will
display a "Make friends" button, and won't show on your own profile
page.
The second will show all pending friendship requests (if on your
profile page), and won't show if viewing another member's profile
page.
111

If I log in as a second user (Joe) and visit my first user's profile page
(Joanne), I only see the following because as I'm not friends I'm
limited to what I can see.

So I click on the "Make friends" button, the page refreshes and the
button now says "Cancel friendship request". Which I won't do....
But when I go back as Joanne, I can now see the pending friendship
request from Joe, which I can choose to Accept or Reject:

The pending friendship request will also appear on the Friends page,
if you've set one up on the site.
Finally, if I log back in as Joe, and go to Joanne's profile page, I see
the profile page as we designed with a "Cancel friendship" button.
112

Pretty awesome!
And that's it, congratulations, a custom profile page all of your own
making!

113

114

WP Symposium Pro
Extensions Plugin

115

116

WP Symposium Pro
Extensions Plugin
Whilst the core WP Symposium Pro plugin will always remain free,
and will create a basic social network on your WordPress website,
there is an additional plugin, the WP Symposium Pro Extensions
plugin, that adds a wealth of extra features and functions.

Getting the Extensions Plugin


This can be purchased via http://www.wpsymposiumpro.com/shop.
Once you have purchased a licence, you can download a ZIP file of
this plugin from your account page at http://www.wpsymposiumpro.
com/my-account.
117

To install this ZIP file, via your admin dashboard, go to Plugins


and then Add New. This time. click on Upload Plugin instead of
searching. You can then select the ZIP file that you downloaded,
install it and activate like before.
After activing the Extensions plugin, you can then select which of the
extra features you want to add to your website.

Activating the Individual


Extensions
If you now go to WPS Pro->Setup, there is a new section called
Extensions. If you click on the black bar you will be presented
with all the currently available extensions. As WP Symposium Pro
updates are released, in addition to extra options to the existing
extensions, any new extensions will be added here.
To activate one of the extensions, tick the box beside it and save at
the bottom of the page.
Depending on the extension, you may have additional menu items
under the WPS Pro menu, and an additional section on the setup
page.
Because of the way the WordPress admin dashboard works, after
activating an individual extension, you may need to refresh your
webpage to see the extra admin section.
The following chapters take each extension in turn, and as
applicable, quick start, discuss the shortcodes, hooks and filters,
administration section and any other relevant topics for discuss.

118

3. Core
Extensions

Custom Email Alerts


The default alerts can be customised with a "header" and "footer".

Administration
After activating, you can go the WPS Pro->Setup->Alerts and you
will see two additional fields that allow you to enter HTML to change
the way the alert looks.
As this HTML is added before (the header) and after (the footer) you
can affectively wrap the content with you own content and styles.
Because the alert is sent as an email, and styling must be contained
within the HTML itself. The following is an example as currently
used on the WP Symposium Pro website. It makes the background
purple, and puts the content into a box with rounded corners.
HTML added to top of alert
119

<style>
body { padding: 0; margin: 0; }
</style>
<div style="padding:20px; background-color:#510051">
<div style="border:1px solid #000; background-color:#efefef;
border-radius:5px;padding:20px;">

HTML added to bottom of alert


<div style="text-align:center;margintop:25px;width:100%;font-style:italic;">You can choose
what emails you receive on your <a href="http://www.
wpsymposiumpro.com/edit-profile/">Edit Profile</a> page</div>
</div>
</div>

The result of the above is to make the email alert look as follows:

120

Login and Redirect


This extension provide three main features:
1. A login form to replace the WordPress login screen
2. A registration form to replace the WordPress registration screen
3. Redirects users away from the WordPress admin dashboard

[wps_login_form]
By default, with no options, if the user is not logged in, this
shortcode will show a login form and button for registration, and
forgotten password. If logged in, a log out button will be shown.
Along with a lot of options for this shortcode, these can be disabled
so that you can have a seperate login and registration page.
As with other shortcodes, WP Symposium Pro will use the theme
styles so it matches your site, for example, this is what the form
looks like with the TwentyTwelve theme:
121

The registration form can also tie into WP Symposium Pro, asking
new users to complete additional profile fields (covered in the Profile
Extensions chapter), but by default, the registration form will look
like this:
The fields shown can be changed,
and even removed.
They can also be set as mandatory
(required) or otherwise.
For example, you could change
Town/City and Country, remove
them or make them mandatory.
It is recommended, if you are using
the Google map feature on the
profile page, that you include the
Town/City and Country, renaming if
necessary, so that the information
for the map is always available.
This will give your site's profile
pages a consistent look and feel.
The "CAPTCHA" image is used
to avoid false registrations, which
WordPress sites can suffer from,
but you can remove it if you want
to.
122

Login Form
The following options relate to the login form.
url
Default: string

A URL that the user is redirected to after


logging in. It defaults to the home page of
your site. You can also pass this via the
querystring, for example:
/login?url=/go_here_next

label_login
Default: string

The login label, defaults to "Log In".

label_username
Default: string

Text for "Username".

label_register
Default: string

Label for the "Register" button.

label_lostpassword
Default: string

Label for the "Forgotten password?" button.

register
Default: 1

Set to "0" to hide the registration button.

lost_password
Default: 1

Set to "0" to hide the forgotten password


button.

captcha
Default: 1

Set to "0" to hide the CAPTCHA code.

text_password_
closed
Default: string

Text for " This account was closed".

123

before/after
Default: false

Prepend and append HTML to the output.

To add a login form to a WordPress page, setting the URL that the
user goes to after logging in to /profile, you would add the following:
[wps-login-form url="/profile"]

Or, to disable the registration button (you might have this on your
menu or elsewhere) and the CAPTCHA code:
[wps-login-form register="0" captcha="0"]

Registration Form
The following options relate to the registration form.
mode
Default: login

Set to 'register' to show the registration


form, useful if you have seperate login and
registration pages.

registration_url
Default: ''

A URL that the user is redirected to after


registering. It defaults to the current page
with a message to the user.

label_username
Default: string

Text for "Username".

label_email
Default: string

Text for "Email address".

label_password
Default: string

Text for "Password".

label_password_
confirm
Default: string

Text for "Re-enter password".

124

town
Default: Town/City

Prefix with a "*" to make mandatory, for


example: town="*City"

country
Default: Country

Prefix with a "*" to make mandatory, for


example: town="*Country"

password
Default: false

Set to "1" to allow user's to enter their own


password.

label_name
Default: false

Text for "Your first name and family name".

name
Default: true

Set to "0" to hide the first name and family


name fields.

display_name
Default: false

Set to "1" to allow user's to set their display


name on registration. Can always be
changed via the Edit Profile page.

nickname
Default: false

Set to "1" to allow user's to set their


WordPress nickname. This field is not used
by WP Symposium Pro.

mandatory
Default: string

The text shown after mandatory fields.


Defaults to <span style='color:red;'> *</
span>.

text_register_
prompt
Default: string

The text for " A password will be sent to the


email address you enter."

label_back_to_login
Default: false

Text for the link that goes back to the login


form.

text_register_
prompt
Default: string

Text for "A password will be sent to the email


address you enter."

125

before/after
Default: false

Prepend and append HTML to the output.

As an example, the following will display the registration form by


default, the Town/City and Country fields mandatory, and change the
mandatory text to a blue "required":
[wps-login-form mode="register" town="*Town/City"
country="*Country" mandatory="<span style='color:blue;'>
required</span>"]

I would not recommend allowing users to set their own password,


unless your site is in a secure environment, otherwise you are
opening up your site to automated (spam) registrations.

Forgotten Password? Form


The following options relate to the form when a user has forgotten
their password. They can enter their username or email address, and
a new password will be generated, and sent to their email address.
By default, the form will look like this:

label_lostpassword_ The label on the forgotten password form.


send
Default: string

126

text_lostpassword_
prompt
Default: string

The text shown above the forgotten


password form ("Enter your username or
email address..."). Can include HTML.

text_username_not_ The text for "Username or email address


(%s) not found.", where %s is replaced by
found
what the user entered.
Default: string
text_password_
reset
Default: string

The text for "Your password has been reset


and sent to the email address..."

text_register_
prompt
Default: string

The text for "A password will be sent to the


email address you enter."

text_new_password
Default: string

The text for "Your new password is: %s"


which is sent via email. %s is replaced with
the new password.

Using the [wps-login-form] shortcode, you can change the "Send


new password" button label as follows:
[wps-login-form label_lostpassword_send="Send me a new
password"]

You can combine these shortcode options, with the login and
registration options, for example:
[wps-login-form register="0" captcha="0" label_lostpassword_
send="Send me a new password"]

Redirecting users from the admin


dashboard
On most websites, it's unlikely that you will want to allow your
users to access the WordPress admin dashboard. Although there
127

is nothing they can do, as they will probably be in the "subscriber"


role, it's a potential security risk and (probably more applicable)
something you just don't want to expose your users to.
Via WPS Pro->Setup->Login and Register, you can set the
WordPress roles that are allowed to access the admin dashboard.
Administrators will always have access.

Once you have ticked, and saved your choice, any users not in those
ticked roles will be redirected to your site's home page if they try to
access the WordPress admin dashboard.

Setting a registration code


To support events (for example) you may give users a code they
have to enter on registration.
You can set this up via WPS Pro->Setup->Login & Register. There is
also a shortcode option to support this.
registration_code
Default: string

128

Defaults to "Registration code".

System Messages
After activating this extension, you have the ability to automatically
add an activity post to every new member's activity stream.
Go to WPS Pro->Set up->System messages, select the user you
want to send the activity post from and enter your message. After
saving a preview is displayed.

129

130

Menu Alerts
If you are using the Private Messages extension, you can display the
number of unread messages in your WordPress menu.
You can also add an icon alert for unread messages to your site,
which is covered in the Alerts chapter earlier on.
The number of unread messages is shown in brackets on your menu
by going to Appearance->Menus, and expanding the menu item to
which you want to add the unread messages count:

131

You then simply put %m into the Navigation Label field, and save
your menu. %m will then be replaced with (2) where would be
replaced with the number of unread messages. If there are no
unread messages, it is not shown.

132

4. Activity
Extensions

Choosing Activity
Recipient(s)
User's will want to target certain individuals sometimes, perhaps
when an activity post is only relevant to family members, friends or
work colleagues, and so on.
This extension adds a drop-down list above the activity post that
gives the user the choice of selecting who to share their activity post
with:

133

After choosing "Select friends...", a box appears above their activity


post area into which they can type and select one or more friends to
share the activity with:

When the post appears on the activity, it will also show who the
activity post is shared with:

In this example, only Joe and Joanne will see this activity post.

134

Activity share lists


This extension requires the previous extension, Choosing Activity
Recipient(s), to be activated.
Once activated, an additional option is provided in the drop-down
list, via which user's can create lists of users which they can then
quickly choose when adding an activity post.

Any lists that they create, will then also appear on the drop-down list
for use. Activity posts that are shared wth a list will appear as such
on the activity stream.

135

When selecting "Manage lists...", the user can create a new list, or
edit/delete and existing list.
When creating a list, it's simply a matter of giving the list a name and
selecting the friends to put into that list.

And as an example, the list above if used, would appear on the


activity stream like this:

Whilst the link "My best friends" doesn't actually link anywhere, you
can hover over the link and the members of that list will appear on
screen.

136

Activity attachments
A key part of sharing posts with other users includes sharing photos,
video and audio. WP Symposium Pro supports the attachment of
images, the inclusion of YouTube URLs and SoundCloud audio. You
can select which you want to permit via WPS Pro->Setup:

Images
If you permit image attachments, after activation, above the initial
post area and below any comment areas, there is a new item of
text "Attach an image". A user simply clicks on this to select one, or
more, images to attach to their post. If their browser is old, they may
137

only be able to attach one image at a time.


The images attached are shown as "thumbnails", and if clicked on
will "zoom" to show the full image. Clicking on the image again, or
pressing Escape, will hide the full image.
An image can be deleted by the post author, or the site
administrator, by clicking on the trash can icon.

YouTube videos
To show a YouTube video below your post simply copy and paste
the YouTube URL when viewing the video on YouTube into your post
and it will be detected, and the video displayed below the post.
The video is responsive, that is, will re-size when viewed on mobile
devices, tablets, etc.
138

Active via WPS Pro->Setup underneath "Activity".

SoundCloud
In the same was as with YouTube videos, simply visit the
SoundCloud page and copy the URL.
When included in your activity post it will be detected and displayed
using what SoundCloud refers to as the web widget.
Active via WPS Pro->Setup underneath "Activity".

Website link previews


You can choose whether any links to websites are automatically
shown below the activity post, with (optionally) an image from the
page linked to, the page title and the page description.

Title and description are based on the <title> tag and the <meta>
"description" field. If no description field exists, the URL of the page
is shown instead.
Activate via WPS Pro->Setup underneath "Activity", then use the
shortcode options.

Shortcode options
You add the following options to the [wps-activity] shortcode.
139

dynamic_previews
Default: false

By default, once a preview has been fetched,


it is cached to avoid slow profile page
loading time.
Although not recommended, you can force
every URL to be dynamically fetched by
setting to 1 (true) but it will significantly
impact on page load time. Consider a very
low value for max_previews if dynamic_
previews=1.
Please read about max_previews too...

max_previews
Default: 10

Sets how many web link previews are shown,


which can be higher if dynamic_previews
is false (as they are all cached after the first
time the image and information is retrieved).
If you have dynamic_previews set
to 1 (true), your server has to fetch the
information and the image every time, for
every link. This will add load to your server
and significantly increase the time it takes
for the activity to load. Therefore, set max_
previews to a low number (probably 1) if
dynamic_previews is set to 1 (true).
Therefore, setting dynamic_previews to 1
(true) is not recommended!

ignore_images
Default:
adserver,ads,affiliate

A list of comma seperated words that, if in


the URL of the image, will cause the image
to be ignored, for example the following
will cause any image with the words
adserver,logo or example to be ignored:
"adserver,logo,example"

ignore_links
Default: ''

140

A list of comma seperated words that, if


in the URL of the link, will cause the link
to be ignored. For example, any link with
google,microsoft or example will be ignored:
"google,microsoft,example"

url_preview_image
Default: 100

Size of the preview image, set to 0 to


disable, which will improve performance (as
not searched for/fetched from the URL).

url_preview_fail
Default: true

Set to 0 (false) to not show the preview if the


remove site cannot be connected to.

fail_text
Default: string

The text shown as the description if the site


cannot be connected to. Can be set to "" to
not show a message.

fail_image
Default: string

The URL of an image to use, if no image can


be retrieved from the site (no image or due to
ignore_images list).

min_width
Default: 200

Minimum width of image to show, set to 0 to


show first image on page. As each image is
processed, for better performance set to 0.

max_width
Default: 1000

Maximum width of image to show, or 0


to ignore. Can be used to avoid sending
large images to the browser for better
performance.

How website link previews work


The way that web link previews works is by retrieving the source of
the linked web page and scanning for the page title and description.
Based on the page source, your server then scans and processes
the images one at a time to determine if it is to be shown, based on
max_previews, ignore_images, min_width and max_width, stopping
when a suitable one is found.
The more images that have to be scanned and processed, the
slower the browser will load the profile page, as it is waiting for your
server to finish analysing the page and images.
With dynamic_previews set to 0 (false) this is a once-off operation
when the activity post is loaded, by any user. They are then cached,
so they image and information is only loaded once.
141

If multiple links are included in the activity post, only the last link is
converted into a preview if caching is on (ie. dynamic_previews set
to false).

Removing the image/preview


The activity post owner or site administrator can remove the image
(if considered not suitable) by clicking on the trash can that appears
top of the image. The entire preview can be removed by clicking on
the trash can top-right of the preview box.

Dynamic Previews?
If you set dynamic_previews to 1 (true) this extension does add a
load on to your server, and the more images you show, or conditions
you add, page load time will be increased.
The chances of the image and meta information changing during
the time the activity post remains relevant is slim, and so it is not
recommended to set dynamic_previews to 1 (true).
If you choose to have dynamic previews, you can improve
performance in two ways. The first is to improve your server's
power and internet connection speed! The second is by setting the
shortcode paramters as follows:
max_previews
min_width
ignore_images

142

1 (only show first preview link)


0 (always show first image on page)
'' (so nothing to process or images to skip)

Likes and Dislikes


Let your users like and dislike each other's activity posts. It's a great
way to give user's feedback on what they are posting, and bring
them back to your site, keeping them engaged.
You can also use them for other things, with a little imagination. Post
an activity as an idea (perhaps for party?!) asking others to like and
dislike, to gauge interest levels.
Likes and Dislikes are activated via WPS Pro->Setup, and by
default users can like and dislikes activity posts of friends. See the
administration section below for options and how to change this,
including de-activiating (for example) dislikes.
Here's how they then appear on the activity feed:

143

Shortcode options
There are several options you can use to customise how likes
and dislikes appear, perhaps changing "Like" to "Awesome" and
"Dislike" to "Yuk"?!
Remember, choosing if likes/dislikes are used, and what can be
liked/disliked is set via WPS Pro->Setup->Likes and Dislikes.
These options are added to the [wps-activity] shortcode.
allow_unlikes
Default: true

Set to 0 (false) to remove the ability to


remove likes.

allow_undislikes
Default: true

Set to 0 (false) to remove the ability to


remove dislikes.

like_text
Default: string

Defaults to "Like".

unlike_text
Default: string

Defaults to "Unlike".

like_count_text_
singular
Default: string

Defaults to "%d like" with %d replaced with


1.

like_count_text_
plural
Default: string

Defaults to "%d likes" with %d replaced with


the number if 2 or more.

dislike_text
Default: string

Defaults to "Dislike".

144

undislike_text
Default: string

Defaults to "Undislike".

dislike_count_text_
singular
Default: string

Defaults to "%d distlike" with %d replaced


with 1.

dislike_count_text_
plural
Default: string

Defaults to "%d dislikes" with %d replaced


with the number if 2 or more.

more_text_singular
Default: string

Defaults to "and %d more..." with %d


replaced with 1.

more_text_plural
Default: string

Defaults to "and %d more..." with %d


replaced with 2 or more.

done_text
Default: string

Defaults to "Done!" (shown after clicking on


Like or Dislike).

by_text
Default: string

Defaults to " by ".

or_text
Default: string

Defaults to " or ".

you_text
Default: string

Defaults to "you".

max_names_to_
show
Default: 3

Maximum number of individual display


names to show that have liked or disliked.
You can hover over to see the complete list.

145

These options can be combined to change the branding (words)


used for your likes and dislikes, for example:
[wps-activity like_text="Awesome" unlike_text="Remove"]

Like/dislike alerts
An alert is generated when a user likes or dislikes a post from
another member, so they are informed via email.
To avoid cluttering up the activity stream, a like/dislike activity post
is not added as on busy sites this can overload the activity stream.

Rewards for Likes/Dislikes

By activating likes and dislikes, if you are using rewards, new


options are added to the reward type for likes and dislikes.

Administration
After activating there is a new "Likes and Dislikes" section available
via WPS Pro->Setup.
From here you can de-activate likes or dislikes, and set who can like/
dislike posts from other members (friends or all members).

146

Favorite Activity
If user's have a lot of activity posts on their activity stream, a useful
feature is to be able to bookmark them as favorites.
By activating this extension, a star image will appear beside each
post, initially not filled in.

Users can then click on this star to save it as a "favourite".

147

Shortcodes
There is only one shortcode as follows.

[wps-favourites]
Displays any activity posts that have been bookmarked as a
favourite.
go_to
Default: string

Defaults to "View...".

no_favorites_text
Default: string

Defaults to "You have no favorites, click the


star beside activity posts to add them.".

link
Default: true

Set to 0 (false) to remove the link to the


user's profile page.

avatar_size
Default: 32

Size of the user's avatar in pixels as a


square.

date_format
Default: string

Defaults to "%s ago" with %s replaced by


the age of the post.

before/after
Default: false

Prepend and append HTML to the output.

Hook and Filters


The following filters are also used when displaying favorites:
wps_activity_item_recipients_filter
wps_activity_item_meta_filter
wps_activity_item_filter
148

Activity to Facebook
It can really enhance your social network if you let users share
their activity posts to their Facebook accounts. Not only does this
give the user's something extra, it also publicizes your website on
Facebook with a link (where the post was shared from).
To set up Facebook connectivity, you need to first create an
application on Facebook. Login to Facebook as normal, and then go
to https://developers.facebook.com/apps. Once there...





click on the "Add a new App" button


from the four icons that appear, click on the website icon
click on "Skip and Create App ID"
enter a display name, e.g. "WP Symposium Pro"
choose a Category and click "Create App ID"
Make a note of the Application ID and Application Secret

You can always go back to see your application details via https://
developers.facebook.com/apps.
149

You must enter a contact email address, do so via "Settings".


Having done so, you now need to tell your Facebook
Application about your website. While still on Settings, click
on the "Add Platform" button and choose "Website".
You should enter your website URL in the "Site URL" and
"Mobile Site URL" fields, eg. www.wpsymposiumpro.com.

Last step. By default, your application is in development


mode. To switch it to live, click on "Status and Review" and
click on the button that says "No" to "Yes".

When everything is all set up, and running well, you may want to
return to "Status and Review" and click on "Start a Submission" to
get Facebook approval for your application.
150

Your Facebook Application is now available for use.


Now, on your website, go to WPS Pro->Setup and activate the
extension (under Activity). After saving, and possibly refreshing
your page, a new section below will be available called "Activity to
Facebook".
In that section, you should enter the App ID and App Secret, and
save:

Once you've completed all the above, on the activity page, below
the area where new activity posts are added, your users will see a
"Connect to Facebook" link.

To share activity posts with Facebook, they need to "connect" which


they do so by clicking on the link. If not logged into Facebook, they
will have to do so first. After which, they should give permission for
your website (and Facebook Application) to access their account.
If they don't do this, they can't share with Facebook. Only basic
connectivity is used, nothing malicious or unnecessary is used (only
what is required to post to their Facebook activity).
On returning to your site, the "Connect to Facebook" will have
changed:
151

They will see their Facebook account name, and the option to
disconnect.
If they were logged into the wrong Facebook account when they
connected, they can disconnect, logout of Facebook and re-connect
with the proper account.
However, you are now done. Your users can choose to share activity
posts with Facebook (by default), or un-check the checkbox to avoid
sharing.
Shared activity posts on Facebook will include the name of your
Facebook Application, hence it's worth choosing an appropriate
name, probably to match your website, as it's also a link to your
website.
In the example below, the name of the application "My Site" is
highlighted in the red box.

Note that replies to the activity post on your WP Symposium Pro


website, and replies on Facebook are not syncronized, as this would
cause issues around privacy and Facebook user's not being aware
of where their replies are stored. They can be considered seperate
activity "threads".
152

5. Members
Extensions

Profile Extensions
Also referred to as custom profile extensions, or user meta
fields, profile extensions is a powerful way to allow users to add
information about themselves that is pertinent to your site.
For example, on a dating site, you might add:




Gender
Marital Status
What am I looking for?
About me
and so on.

Or perhaps, on a gaming site, you might add:





Platform (PC, XBOX, PlayStation, etc)


Preferred genre (MMO, first person shooter, etc)
Do I play multi-player?
and so on.
153

It is only limited by your imagination. And furthermore, not only can


you display this information on profile pages, you can add them as
an advanced search on your member directory, and include them on
your registration screen (mandatory or optional).
After creating a profile extension, the user can set/change that
extension on their Edit Profile page.

Creating Profile Extensions


After activating them via WPS Pro->Setup, a new menu item will be
available, WPS Pro->Profile Extensions.
To create a profile extension, you would go through the following
steps.

154

1. Enter title here


This is the name of the profile extension, for example "Gender".
2. The Editor
A description of the field, which is shown on the user's Edit Profile
page, for example, "Please select your gender."
3. Type (in Extension Details box)
You can choose from a variety of types, and depending which you
choose, options may appear below:
text

A simple text field.

textarea

A larger text field, for use with, for example, a


field called "More information about me".

list

A set of options that can be selected from


a drop-down list. Useful if you want to force
the user to choose from a set of values that
you define. You can set the values in the box
that appears "Values", seperating each value
with a comma. The first value is the default
value displayed. For example:

URL

Allows the user to enter a URL, for example,


their Facebook page URL, or website. To
force the link displayed to open a new
browser tab/window, tick the "open in new
window" checkbox.
You can also set the Featured Image
(probably by scrolling down the screen)
which will be displayed instead of the URL.
For example, if you are asking users to enter
their Facebook page URL, you could choose
to display a Facebook icon.
155

date

Presents the user with a date picker.

image

An image that can be uploaded by the user,


and optionally whether they can add a URL
that makes the image into a hyperlink. Can
choose if a new window opens when clicked
on.

You can also set this image to be displayed


as a profile header image, with the user's
avatar and display name over the top, which
is really nice. When uploaded, it will look
something like this (you can change the look
and feel with CSS).

YouTube

156

A YouTube URL (that would be copied


from the browser's web address field when
viewing a YouTube video). You can also set
the size by enter a width and height. To make
the videos responsive, the recommended
values are:

Divider

This is not actually a field, but is displayed


on the user's Edit Profile page. By setting the
order of your profile extensions correctly, you
can use this to add headings to your profile
extensions.
This extension acts slightly differently in
that you don't actually enter a title, but use
the editor to set what is displayed, and
can therefore use any of the features of the
editor.

4. Order
Set the order in which the Profile Extension appears on the user's
Edit Profile page and if used, the registration page (so long as
using the WP Symposium Pro Login & Register extension for user
registrations).
5. Admin Only
If checked, only site administrators see this field on the user's Edit
Profile page. Perhaps useful for recoding hidden information.
6. Always Show?
If checked, whether or not a visitor to a profile page has permission
to see their extended details, this field will be shown.
7. Include in Directory Search?
This is only displayed if you have the member directory extension
activated. If you check this option, this profile extension will be
available under "Advanced Search". See the member directory
chapter for more information.
8. Include on [wps-login-form]?
If checked, and using the [wps-login-form] shortcode of the Login &
Register WP Symposium Pro extension, this profile extension will be
included in the registration form.
9. Mandatory on [wps-login-form]?
Linked with [8] above, this makes the field on the registration form
mandatory (must be filled in).
157

Finally, publish (save) or update if editing, and your profile extension


will be created.
It will appear on the user's Edit Profile page, and depending on how
you set it up, on the registration page and the advanced search of
the member directory.
You can now also add your profile extension to a user's profile page.

Showing a Profile Extension


To add a profile extension to the profile page, or any WordPress
page or Text/HTML widget, you use a shortcode as follows.

[wps-extended]
Displays a profile extension.

Shortcode Options
slug
Default: none

This is mandatory, and must match the


slug as displayed via WPS Pro->Profile
Extensions.

user_id
Default: false

Set to the ID of a WordPress user to display


the profile extension for that user.

show_if_empty
Default: true

Set to 0 (false) to hide if no value has been


entered.

empty_text
Default: ''

Text shown if the field is empty, and the type


of field is applicable.

label_prefix
Default: false

Set to 1 (true) to add the title of the profile


extension before the value.

158

age
Default: false

For date extensions only, display the date


in years since today. "%s years old" would
showw something like "45 years old",
where %s is replaced by the user's age, for
example:

before/after
Default: false

Prepend and append HTML to the output.

So let's assume you have a gender profile extension with a slug of


"gender", as a list, with the values "Not telling,Male,Female" from
which the user can select via their Edit Profile page. To display this
on their profile page with the title as a label you would use:
[wps-extended slug="gender" label_prefix="1"]

And if included in the "Building Your Own Profile Page" chapter:

159

160

Profile Security
Members of a social network take security very seriously. This
extension allows user's to set different levels of security for their
account.
Once activated, on their Edit Profile page is an additional set of
choices:

161

Areas of security
Profile Information
This refers to the information about the user, their name, profile
extensions, location and so on.
Activity
Who can see the activity stream and posts of the user.
Friendships
Who are the friends of this user.
Directory
The level of visibility in the member directory if used.

Levels of security
Just me
Can only be seen by the user themselves, and site administrators.
Friends
Only friends made via WP Symposium Pro, and site administrators.
All Members
All registered members of the site.
Public
Everybody, including visitors to the site who have not logged in.

162

Member Directory
The directory is a very easy way for members to find other members
on the site. In its basic form it's a list of members, with a search
form, but through the shortcodes there are additional features
available.

Quick Start
The easiest way to add your directory is to use the "Add Directory
Page" button on WPS Pro->Setup which adds a new WordPress
page, with the following shortcodes, that you can then add to your
site's menu:
[wps-directory-search]
[wps-directory]

163

Shortcodes
[wps-directory]
Displays a directory of the site members.

Shortcode Options
order
Default: last_active

The order in which the members are


displayed, can be last_active, user_
registered or any field from the WordPress
users table.

order_by
Default: DESC

Can be ASC (ascending) or DESC


(descending).

no_results_msg
Default: string

Defaults to "No users found.".

number
Default: 50

Maximum number of members displayed.

limit
Default: false

Optionally set to a value to limit the number


of members returned to process (prior to
checking security).

avatar_size
Default: 64

The size of the member's avatar in pixelst.

link
Default: true

Set to 0 (false) to remove the link to the


user's profile page.

show_location
Default: true

Set to 0 (false) to hide the user's location (as


entered via their Edit Profile page).

164

show_date
Default: true

Set to 0 (false) to hide when the user was last


active.

date_label
Default: string

Defaults to "Last active".

last_active_format
Default: string

Defaults to "%s ago" where %s is replaced


by when they were last active.

show_by_default
Default: true

Whether to directory appears prior to


receiving a search term. Set to 0 (false) to
only show after a search term is entered via
the [wps-directory-search] shortcode.

show_friendship_
status
Default: true

Set to 0 (false) to hide the friendship status


between the member of the directory and the
currently logged in user.

friends_yes
Default: string

Defaults to "You are friends".

friends_pending
Default: string

Defaults to "You have requested to be


friends".

friend_request
Default: string

Defaults to "You have a friends request".

friends_no
Default: string

Defaults to "You are not friends".

show_registered
Default: true

Set to 0 (false) to hide when the user


registered with the site.

registered_label
Default: string

Defaults to "Joined".

165

layout
Default: list

To display the directory in a more grid-like


fashion, set to fluid.

include_friendship_
action
Default: true

Set to 0 (false) to hide the button to make a


friendship request, cancel, etc.

friendship_class
Default: ''

An optional class added to the friendship


action buttons.

friend_add_label
Default: string

Defaults to "Make friends".

friend_cancel_label
Default: string

Defaults to "Cancel friendship".

accept_request_
label
Default: string

Defaults to "Accept friendship request".

reject_request_label Defaults to "Reject".


Default: string
include_self
Default: false

Set to 1 (true) to include the currently logged


in user in the member directory.

before/after
Default: false

Prepend and append HTML to the output.

So with the above options, you can tailor how the directory looks
and works on your site. For example, to display the directory,
including the currently logged in user and doubling the default avatar
size, you would use the folllowing options:
[wps-directory avatar_size="128" include_self="1"]

166

[wps-directory-search]
Displays the directory search box, with a number of options dictating
how it is presented and operates. Search is performed on the user's
login name and their display name.

Shortcode Options
class
Default: ''

An optional class added to the search submit


button.

url
Default: ''

A URL that the search term is sent to, leave


along if search form is on same page as the
directory.

mode
Default: text

Can be text or list. Text provides a field into


which users can type, where as list is a
dropdown list that filters as the user types. If
your site has lots of users, then text mode is
recommended.
If using list, you may want to change the
placeholder value to something like "Click
and start typing...".

show_user_login
Default: false

Set to 1 (true) to show the user's login name


beside their display name.

placeholder
Default: string

Defaults to "Enter part of a name...".

quick_select
Default: false

Only applicable if mode is set to "list". Set


to 1 (true) and after selecting a user, the
browser will be redirected to their profile
page straight away.

search_label
Default: string

Defaults to "Member search".

167

label
Default: string

Label for the button, defaults to "Search".

show_with_results
Default: true

Set to 0 (false) to hide after displaying the


results.

private
Default: false

Set to 0 (false) to only show if the user has


logged in to the site.

private_msg
Default: string

Defaults to "You need to login first.".

include_meta_show
Default: false

Set to 1 (true) to show the advanced search


(profile extensions) without the search field
for the name.

roles
Default: false (all)

A comma seperated list of WordPress roles


to include in this instance of the directory, eg.
"administrator,subscriber".

before/after
Default: false

Prepend and append HTML to the output.

To show the basic search field and results, see the quick start
section earlier. To show as a drop-down list that filters as your type,
you would use the mode parameter. Not that placeholder is probably
worth changing from the default value.
[wps-directory-search mode="list" placeholder="Click and
start typing..."]

You can split the two shortcodes, so for example, you can have
[wps-directory-search] in a Text/HTML widget, with the url option
set to a WordPress page, on which, you have the [wps-directory]
shortcode, which will pick up any search term entered.

168

Hooks and Filters


wps_directory_item_content_filter
Filter
after the user meta information.
$a
$b
$c

HTML generated so far


array of shortcode options
an object of the user

This filter is used by WP Symposium Pro to optionally show profile


extensions (see below).
So here is a simple example to show a link to send an email after the
user meta (please be sure you really want to do this on your site!):
add_action('wps_directory_item_content_filter','my_
function',10,3);
function my_function($a,$b,$c) {
if ( is_user_logged_in() ):
$the_user = get_user_by('id', $c['ID']);
$a .= '<div class="wps_directory_item_location">';
$a .= '<a href="mailto:'.$the_user->user_
email.'">Send email</a>';
$a .= '</div>';
endif;

return $a;
}

Adding Profile Extensions to the


Directory
Any profile extensions that you've set up can be shown along with
the user on the directory, but adding options to the [wps-directory]
shortcode:
profile_extensions
Default: ''

Comma seperated list of profile extensions


to show.

169

profile_extensions_
layout
Default: ''

Comma seperated list of either 'left', '' to


float the labels accordingly. Count of values
must match count of profile_extensions
option.

profile_extensions_
labels
Default: ''

Whether or not to show the profile extension


label (title). Count of values must match
count of profile_extensions option.

For example, assuming you have two profile extensions with slugs
of gender and date-of-birth, you can show them on the directory as
follows:
[wps-directory profile_extensions="gender,date-of-birth"]

By default, the profile extension title will be shown as a label, but


you can set each of the above not to sure as follows:
[wps-directory profile_extensions="gender,date-of-birth"
profile_extensions_labels="0,0"]

Or if you wanted to show the label for date-of-birth but hide the label
for gender (perhaps as it's obvious):
[wps-directory profile_extensions="gender,date-of-birth"
profile_extensions_labels="0,1"]

Which would display something like:

170

Default Friends
You may want new members to your site to automatically become
friends with one or more other members. It helps so that their
"friends" list is not empty after joining them, and maybe, you want a
particular member to say hello to them?
To add one or more users that are automatically added as friends to
new users, go to WPS Pro->Setup->Default Friends and add user
logins, as found via Users->All users. If you want to add more than
one, seperate them with commas.
A checkbox is available to also add existing members as friends to
that user, or users, retrospecively.

171

172

Rewards
A website or social network can really be enhanced by rewarding
users with points for doing certain things, and even displaying
badges (or any image) on their profile page. That's what rewards can
do.

Quick Start
As an example, we will create a reward when a user posts on their
activity stream. Go to WPS Pro->Rewards and click on Add New.
For the title, type in "Activity post", and in the editor "Reward for
adding an activity post".
Then, in the Reward Details box select "New activity post to all
173

friends" and enter 10 as the default value. We'll use a badge too, so
enter 32 as the size of the badge in pixels.
The badge (image) that is shown is the Featured Image, so click on
"Set featured image", and choose/upload an image - cool, if it looks
like a badge or reward!
Click on Publish to create your reward. It's now listed under WPS
Pro->Rewards. Take a note of the value in the slug column:

Edit your user Profile Page (via WPS Pro->All Pages, Edit) and
switch to "Text" view (important!). Put the following line in at the top
of the editor, and save:
Activity points: [wps-reward]

Now, go to your website, and go to your Profile page. You'll see this
in place of the above:

I'm using the custom profile page built in the "Building Your Own
Profile Page" chapter previously in the book. Note it now says
"Activity points: 0", because you've not earned any points.
Add an activity post - the page will refresh and it will now say
"Activity points: 10". You've just earned 10 points!
You can, of course, put the shortcode anywhere you want on your
profile page, or in a Text/HTML widget.
To add the "badge" (the uploaded image) put the following line of
code above the one you added above, noting the slug value:
174

<div style="float:right">[wps-badge slug="activity-post"]


</div>

I'm using some HTML to "float" (align) the badge over to the right
hand side of the page. Your profile page should look like this:

If you now go to another user's page, who hasn't posted any activity,
you'll see that the badge is semi-transparent (they haven't "earned"
the badge yet), for example:

This is fine for now as a quick start, but bear in mind that [wpsreward] shows the total points for the user, not individual rewards.
So more accurately you would put "Total points:" instead of "Activity
points:". Badges are reward specific.
You can also choose a type of "Badge for post count", and then
choose "Type of reward to count" which will reward user's with
points.
But the badge image, instead of being on/off, will slowly appear as
they reach the target number of times they need to repeat the action
you've set. You set the target number of times in "Post count" which
appears when you choose a type of "Badge for post count".
If using type of "Badge of post count", you should set a featured
image to be used.

175

Shortcodes
[wps-reward]
Displays the total number of points a user has earned so far, or the
number of points earned for a specific reward.

Shortcode Options
slug
Default: false

Set to the slug of a specific reward to show


the points just for that rewards, otherwise
total points received are shown.

before/after
Default: false

Prepend and append HTML to the output.

[wps-badge]
Displays a badge for the reward. If a normal reward (ie. not a "Badge
for post count" type), the badge is shown if any points have been
awarded, or semi-transparent if no points have yet been earned.
If the reward is a "Badge for post count" type, then the badge will
slowly appear as the user gets closer to the "Post count" value set
when editing/creating the reward.

Shortcode Options
slug
Default: false

This is mandatory and must be set to the


value of a reward slug.

opacity
Default: 20

How transparent the badge is, if the


associated activity has not been done, as a
percentage.

size
Default: false

If not set, the size of the badge is as set


when creating the reward, but you can override this by setting this option.

176

before/after
Default: false

Prepend and append HTML to the output.

[wps-rewards]
Shows the "top users" ranked by the number of points they've
earned.

Shortcode Options
count
Default: 10

Number of users to show. For example, for a


"top 50" set count to 50.

days
Default: 365

How many days, going backwards, to


include. So for top users in the last week,
you would set days to 7.

avatar_size
Default: 32

Size of the user's avatar in pixels.

link
Default: true

Set to 0 (false) to remove the link to the


user's profile page.

before/after
Default: false

Prepend and append HTML to the output.

Administration
Rewards: Creating/Editing
Create and edit rewards via WPS Pro->Rewards. When doing so, the
following parts of the screen are used:
Title:
What the post is called (eg. "Activity Posts")
Permalink: Where the slug is set, as seen on WPS Pro->Rewards
Editor:
A description of the reward
177

Reward Details (box):


Featured image:

Where you select the type of reward, etc.


Used to set the badge image

Within the Reward Details (box), there are a number of choices:

Type

The "action" that the user has to take,


what they have to do, to earn the points
for this reward.
If not set to "Badge for post count", then
you can set a value for doing this action
once (see below).
If set to "Badge for post count", a badge
is uncovered as a progression to a total
count of these actions, and a "Post
count" can be set (see below).

Default Value

178

Only displayed if anything other than


"Badge for post count" is chosen for the
type. It is the number of points awarded
for doing the action, as defined by Type
above.

Type of reward to
count

Only displayed if "Badge for post count"


is chosen for the type. So, for example,
if you wanted to show a badge slowly
appearing, as a user adds an activity
post, you would select "New activity post
to all friends" here.

Post count

Also related to "Badge of post count",


this is the number of times this action has
to occur for the badge to be completely
shown. For example, set this to 10, to set
the target as doing something ten times
to display the whole badge.

Badge size

If using a badge for this reward, the


default size (as a square) in pixels.

Rewards: User rewards


You can see what rewards have been awarded via WPS Pro->User
Rewards which lists all the awards earned.
You can edit these and change the value given, although it is not
recommended.
You should not try and manually add rewards, as detailed
information is stored in the editor that allows WP Symposium Pro to
track the rewards for use with shortcodes such as [wps-rewards].

179

180

Image Galleries
Let your members share photos! Also supports documents. The
valid file types by default are:
Images:
jpg, png, gif, jpeg, svg
Documents: txt, rtf, pdf

Quick Start
Go to WPS Pro->Setup (after activating the extension) and click on
"Add Gallery Page". This will create a WordPress page, which you
can add to your menu, that displays all the user's galleries.
From this page the member can view their galleries, and create new
galleries. Clicking on a gallery, the user can set the featured image,
edit the description and delete the gallery. As images are added a
post is created on their activity stream, informing their friends.
181

Shortcodes
[wps-gallery]
Displays the member's galleries and allows them to create new
galleries (where they can upload new images).

Shortcode Options
user_id
Default: false

Set to a WordPress user ID, or 'all'. Would


normally leave as false for the currently
logged in user.

no_permission_text
Default: string

Shown if no permission, defaults to ''.

edit_prompt_text
Default: string

Defaults to "Click the title to add a


description and/or add items...".

before/after
Default: false

Prepend and append HTML to the output.

Shortcode Options (viewing all galleries)


You can display all the user's galleries with the following shortcodes,
and optionally, galleries for all users on your site.

182

user_id
Default: false

Set to "all" to show all user galleries, or a


WordPress user ID for that user, otherwise
currently logged in user.

edit_and_cancel_
class
Default: ''

Optional class added to the edit and cancel


buttons.

empty_gallery
Default: string

Defaults to "No albums created yet...".

create_placeholder
Default: string

Defaults to "Enter a title for your album...".

create_label
Default: string

Defaults to "Create a new album...".

create_button_label
Default: string

Defaults to "Create".

cancel_button_label Defaults to "Cancel".


Default: string
edit_prompt_text
Default: string

Defaults to "Click the title to add a


description and/or add items...".

featured_image_
size
Default: 150

Size in pixels of the featured image, as a


square.

show_owner
Default: string

Defaults to "Gallery owner: %s" with %s


replaced with the user's display name. Set to
0 (false) to hide.

show_description
Default: true

Set to 0 (false) to hide the description.


183

show_count
Default: true

Set to 0 (false) to hide the count of images


inside each gallery.

count
Default: 100

Maximum number of galleries to show.

orderby
Default: updated

Can by 'created', 'title' or 'updated'.

For example, to change the size of the featured image to 64 x 64


pixels, you would use:
[wps-gallery featured_image_size="64"]

Shortcode Options (viewing a single gallery)


The following shortcode options are only relevant when viewing an
individual gallery.

184

class
Default: false

Optional class for the comment submit


button.

edit_and_cancel_
class
Default: false

Optional class for the buttons when editing


the gallery's description.t

show_slideshow
Default: false

Set to 1 (true) if you want the slideshow to


show as default.

slideshow_link
Default: string

Defaults to "View slideshow".

slideshow_hide_link Defaults to "Close slideshow".


Default: string
no_permission_text
Default: ''

Text shown if permission not valid to see the


gallery.

edit_text
Default: string

Defaults to "Edit description".

delete_text
Default: string

Defaults to "Delete".

item_size
Default: 150

Size of the image thumbnails (as a square, in


pixels).

show_owner
Default: string

Defaults to "Gallery owner: %s" with %s


replaced with the user's display name. Set to
0 (false) to hide.

back_to
Default: string

Defaults to "Back to Albums".

185

add_text
Default: string

Defaults to "Select files to add...".

button_label
Default: string

Defaults to "Upload".

cancel_button_label Defaults to "Cancel".


Default: string
update_button_
label
Default: string

Defaults to "Update".

edit_prompt_
content
Default: string

Defaults to "Enter a description...".

show_allowed_
types
Default: string

Defaults to "You can upload the following


file types: %s,%s." where the two %s are
replaced with the values from the next two
options.

allowed_image_
types
Default: string

Defaults to "jpg,png,gif,jpeg,svg" which can


be changed, but be wary of security risks.
These are the extensions of file types.

allowed_document_ Defaults to "txt,rtf,pdf" which can be


changed, but be wary of security risks. These
types
are the extensions of file types.
Default: string
Documents are displayed as links to the
documents, not as a thumbnail, with the
same size as set by item_size.
comment_avatar_
size
Default: 64
186

Size of user avatar's beside comments in


pixels, as a square.

comment_label
Default: string

Defaults to "Add Comment".

link
Default: true

Set to 0 (false) to remove links to the profile


page of the user who has added a comment.

date_format
tDefault: string

Defaults to "%s ago" where %s shows how


old the comment is.

As an example, to change the avatar beside the comments, and


remove the label above where the comment is added, you would
use:
[wps-gallery comment_avatar_size="32" comment_label="What do
you think?"]

Hooks and Filters


wps_gallery_attachments_valid_image_extensions_filter
Filter
allows additional image extensions to be added.
$a
$b

array of valid extensions so far


array of shortcode options

Instead of using the allowed_image_types, you can add via this filter,
possibly based on certain criteria. The following assumes svg has
been removed from the allowed_image_types option, and then only
adds it if the user is a site administrator:
add_action('wps_gallery_attachments_valid_image_extensions_
filter','my_function',10,2);
function my_function($a,$b) {
global $current_user;
if (current_user_can('manage_options')):
array_push($a, 'svg');
endif;
return $a;
}

wps_gallery_attachments_valid_document_extensions_filter
Filter
allows additional document extensions
187

to be added.
$a
$b

array of valid extensions so far


array of shortcode options

This operates in the same way as the previous filter for images.
wps_gallery_comment_meta_filter
Filter
allows information to be shown for the comment.
$a
$b
$c
$d
$e
$f

HTML generated so far


array of shortcode options
ID of the gallery (WordPress post)
ID of the WordPress comment
WordPress user ID of the gallery owner
WordPress ID of the currently logged in user

The following will add something like "Last active: 5 mins ago"
alongside the user who made the comment.
Note that this uses part of the API set of functions, and so "/path/
to/" must be changed with your local path to the wp-symposium-pro
plugin folder.
add_action('wps_gallery_comment_meta_filter','my_
function',10,6);
function my_function($a,$b,$c,$d,$e,$g) {
require_once('/path/to/wp-symposium-pro/core_api.php');
$a .= wps_api_user_last_active($e, 'Last active: %s
ago');
return $a;
}

188

[wps-gallery-list]
Displays the member's galleries (or optionally all member's galleries
as a list), tends to be used in a Text/HTML widget.

Shortcode Options
user_id
Default: all

Set to a WordPress user ID to limit the


galleries to that user.

featured_image_
size
Default: 75

Size of the featured image, as a square, in


pixels.

show_description
Default: true

Set to 0 (false) to hide the description. Useful


if user's are tending not to edit their gallery
descriptions.

no_permission_text
Default: ''

Text shown if permission is not adequate,


only applicable if user_id is not set to "all".

no_albums
Default: string

Defaults to "No albums to view.".

edit_prompt_text
Default: string

Defaults to "Click the title to add a


description and/or add items...".

show_count
Default: false

Set to 1 (true) to show the number of items in


each gallery album.

count
Default: 30

Maximum to show.

more
Default: string

Defaults to "more...", as a link that will go to


the gallery page for that album.

189

more_top_
adjustment
Default: 0

Top offset in pixels for fine-tuning the


position of the more link.

more_left_
adjustment
Default: 0

Left offset in pixels for fine-tuning the


position of the more link.

orderby
Default: updated

Can by "created", "title" or "updated".

before/after
Default: false

Prepend and append HTML to the output.

The following is a Text/HTML widget with the following shortcode:


[wps-gallery-list count="3"]

[wps-gallery-grid]
This shortcode is similar to [wps-gallery-list] but is probably more
widely used as part of a custom profile page.

190

Shortcode Options
user_id
Default: all

Set to a WordPress user ID to limit the


galleries to that user.

featured_image_
size
Default: 75

Size of the featured image, as a square, in


pixels.

no_permission_text
Default: ''

Text shown if permission is not adequate,


only applicable if user_id is not set to "all".

no_albums
Default: string

Defaults to "No albums to view.".

count
Default: 30

Maximum to show.

more
Default: string

Defaults to "...", as a link that will go to the


gallery page for that album.

more_top_
adjustment
Default: 10

Top offset in pixels for fine-tuning the


position of the more link.

more_left_
adjustment
Default: 0

Left offset in pixels for fine-tuning the


position of the more link.

orderby
Default: updated

Can by "created", "title" or "updated".

scrolling
Default: true

Set to 0 (false) to disable horizontal scrolling,


and show all in one grid.

191

padding
Default: 3

Number of pixels to use as padding between


the featured images.

For example, the following shortcode could be added to the custom


profile page created earlier in this book (Building Your Own Profile
Page) to show the user's galleries:
[wps-gallery-grid]

Administration
Via WPS Pro->Setup->Galleries it is very important to set the
WordPress page that you use to display the galleries (the page with
[wps-gallery] on it.

192

6. Forums
Extensions

Image and Document


attachments
Whilst the core WP Symposium Pro plugin has a lot of functionality,
the forums extensions adds a wealth of additional features. This
extension, adds the option to upload images and documents to
forum posts and replies. These are then shown as attachments to
those posts/replies, and if clicked on, will be displayed at the original
size (or as big as will fit on the screen).

193

Shortcode Options
Added to [wps-forum-post].
attachment_label
Default: string

Defaults to "Attach a file".

Added to [wps-forum-comment].
attachment_label
Default: string

Defaults to "Attach a file".

Hooks and Filters


wps_forum_attachments_valid_image_extensions_filter
Filter
allows additional image extensions to be added.
$a
$b

array of valid extensions so far


array of shortcode options, or '' depending on function

Instead of using the allowed_image_types, you can add via this filter,
possibly based on certain criteria. The following adds 'tiff' if the user
is a site administrator:
add_action('wps_forum_attachments_valid_image_extensions_
filter','my_function',10,2);
function my_function($a,$b) {
global $current_user;
if (current_user_can('manage_options')):
array_push($a, 'tiff');
endif;
return $a;
}

wps_forum_attachments_valid_document_extensions_filter
Filter
allows additional document extensions to be added.
This operates in the same way as the previous filter for images.

194

Custom Forum Fields


(Forum Extensions)
With custom fields, you can add optional or mandatory fields that
can be completed when creating the first post on a forum.
A common example is a helpdesk forum, where you may want to
know the user's version, operating system, etc.

Creating a Forum Extension


These custom fields are referred to as Forum Extensions (similar to
Profile Extensions for users). They are created in a similar way, via
WPS Pro->Forum Extensions->Add New.
195

The title is for the extension, and then a brief description for the
user in the editor. For example, you might create one to work on a
helpdesk for a software application, and enter the title as "Version"
and in the editor enter "What version are you currently using?".
Then, to the right, is a box entitled "Forum Extension Details". In this
box you can choose what type of field this forum extension is (text,
text area, list or URL) and depending on what your extension type is,
a set of questions.
Required (text, textarea or URL)?
Sets whether the forum extension is mandatory (required) or
optional.
Repeat as editable under replies?
This is useful if the value of the field may change frequently. For
example, you might have a forum extension called "Next action
with..." and the values "User" or "Support Department", which will
change depending on who has last replied.
Values (for list type only)
Enter the values for the list, seperated by a comma. The above
example would be entered as "User,Support Department".
Order
The order in which the forum extension fields should appear on the
screen for the user.

Adding an Extension to a Forum


Forum extensions, when created, are not attached to a particular
forum. This is because they can be used on more than one forum if
required, avoiding the need to create multiple forum extensions that
are the same.
Instead, you simply edit a forum via WPS Pro->Forum Setup->Edit.
Scroll down the page and there is a section allowing your to choose
which extensions should appear on this forum from all those you
have created.
196

Note that all the forum extensions appear, you simply choose those
you want for this particular forum.
Those forum extensions will now show when you create a new post
on the forum (here, with mandatory * beside them):

And then, as the "Repeat as editable under replies?" had been


checked, when replying, that forum extension can be changed if
need be:

Showing forum extensions as a


column on forums
Another powerful feature of forum extensions is being able to
display them as a column on your forum. With our example of who
is expected to act next ("Next action with..."), this would be a useful
column to quickly spot which forum posts need to be reviewed by
the support department.
197

Shortcode Options
An additional option is added to the [wps-forum] shortcode:
extensions
Default: ''

A comma seperated list of forum extension


slugs, to include on the forum.

The forum extension slug can be seen via WPS Pro->Forum


Extensions:

For example, to include the "next-action-with" and "version"


columns, you would add the extensions shortcode option as follows:
[wps-forum slug="general-forum" extensions="next-actionwith,version"]

Which would appear as follows (note that I've renamed next-actionwith to "Owner" at this point as it fits better!):

198

Forum Search
As your forum grows it is necessary to add search functionality. This
extension provide two shortcodes which you probably would add to
a WordPress page. One for the search forum (to enter what you are
searching for) and the second to display the results. Typically they
are on the same page, but can, if preferred be seperated (or you
can have additional forum search forums elsewhere on your site,
perhaps in a Text/HTML widget).

Quick Start
In the majority of cases, the following would typically be added to a
WordPress page:
[wps-forum-search]
[wps-forum-search-results]

199

Which, with the option defaults, will provide forum search


functionality.

Shortcodes
[wps-forum-search]
Display the forum search form, which is one text field in to which
users can type a word or multiple words, that are then treated as a
phase. If hello world is entered, it is treated as "hello world".

Shortcode Options
class
Default: false

Optional class added to the search submit


button.

style
Default: false

Optional style to add to the search text input


field, e.g. "border: 1px solid red".

url
Default: false

If you have put [wps-forum-search-results]


on another page, you can effectively link to
that page by adding the URL.

label
Default: string

Defaults to "Search".

show_with_results
Default: true

Set to 0 (false) to hide if on the same page as


the [wps-forum-search-results] shortcode.

private
Default: false

Set to 1 (true) to only show if the user has


logged in.

private_msg
Default: string

Defaults to "You need to login first."

200

placeholder
Default: ''

Text to appear in the search box (browsers


must be HTML5 compatible).

before/after
Default: false

Prepend and append HTML to the output.

[wps-forum-search-results]
This shortcode will recognise any search terms entered via the [wpsforum-search] shortcode and display the results, with the search
term (word or phrase) highlighted, for example:

Shortcode Options
private
Default: false

Set to 1 (true) to only show if the user has


logged in.

private_msg
Default: string

Defaults to "You need to login first."

label_results
Default: string

Defaults to "Showing results for "%s":"


where %s is replaced by the search term.

no_results
Default: string

Defaults to "No results.".


201

show_forum
Default: string

Defaults to "in %s", with %s replaced with


the forum the post is in. Set to '' to hide.

show_snippet
Default: true

Set to 0 (false) to hide the snippet.

snippet_length
Default: 200

Maximum length of the snippet in characters,


if shown.

show_date
Default: true

Set to 0 (false) to hide the date.

status
Default: all

Can also be set to "open" or "closed" to


represent open or closed forum posts.

date_format
Default: string

Defaults to "%s ago" where %s is replaced


by the age of the forum post.

max
Default: 100

Maximum number of results to display.

before/after
Default: false

Prepend and append HTML to the output.

202

Forum Permissions
This extension allows you to fine tune permissions for your forums
by WordPress roles.
The easiest way, once this extension is enabled (via WPS Pro>Setup->Extensions) is to go to WPS Pro->All Forums. For each
forum is a link "Show Security" that, when clicked, will display a
range of actions, against which are all the WordPress roles that you
have set up.
Simply tick the roles you want to allow to use that feature (for
example, "Viewing" or "Creating" to restrict functionality by
WordPress role.
Read the italicised comment below each set of check boxes to
understand how it is implemented.
This can work very well with other plugins that generate additional
WordPress user roles.
203

204

Forum User Signatures


It is common practice to allow users to set a "signature" that is
displayed at the bottom of every forum post or reply that they add.
This can be text, and optionally, an image.
Once activated, the user can set their forum signature via their Edit
Profile screen:

The user can also remove a previously uploaded image and change
their signature.
205

Note that any URL entered is automatically shown as a hyperlink, so


the above would appear as:

206

Forum Subscriptions
Getting email alerts to relevant forum activity is a great way to keep
your users engaged. This extension and these shortcodes add that
functionality.

Shortcodes
[wps-subscribe-forum]
Allows users to subscribe to a forum and receive an email when new
posts are added to that forum.
Will also display an email icon beside forum titles shown with [wpsforum] if the user has subscribed.
207

Shortcode Options
slug
Default: ''
Mandatory

This is mandatory, and must match the


slug as displayed via WPS Pro->All Forums
beneath the name of your forum, for
example:

style
Default: link

Set as 'button' to display as a button instead


of a hyperlink.

class
Default: ''

Option class for the button (if style set to


'button')

subscribe
Default: string

Defaults to "Get notified via email when new


posts are added".

unsubscribe
Default: string

Defaults to "Stop getting notifications of new


posts".

subscribed_msg
Default: string

Defaults to "You are now subscribed.".

unsubscribed_msg
Default: string

Defaults to "You have unsubscribed.".

before/after
Default: false

Prepend and append HTML to the output.

Basic use would be as follows, added to the individual forum page,


assuming the slug for the forum is "general-forum" in this case:
[wps-subscribe-forum slug="general-forum"]

208

[wps-subscribe-post]
Allows users to subscribe to a forum post and receive an email when
new replies are added to that post.
Will also display an email icon beside forum post title shown with
[wps-forum] if the user has subscribed.
The following shows that the user has subscribed to the General
Forum (through the use of [wps-subscribe-forum] and to one of the
posts with [wps-subscribe-post]:

Shortcode Options
style
Default: link

Set as 'button' to display as a button instead


of a hyperlink.

class
Default: ''

Option class for the button (if style set to


'button')

subscribe
Default: string

Defaults to "Get notified via email when new


comments are added".

unsubscribe
Default: string

Defaults to "Stop getting notifications of new


comments".

subscribed_msg
Default: string

Defaults to "You are now subscribed.".

unsubscribed_msg
Default: string

Defaults to "You have unsubscribed.".


209

before/after
Default: false

Prepend and append HTML to the output.

The following would be added to the individual forum page:


[wps-subscribe-post]

Therefore, combined with the previous shortcode, on the WordPress


page for that forum, assuming the forum slug is "general-forum" you
would end up with some like this:
[wps-forum-post slug="general-forum"]
[wps-subscribe-forum slug="general-forum"]
[wps-subscribe-post]
[wps-forum slug="general-forum"]
[wps-forum-comment slug="general-forum"]

As with all WP Symposium shortcodes, you can place them


wherever you want on the page, in any order and if you like, use
HTML for layout purposes (or your chosen WordPress page editor).

[wps-manage-subscriptions]
This shortcode can be placed on a WordPress page to allow users to
manage their forum subscriptions in one place.

210

forums_label
Default: string

Defaults to "Forums".

posts_label
Default: string

Defaults to "Posts".

unsubscribe
Default: string

Defaults to "unsubscribe".

subs_unsubscribe
Default: string

Defaults to "Cancel all forum subscriptions".

subs_unsubscribe_
msg
Default: string

Defaults to "You will no longer receive any


forum email alerts.".

status
Default: open

Only show forum posts that are open. This


can be changed to 'all' or 'closed'.

closed_prefix
Default: string

Defaults to "closed".

private_msg
Default: ''

Text shown if permission is not valid.

before/after
Default: false

Prepend and append HTML to the output.

Usually added to a new WordPress page and then displayed as a


menu item. For example, used as follows showing open and closed
forum posts:
[wps-manage-subscriptions status="all"]

211

212

Send forum posts/


replies to activity stream
If you would like posts and replies that users make on forums to be
added to their activity stream, activate this extension.
Via WPS Pro->Forum Setup->Edit, you can then set forums to
individually apply (or not) this feature.

213

214

Forum Toolbars
By default, the text area used by members to add forum posts and
replies is a plain text box.
With this extension, you can add icons above this text area to give
formatting options.
The most likely is the WYSIWYG ("What You See Is What You Get")
version, but if you prefer you can use a BB Codes toolbar. This
probably depends on the type of user of your website.
After activating, a new section is available via WPS Pro->Setup
called "Forum Toolbar" which allows you to choose the style of your
toolbar and, if you are using the WYSIWYG version, which icons will
appear on your toolbar.
To set the WYSWIYG toolbar icons, simply copy from the list
provided underneath, creating your unique version. You can set
215

them in any order that you want, ommitting those that you would
prefer to not make available.
The BB Codes Toolbar tends to be used on forums with users that
are developers, for example.

WYSIWYG Toolbar

BB Codes Toolbar

216

Forum YouTube videos


Simply activate this extension and any YouTube URL copied/typed
in to a forum post will cause that video to be shown below the forum
post.
The videos shown are "responsive", they will re-size to match the
device be used, whether computer monitor/screen or phone, tablet,
etc.

Custom Forum Page


The following is a typical set of shortcodes used to create a forum
page, if you want to start using the individual shortcodes, rather than
the default forum page.
Note that this assumes your forum slug is "general-forum". Also
note that some of the shortcodes are on the same line to reduce the
amount of white space where shortcodes are not applicable.
[wps-forum-sharethis slug="general-forum"][wps-forum-post
slug="general-forum"][wps-subscribe-forum slug="generalforum"][wps-subscribe-post]
[wps-forum slug="general-forum"]
[wps-forum-comment slug="general-forum"]

217

218

7. Groups
Extensions

Groups
Groups are a way that your site members can organise themselves
to discuss and share attachments. They can be private (group
administrator has to approval requests to join the group) or public
(anyone can join).

Quick Start
You can quickly setup groups by going to WPS Pro->Setup and
clicking on the "Add Group Pages". This will create two WordPress
pages, one for the Groups page (where user's can create groups
and see those already created), and a second page that displays the
group itself.
After creating the two pages, you should add the Groups page to
your WordPress site menu, but not the Group page which is only
accessed and used by WP Symposium Pro.
219

Through the quick start button a number of shortcodes are added


to the Group page, each of which are covered below. However, like
the profile page you can create your own layout. Similar to the "Build
Your Own Profile Page" section earlier in the book, a section below
will show how to use a custom layout for your group page.
There are quite a number of shortcodes for Groups, the first three
would normally be used on the Groups page, whilst the majority
of the remainder will typically be added to the Group page.
Some, towards the end of the chapter, are used to support other
shortcodes, such as [wps-group-id].

Shortcodes (for Groups page)


[wps-group-create]
Used to show a form with which user's can create new groups. If
you do not want user's to be able to create their own groups, don't
use this shortcode.

Shortcode Options
class
Default: ''

Optional class to add to the button


displayed.

show
Default: false

Set to 1 (true) to show the create form by


default, perhaps if using [wps-group-create]
on it's own page.

label
Default: string

Defaults to "Create Group".

title_label
Default: string

Defaults to "Enter a group name".

220

content_label
Default: string

Defaults to "Enter a brief description".

before/after
Default: false

Prepend and append HTML to the output.

[wps-groups]
This shortcode displays all the groups currently created.

Shortcode Options
header_text
Default: string

Defaults to "<h2>Groups</h2>".

no_results_msg
Default: string

Defaults to "No groups found.".

link
Default: true

Set to 0 (false) to remove the link to the


group's page.

show_date
Default: true

Set to 0 (false) to hide how long since the


group was last active.

date_label
Default: string

Defaults to "Last active %s ago" where %s


is replaced with how long since the group
was last active.

width
Default: 64

Size of the group's featured image, as set y


the group admin. Set to 0 to hide.

order_by
Default: active

Set to active (last activity), title (name of


group) or created (when the group was
created).

order
Default: DESC

Set to ASC (ascending) or DESC


(descending).

221

before/after
Default: false

Prepend and append HTML to the output.

Hooks and Filters


wps_groups_pre_filter
Filter
before all of the groups on the list.
$a
$b

''
array of shortcode options

If any groups exist, this filter allows you to prepend HTML before
the list of groups, for example, adding some content based on the
shortcode parameters passed:
add_action('wps_groups_pre_filter','my_function',10,2);
function my_function($a,$b) {

extract( shortcode_atts( array(

'number' => 50,

), $b, 'wps_groups' ) );

return '<p>Showing a maximum of '.$number.' groups</
p>'.$a;
}

wps_group_item_filter
Filter
after the group HTML has been created.
$a
$b
$c

HTML generated for the group


array of shortcode options
the ID of the group

Allows you to maniplate, replace or act upon the individual group


being displayed.
add_action('wps_group_item_filter','my_function',10,3);
function my_function($a,$b,$c) {
$a = str_replace('class="wps_group_item_display_name"',
'style="display:none"', $a); // this hides the group name
$a = '<h3>'.wps_get_group_name($c, true).'</h3>'.$a;
$a = '<div style="width: 33%; float:left;">'.$a.'</div>';
return $a;
}

222

For example, the above code will move the group's name and
arrange the groups in a grid fashion:

wps_groups_post_filter
Filter
after all of the groups on the list.
$a
$b

HTML generate
array of shortcode options

If any groups exist, this filter allows you to append HTML after the
list of groups, for example:
add_action('wps_groups_post_filter','my_function',10,2);
function my_function($a,$b) {

return $a."<p>That's all folks!</p>";
}

[wps-my-groups]
This shortcode displays all the groups that the current member
belongs to.

Shortcode Options
These are the same as [wps-groups].

Hooks and Filters


These are the same as [wps-groups], except the names of the filters
are as follows:
wps_my_groups_pre_filter
wps_my_group_item_filter
wps_my_groups_post_filter
223

Shortcodes (for Group page)


These shortcodes are designed for use on a group page, and can be
arranged to create your own design. The order of the shortcodes is
going to support the default group page (see Quick Start) as follows:
<h2 style="margin-bottom: 35px;">[wps-group-title]</h2>
<div style="padding-left:200px;">
<div style="float:left; margin: 0 0 20px -200px;">
[wps-group-image]
</div>
<div style="padding-left: 20px;">
[wps-group-description]
<p>
Admin: [wps-group-admin] [wps-group-edit
label="settings"] [wps-group-delete label="delete"]
</p>
[wps-group-join-button]
</div>
</div>
[wps-group-post]
[wps-group-activity]

If you use the above code (copy and paste if viewing an electronic
version of the book) then your group page will look something like
this:

224

If you are unsure of the HTML used to layout the page in the code
above, read the "Building Your Own Profile Page" chapter earlier in
the book.
The main thing to point out in the code above, is that it is based on
an assumption that the group avatar (image) is set to display at 200
pixels wide, hence the use of that value in various styling parameters
(which is included in-line here for the sake of brevity). If you change
the width of the avatar, you should adjust the margin and padding
sizes accordingly in the code.

[wps-group-title]
Shows the name (title) of the group without any formatting.

Shortcode Options
before/after
Default: false

Prepend and append HTML to the output.

[wps-group-image]
Shows the image as set by the group administrator.

Shortcode Options
width
Default: 200

Width of the image shown. The height is


displayed proportionately.

before/after
Default: false

Prepend and append HTML to the output.

[wps-group-description]
Shows the group description as set by the group administrator, via
the [wps-group-edit] shortcode.
225

Shortcode Options
before/after
Default: false

Prepend and append HTML to the output.

[wps-group-admin]
Displays the group administrator, either as a link to their profile page,
or not, depending on the following shortcode option.

Shortcode Options
link
Default: true

Set to 0 (false) to display the administrator's


name without a link to their profile page.

before/after
Default: false

Prepend and append HTML to the output.

[wps-group-edit]
For the group administrator, or site administrator, gives access to
edit the group title (name), description and upload a group avatar
(image).
Through the setting shown, the privacy of the group can be set - if
private, when a user joins the group, their request must first be
approved by the group administrator.
If the group title is shown, for example, before the edit shortcode on
the page, the page changes may not reflect immediately. Hence the
prompt to refresh the page after changes are made.

Shortcode Options
label
Default: string

226

Defaults to "Edit this group".

updated
Default: string

Defaults to "Group details updated.".

updated_ok
Default: string

Defaults to "Refresh page...".

before/after
Default: false

Prepend and append HTML to the output.

The following are used when editing a group.


class
Default: ''

Optional class for the update button.

title_label
Default: string

Defaults to "Group title".

content_label
Default: string

Defaults to "Description".

cancel_label
Default: string

Defaults to "Cancel".

update_label
Default: string

Defaults to "Update Group", used on the


submit button.

private_label
Default: string

Defaults to "Set group as private (join


requests will need to be approved)".

image_label
Default: string

Defaults to "Upload group image".

image_remove_
label
Default: string

Defaults to "Remove group image".


227

[wps-group-delete]
For the group administrator, or site administrator, gives the ability to
delete a group. Once deleted, a group cannot be retored.

Shortcode Options
label
Default: string

Defaults to "Delete this group".

before/after
Default: false

Prepend and append HTML to the output.

[wps-group-join-button]
Shows a button to join the group, or if a member, to leave the group.
If a private group and the join request has not yet been approved,
the button will allow the user to cancel the request.

Shortcode Options
class
Default: ''

An optional class added to the button for


styling purposes.

label_join
Default: string

Defaults to "Join this group".

label_leave
Default: string

Defaults to "Leave this group".

228

label_cancel
Default: string

Defaults to "Cancel request".

text_pending
Default: string

Defaults to "Your request to join this group is


pending.".

text_private
Default: string

Defaults to "Your request will need to be


approved.".
Prepend and append HTML to the output.

[wps-group-post]
Presents the user with a text area to add a group post to the group
activity. If activity attachments extension is activated, can also add
attachments. Same with YouTube and SoundCloud extensions.

Shortcode Options
private_msg
Default: string

What is shown if user is not a member of the


group. Defaults to "".

before
Default: string

Defaults to '<div style="clear:both">' to


support the usual layout of the page, works
with the value for after.

after
Default: string

Defaults to "</div" to support the usual


layout of the page, works with the value for
before.

[wps-group-activity]
Displays the activity stream of the group.

Shortcode Options
private_msg
Default: string

Defaults to "You are not a member of this


group.".
229

back_to
Default: string

Whenever the page with this shortcode on it is viewed, the group


"last active" date/time is updated, as affectively, the group is active
in some where, even if being viewed.
The following shortcodes are not used in the example custom layout
shown at the start of this chapter. [wps-group-members] would
normally be on a separate page and linked to with the [wps-groupid] shortcode (see example below).

[wps-group-members]
Displays the group members, including any pending members
(displayed first) that the group administrator can approve or reject, if
the group is set up as a private group.

Shortcode Options
class
Default: ''
status
Default: all
private_msg
Default: string
avatar_size
Default: 64

230

show_date
Default: true
date_label
Default: string
date_format
Default: string
user_link
Default: true

[wps-group-id]
Generates the ID of the current group, with no formatting. Most
commonly used to generate a link to a WordPress page that shows
the group members, on which the [wps-group-members] shortcode
has been added. For example, putting:
<a href="/members?group_id=[wps-group-id]">Group members</a>

would generate a hyperlink to the page that has the [wps-groupmembers] shortcode on it ("/members" in the above code) and [wpsgroup-id] would be replaced with the ID of the group, so that the
group members page can display the members of the group.

[wps-group-url]
Generates the URL of the current group page. Like [wps-group-id],
it has no shortcode options.

231

Administration
Via WPS Pro->Setup->Groups it is very important to set the
WordPress page that you use to display the group, the one that you
don't put on your site menu!

232

Default Groups
This simple extension allows you to automatically add news users
into one or more groups.
Via WPS Pro->Setup->Default Groups, enter the ID of the group,
that you want new users to automatically become a member of.
If you want to add them to more than one group, enter several
separated by commas.
You can find the Group IDs via WPS Pro->Groups (or click on
the link provided). On the screen you then see, there is a column
showing the ID of each group, for example:

233

234

8. Private
Messaging
Extensions

Private Messages
Allowing user's to send each other messages within your website is
a terrific way to keep them engaged and returning back to the site.
But, private messaging with WP Symposium Pro is much more than
that - messages are more akin to conversations, with multiple friends
as recipients, allowing your members to have true conversations.
Other friends can be added to a conversation, or removed,
depending on how the conversation goes.

Quick Start
After activating private messages via WPS Pro->Setup, click on the
"Add Messages Page" button and a page will be created for you,
which you probably then want to add to your site menu.
This will create a page with a varierty of private messaging
235

shortcodes and a default layout, which as with all WP Symposium


Pro shortcodes, you can re-arrange to make your own custom
messaging page.
Here is the default private messaging page, for reference:
[wps-mail-recipients]
<div style="float: right;">[wps-mail-search]</div>
[wps-mail-post]
<div style="float: left;">[wps-mail-backto]</div>
[wps-mail]
[wps-mail-comment]
[wps-mail-backto]

which, depending on your theme, will produce something like:

Shortcodes
There are quite a number of private messaging shortcodes, giving
you flexibility in how you use them.
Please note: private messaging used to be called "mail", but was
changed to avoid confusion with emails. However, the shortcodes
that follow, and are used, still refer to "mail" to ensure compatibility
with early adopters of WP Symposium Pro.

[wps-mail]
Displays a list of message conversations for the currently logged in
user, and allows user's to view each conversation.

236

Shortcode Options
count
Default: 100

The maximum number of conversations to


show.

mark_all_read_text
Default: string

Defaults to "Mark all as read".

private_msg
Default: string

Defaults to "You must be logged in to view


your messages.".

show_hidden_text
Default: string

Defaults to "Show hidden messages".

hide_hidden_text
Default: string

Defaults to "Hide hidden messages".

login_url
Default: ''

An optional URL that user's will be pointed


to, to login. If using the Login & Register
extension, after logged in, the user will be
redirected back to their messages.

label_nomail
Default: string

Defaults to "No messages.".

date_format
Default: string

Defaults to "%s ago", where %s is replaced


with the age of the last contribution to the
message conversation.

comment_avatar_
size
Default: 64

Size of avatars when viewing a conversation.

before/after
Default: false

Prepend and append HTML to the output.

237

For example, to show a login hyperlink if the user is not logged in,
where the login form is on "/login" you would use:
[wps-mail login_url="/login"]

Hooks and Filters (list of messages)


wps_mail_post_item
Filter
after each message.
$a
$b
$c
$d
$e
$f

HTML generated for the message


array of shortcode options
array of message related information
number of replies in this conversation
formatted string for when last active
boolen value for whether to show hidden messages

The $c array is comprised of the following:


ID
post_author
post_name
post_title
post_title_lower
post_date
post_date_gmt
post_content
recipients
unread
hidden

WordPress ID of the original message


WordPress user ID of the original message
unique slug of the post subject
original subject of the post
lower case version of post_title
date/time stamp of the post/last reply
GMT version of post_date
The original message
array of recipient user logins
true if message or last reply not yet read
true if the user has "deleted" the conversation

You could therefore re-create your own version of each message:


add_filter('wps_mail_post_item','my_function',10,6);
function my_function($a,$b,$c,$d,$e,$f) {
$mail_html = '<div id="wps_mail_'.$c['ID'].'"';
$mail_html .= ' class="wps_mail_post';
if ($c['unread']) $mail_html .= ' wps_mail_post_unread';
if ($c['hidden']) $mail_html .= ' wps_mail_post_hidden';
$mail_html .= '"';
if ($c['hidden'] && !$f)

238

$mail_html .= ' style="display:none;"';


$mail_html .= '>';
$mail_html .= 'my re-created version'; // for you to do!
$mail_html .= '</div>';
return $mail_html;

Hooks and Filters (viewing a message)


wps_mail_message_pre_filter
Filter
before the message is displayed.
$a
$b
$c
$d

HTML generated for the message


array of shortcode options
the original message as an object
recipients as array of user logins

For example, to add some content above the message:


add_filter( 'wps_mail_message_pre_filter', 'my_function', 10,
4 );
function my_function( $a,$b,$c,$d ) {

$a = '<div>at the top</div>'.$a;

return $a;
}

wps_mail_message_post_title_filter
Filter
after the message title (subject)
$a
$b
$c

HTML generated for the message


array of shortcode options
the original message as an object

For example, to add change the surrounding <h2> tags to <h1> you
could do the following (in a basic way):
add_filter( 'wps_mail_message_post_title_filter', 'my_
function', 10, 3 );
function my_function( $a,$b,$c ) {

$a = str_replace('<h2 ', '<h1 ', $a);

$a = str_replace('/h2>', '/h1>', $a);

return $a;
}

239

wps_mail_item_filter
Filter
after the initial post content
$a
$b
$c
$d

HTML generated for the message


array of shortcode options
the original message as an object
the message content

wps_mail_item_filter
Filter
after each reply (inside of the surrounding DIV)
$a
$b
$c
$d

HTML generated for the reply


array of shortcode options
the reply as an object
the reply content

wps_mail_post_comment_filter
Filter
after each reply (outside of the surrounding DIV)
$a
$b
$c
$d

HTML generated for the reply


array of shortcode options
the reply as an object
the reply content

wps_mail_post_comment_filter
Filter
after the post and all the replies have been displayed
$a
$b
$c

HTML generated for the message


array of shortcode options
recipients as array of user logins

[wps-mail-post]
Creates the area to start a new message.

240

Shortcode Options
class
Default: ''

Optional class for the form buttons.

show
Default: false

Set to 1 (true) to show the form by default.

recipients_label
Default: string

Defaults to "Recipient(s)".

to_label
Default: string

Defaults to "To:".

title_label
Default: string

Defaults to "Subject".

content_label
Default: string

Defaults to "Private Message Content".

label
Default: string

Defaults to "New Message".

cancel_label
Default: string

Defaults to "Cancel".

no_friends
Default: string

Defaults to "You can only send messages if


you have friends.".

select_recipient
Default: string

Defaults to "Select at least one recipient...".

before/after
Default: false

Prepend and append HTML to the output.

241

Hooks and Filters


wps_mail_post_pre_form_filter
Filter
above the form
$a
$b
$c

HTML generated so far


array of shortcode options
WordPress user ID of current logged in user

So in order to add content at the top of the form, you could use the
following:
add_filter( 'wps_mail_post_pre_form_filter', 'my_function',
10, 3 );
function my_function( $a,$b,$c ) {

$a .= '<p>Nothing nasty!</p>';

return $a;
}

wps_mail_textarea_pre_form_filter
Filter
above the form textarea
$a
$b
$c

HTML generated so far


array of shortcode options
WordPress user ID of current logged in user

So in order to add content above the textarea box, you could use
the following:
add_filter( 'wps_mail_textarea_pre_form_filter', 'my_
function', 10, 3 );
function my_function( $a,$b,$c ) {
$a .= '<p>Keep it clean!</p>';
return $a;
}

wps_mail_post_post_form_filter
Filter
at the end of the form
$a
$b
$c

242

HTML generated so far


array of shortcode options
WordPress user ID of current logged in user

wps_mail_post_add_hook
Hook
after a new message has been created
$a
$b
$c

the message being added as $_POST


any attachments as $_FILES
WordPress post ID of the new message

[wps-mail-comment]
Creates the area to reply to a message. Note that these are often
referred to as comments here as WordPress stores the replies as
comments against the original post (original message).

Shortcode Options
class
Default: ''

Optional class to add to the submit button.

show
Default: true

Set to 0 (false) to hide the reply area by


default.

content_label
Default: ''

Could be set to something like 'Your reply...'.

label
Default: string

Defaults to "Add Reply".

before/after
Default: false

Prepend and append HTML to the output.

243

Hooks and Filters


wps_mail_comment_post_form_filter
Filter
after the textarea
$a
$b
$c

HTML generated so far


array of shortcode options
WordPress user ID of current logged in user

wps_mail_comment_add_hook
Hook
after a new reply has been created
$a
$b
$c
$d

the reply being added as $_POST


any attachments as $_FILES
WordPress post ID of original message
WordPress comment ID of the new reply

[wps-mail-recipients]
Displays those user's involved in this conversation (the recipients)
and the ability to add/remove users from the conversation.
The author of the original message, any recipient and site
administrators can add more recipients.
The author of the original message, and site administrators can
remove recipients. A recipient can also remove themself.
Here, there are only two recipients (the author of the original
message and the user it was sent to), but this will extend if there are
more recipients.

244

Shortcode Options
size
Default: 96
add_recipients
Default: string
cancel_label
Default: string
add_image_url
Default: WPS image
before/after
Default: false

Prepend and append HTML to the output.

For example, to change the "+" image, and use an avatar size of
48x48 pixels, you would use the following:
[wps-mail-recipients size="48" add_image_url="/image.png"]

[wps-mail-backto]
Displays a link back to the WordPress page (as set via WPS Pro>Setup->Private Messages) to shows the user's private message
conversations.

Shortcode Options
label
Default: string

245

[wps-mail-search]
Displays a search box, into which a word or phrase can be entered,
and the user's conversations search. When the page is reloaded,
results are displayed with the word/phrase highlighted if displayed.

Shortcode Options

placeholder
Default: string
reset
Default: string

[wps-mail-to-user]
Displays a button on the page that when clicked, opens a "div"
(popup area) into which a message can be entered, and sent to the
user on which the button is being displayed. Generally only used on
profile pages, unless the user_id option is set. Could also be used in
a Text/HTML widget as only displays when applicable (i.e. a user ID
can be worked out, or user_id is set).

246

class
Default: ''
user_id
Default: false

friends_only
Default: true
label
Default: string
popup_label
Default: string
popup_cancel_label
Default: string
popup
Default: true

247

[wps-alerts-mail]
On many social networks, the user's can be helped by
showing an icon, with a number over the top showing the
number of new messages.

Shortcode Options
flag_size
Default: 24
flag_unread_size
Default: 10
flag_unread_top
Default: 6
flag_unread_left
Default: 8
flag_unread_radius
Default: 8
flag_url
Default: false
Mandatory
single_redirect
Default: true

flag_src
Default: false
248

249

250

Message Attachments
You can choose to allow user's to attach images/documents to
messages, and recognise YouTube URLs to show the video below
the message.

Images and Documents


Via WPS Pro->Setup you can activate the extensions to permit users
to attach files to messages, such as images.

251

By default, you can attach the following:


Images:
jpg/jpeg, png, gif, svg
Documents: txt, rtf, pdf

YouTube videos
If activated, any recognised YouTube URL will cause the video to be
automatically inserted below the message.

YouTube videos shown are "responsive" and will reduce in size if


viewed on tablets, phones, etc.

252

Email alerts
Private messaging works great, and it's a fabulous way to keep your
users returning to your site. But if users don't return to your site they
would not know about new messages or replies.
Activate this option to send out an alert for new messages and
replies to existing messages, to get your users to return to your site.

253

254

Site-wide chat room


Also referred to as the "Lounge" this is an open chat room for all
members of your site.

Quick Start
After activating, click on the "Add Lounge Page" quick start button
to create a WordPress page which you can optionally add to your
WordPress menu.

Shortcodes
There is only one shortcode with a small number of options
available.
255

[wps-lounge]
Displays the chat room in which logged in users can participate.

Shortcode Options
chats
Default: 30
refresh
Default: 5
please_wait
Default: string
date_format
Default: string

256

Calendar
The calendar is a convenient way to publicise events to all members
of your site. You can have multiple calendars, and set which
members can view and add events by WordPress roles.

Quick Start
After activating, click on the "Add Calendar Page" quick start button
to create a WordPress page which you can optionally add to your
WordPress menu.

Shortcodes
Three shortcodes are available to display your calendar, add events
and show a link back to the calendar when viewing a single event.
257

[wps-calendar]
Displays the calendar to those who can see it, as defined via WPS
Pro->Calendars->Edit.

Shortcode Options (viewing calendar)


slug
Default: ''
Mandatory

days
Default: string
months
Default: string
suffix
Default: string
private_msg
Default: string

Defaults to "You do not have permission to


view this calendar."

left
Default: &laquo;

A character that represents previous month,


the default is the double arrow. Can be an
HTML entity code as per the default.

258

right
Default: &raquo;

A character that represents previous month,


the default is the double arrow. Can be an
HTML entity code as per the default.

today
Default: string

Defaults to "Today"

thumbnails
Default: true

Set to 0 (false) to hide event thumbnails, if an


image is attached to an event.

titles
Default: true

Set to 0 (false) to hide the event title.

Shortcode Options (viewing single event)


The following are specific to the "event view", ie. when you have
clicked on an event in the calendar.
avatar_size
Default: 64

Size of the avatar for the initial post (event


creator).

date_format
Default: string

Defaults to "%s ago" with %s replaced with


the time since the event was created.

label_noevents
Default: string

Defaults to "No events."

comment_label
Default: string

Label for the comment buttons, defaults to


"Add Comment"

comment_avatar_
size
Default: 64

Size of the avatar's for the users of


comments added.
259

attachment_label
Default: string

Defaults to "Attach an image".

delete_label
Default: string

Defaults to "Delete".

A good example of how you can easily translate to different


languages is by setting days, months and suffix.
You must set the slug, so for example, here the slug is set and the
left/right placeholders changed:
[wps-calendar slug="my-events" left="Previous" right="Next"]

[wps-calendar-post]
Allows those permitted to add a new event to this calendar.
260

Shortcode Options
slug
Default: ''
Mandatory

The slug of the calendar which can be found


via WPS Pro->Calendars.

class
Default: ''

An optional class added to the submit


button.

show
Default: false

Set to 1 (true) to show the add event form by


default.

label
Default: string

Defaults to "Add Event".

update_label
Default: string

Defaults to "Update Event".

title_label
Default: string

Defaults to "Event Title".

content_label
Default: string

Defaults to "Event Description".

start_date_label
Default: string

Defaults to "Start Date".

start_time_label
Default: string

Defaults to "Start Time".

end_date_label
Default: string

Defaults to "End Date".

261

end_time_label
Default: string

Defaults to "End Time".

image_label
Default: string

Defaults to "Event Image".

comments_label
Default: string

Defaults to "Event comments".

comments_
allowed_label
Default: string

Defaults to "Allow comments".

before/after
Default: false

Prepend and append HTML to the output.

Hooks and Filters


wps_calendar_post_pre_form_filter
Filter
before the form for a new event
$a
$b
$c

HTML generated so far


array of shortcode options
WordPress user ID of current logged in user

For example, to add content above the form:


add_filter('wps_calendar_post_pre_form_filter', 'my_
function', 10, 3);
function my_function($a,$b,$c) {
$a .= '<p>Nothing rude please!</p>';
return $a;
}

[wps-calendar-backto]
Shows a link back to the calendar, only appears when viewing a
single event.

262

label
Default: string

Defaults to "Back to calendar...".

before/after
Default: false

Prepend and append HTML to the output.

263

264

9. Using
shortcodes in
theme page
templates

Functions available
All shortcodes can be used as a PHP function, allowing those who
would like to edit page templates, create plugins or otherwise use
code directly, to include WP Symposium Pro functionality.
A typical use of this is the inclusion of "flags" showing unread
messages, friend requests and new alerts relevant to the user.
The following list shows every shortcode in WP Symposium Pro and
the related function that you would call.
To the left is the shortcode, and beside it the equivalent function.
Following the list, how you se examples of these functions and how
to pass options.

265

Profile
[wps-avatar] wps_avatar()
[wps-avatar-change] wps_avatar_change()
[wps-avatar-change-link]
wps_avatar_change_link()
[wps-display-name] wps_display_name()

Activity
[wps-activity] wps_activity()
[wps-activity-page] wps_activity_page()
[wps-activity-post] wps_activity_post()
[wps-alerts-activity] wps_alerts_activity()

Directory
[wps-directory] wps_directory()
[wps-directory-search] wps_directory_search()

Members
[wps-close-account]
wps_close_account()
[wps-friends] wps_friends()
[wps-friends-add-button]
wps_friends_add_button()
[wps-friends-pending] wps_friends_pending()
[wps-friends-status] wps_friends_status()
[wps-gallery] wps_gallery()
[wps-gallery-grid] wps_gallery_grid()
[wps-gallery-list] wps_gallery_list()
[wps-usermeta] wps_usermeta()
[wps-usermeta-button] wps_usermeta_button()
[wps-usermeta-change]
wps_usermeta_change()
[wps-usermeta-change-link] wps_usermeta_change_link()

266

Rewards
[wps-badge] wps_badge()
[wps-reward] wps_reward()
[wps-rewards] wps_rewards()

Forums
[wps-forum] wps_forum()
[wps-forum-comment] wps_forum_comment()
[wps-forum-page] wps_forum_page()
[wps-forum-post] wps_forum_post()
[wps-forums] wps_forums()
[wps-forum-backto] wps_forum_backto()
[wps-forum-show-posts]
wps_forum_show_posts()
[wps-forum-sharethis] wps_forum_sharethis_insert()

Groups
[wps-group-activity] wps_group_activity()
[wps-group-admin] wps_group_admin()
[wps-group-create] wps_group_create()
[wps-group-delete] wps_group_delete()
[wps-group-description]
wps_group_description()
[wps-group-edit] wps_group_edit()
[wps-group-id] wps_group_id()
[wps-group-image] wps_group_image()
[wps-group-join-button]
wps_group_join_button()
[wps-group-members] wps_group_members()
[wps-group-post] wps_group_post()
[wps-groups] wps_groups()
[wps-group-title] wps_group_title()
[wps-group-url] wps_group_url()
[wps-my-groups] wps_my_groups()

267

Private Messages
[wps-alerts-mail] wps_alerts_mail()
[wps-mail] wps_mail()
[wps-mail-backto] wps_mail_backto()
[wps-mail-comment] wps_mail_comment()
[wps-mail-post] wps_mail_post()
[wps-mail-recipients] wps_mail_recipients()
[wps-mail-search] wps_mail_search()
[wps-mail-to-user] wps_mail_to_user_post()

Calendar
[wps-calendar] wps_calendar()
[wps-calendar-backto] wps_calendar_post()
[wps-calendar-post] wps_calendar_post()

Core/Miscellaneous
[wps-login-form] wps_login_form()
[wps-lounge] wps_lounge()

Passing options
Shortcode options, when used with functions, are passed an array
of these options. The options and values are the same as per the
shortcodes which you can get from the relevant chapter in this book.
The best way to see how they work is with the following examples,
see how the array parameters in the following code represent the
shortcode options.

268

Examples
The following are some examples of how these functions can be
used.

Unread mail messages icon


The following PHP code will display a custom flag icon (flag_src),
pointing to /mail (flag_url). It also shows the number of unread mail
messages if applicable. flag_src is optional.
echo wps_alerts_mail(array(
'flag_url'=>'/mail',
'flag_src'=>'/path/to/mail_light.png'
));

New friend request icon


The following PHP code will display a custom flag icon (flag_src),
pointing to /friends (flag_url). It also shows the number of pending
friendship requests if applicable. flag_src is optional.
echo wps_alerts_friends(array(
'flag_url'=>'/friends',
'flag_src'=>'/path/to/friends_light.png'
));

New alerts icon


The following PHP code will display a custom flag icon (flag_src),

269

pointing to /alerts (flag_url), changing the default setting to an icon


(style). It also shows the number of new alerts if applicable. flag_src
is optional.
echo wps_alerts_activity(array(
'style'=>'flag',
'flag_url'=>'/alerts',
'flag_src'=>'/path/to/flag_light.png'
));

Dropdown list of alerts


The following PHP code will show a drop down list of alerts, passing
no parameters, using the default settings.
echo wps_alerts_activity('');

Quick member select dropdown


As used on www.wpsymposiumpro.com, the following will display
a dropdown list that is searchable, allowing the quick selection of a
member, and going to their profile page when hitting return.

echo wps_directory_search(array(

'quick_select' => '1',

'mode' => 'list',

'placeholder' => 'Member search...'
));

270

271

272

10. Core
Functions
(API)

10

These functions are available with


the core plugin, and can be used by developers as an API when
developing other plugins, etc.

Accessing the API

To be able to use the core functions, you need to include the API file,
for example, changing the path to match your installation:
require_once('your/path/to/plugins/wp-symposium-pro/core_api.php');

API Functions
For a more technical representation of parameters and return values,
please view the core_api.php file directly. For every function is a list
of parameters, return value, and other relevant technical information.

Insert Activity Post


Adds a post into the activity stream of a user.
wps_api_insert_activity_post
Returns
ID of the new WordPress activity post, or false
273

$a
$b
$c
$d

$e

The activity post to be inserted.


The WordPress ID of a user as the author of the post.
The WordPress ID of a user as the target of the post
$_POST of any other fields to be used via
wps_activity_post_add_hook filter (optional).
$_FILES of any other fields to be used via
wps_activity_post_add_hook filter (optional).

To add an activity post to a member's activity stream to themselves,


shared with their friends, set $c to the same as $b. So, to add
an activity post to the member whose WordPress user ID is 99,
targetting themselves (ie. shared with just friends) you would use the
following:
wps_api_insert_activity_post('The post', 99, 99);

To pass $_POST and $_FILES, you would:


wps_api_insert_activity_post('The post', 99, 99, $my_POST,
$my_FILES);

Within the function, the wps_activity_post_add_hook hook is called


as with WP Symposium Pro, passing $my_POST and $my_FILES.

Get user's last active date/time


Gets last active timestamp for a user, optionally formatted
wps_api_user_last_active
Returns
Date/time value, formatted string, or false if no last

active value available.
$a
$b

The WordPress user ID.


Set to false to return date/time value, or a string for
formatting, eg: "Last active: %s ago".

To get the last active date/time for user 99, formated as "Last active:
1 hour ago" (for example):
wps_api_user_last_active(99, "Last active: %s ago");

274

275

276

Index
Shortcodes
[wps-activity] 38, 139, 144
[wps-activity-page] 20, 21
[wps-activity-post] 36
[wps-alerts-activity] 70
[wps-alerts-mail] 248
[wps-avatar] 32
[wps-avatar-change] 50, 54, 64, 65, 66, 67, 70
[wps-avatar-link] 35, 36
[wps-badge] 176
[wps-calendar] 258
[wps-calendar-backto] 262
[wps-calendar-post] 260
[wps-close-account] 60
[wps-directory] 164
[wps-directory-search] 167
[wps-forum] 78, 88, 91, 207, 209
[wps-forum-backto] 94
[wps-forum-comment] 88, 91, 194
[wps-forum-page] 76
[wps-forum-post] 194
[wps-forums] 91
[wps-forum-sharethis] 99
[wps-forum-show-posts] 95
[wps-friends] 64, 65, 66, 67, 70
[wps-friends-add-button] 67
[wps-friends-pending] 65, 66, 67
[wps-friends-status] 66, 67
[wps-gallery] 182, 192
[wps-gallery-grid] 190
[wps-gallery-list] 189
[wps-group-activity] 229
[wps-group-admin] 226
[wps-group-create] 220, 225
[wps-group-delete] 228
[wps-group-description] 225
277

[wps-group-edit] 226
[wps-group-id] 231
[wps-group-image] 225
[wps-group-join-button] 228
[wps-group-members] 230, 236, 240
[wps-group-post] 229
[wps-groups] 221, 223
[wps-group-title] 225
[wps-group-url] 231
[wps_login_form] 121
[wps-lounge] 256, 258, 260, 262
[wps-mail] 236
[wps-mail-backto] 245
[wps-mail-comment] 243
[wps-mail-post] 240
[wps-mail-recipients] 244
[wps-mail-search] 246
[wps-mail-to-user] 246
[wps-my-groups] 223
[wps-reward] 176, 182, 189, 190, 200, 207, 209, 210
[wps-rewards] 177
[wps-usermeta] 56
[wps-usermeta-button] 59
[wps-usermeta-change] 54
[wps-usermeta-change-link] 58
A
accept_request_label 66, 166
Accessing the API 265, 273
account_closed_msg 37
Activating the Individual Extensions 118
Activity attachments 137
Activity share lists 135, 137
activity stream 38
Activity to Facebook 149
Add Calendar Page 257
Add Forum 16
Add Forums 16
add_image_url 245
Adding alerts to your theme 72
Adding an Extension to a Forum 196
278

Adding Profile Extensions to the Directory 169


Add Profile Page 15
Add Profile pages 15
add_recipients 245
add_text 186
Admin Only 157
age 159
Alerts 69
All Forums 102
allow_comments 84
allowed_document_types 186
allowed_image_types 186, 187
allow_private 90
allow_replies 41
allow_undislikes 144
allow_unlikes 144
Alternative forum layouts 81
Always Show? 157
Application ID 149
Application Secret 149
are_you_sure_text 60
attachment_label 194, 260
author_format 96
author_link 97
Autosubscribe 102
avatar 20, 35
avatar_size 39, 148, 164, 177, 230, 259
B
back_to 185, 230
Badge for post count 178
Badge size 179
base_date 77, 81, 92, 97
BB Codes 215
BB Codes Toolbar 216
Blog 17
Building Your Own Profile Page 103, 192
button_label 186
by_text 145
C
279

Calendar 257
cancel_button_label 183, 186
cancel_label 67, 227, 241, 245
cancel_request_label 68
captcha 123
CAPTCHA 122
Change Avatar Page 47, 49
change_link 34
chats 256
choose 50
Choosing Activity Recipient(s) 133, 135
class 37, 40, 54, 59, 60, 66, 68, 77, 167, 185, 200, 208, 209, 220,
227, 228, 230, 247, 261
clear out your alerts 73
close an account 60
closed_prefix 80, 96, 211
closed_switch 79
closed_switch_msg 79
close_msg 89
comment_add_label 84
comment_avatar_size 39, 186, 237, 259
comment_class 85
commented 82
comment_label 187, 259
comment_pending 80
comments_allowed_label 262
comments_avatar_size 85
comments_closed_msg 89
comment_size 40
comment_size_text_plural 40
comment_size_text_singular 40
comments_label 262
Connect to Facebook 151
content_label 78, 89, 221, 227, 241, 243, 261
Core Functions 265, 273
count 39, 64, 65, 81, 177, 184, 189, 191, 237
count_include_replies 93
country 23, 54, 125
country_label 24
create_button_label 183
280

create_label 183
create_placeholder 183
Creating a Forum Extension 195
Creating Profile Extensions 154
crop 50, 51
CSS 105, 111
Custom Email Alerts 119, 121, 129, 133, 135, 147, 149, 153, 161
Custom Forum Fields (Forum Extensions) 195, 199, 203, 205, 207,
213
Custom Forum Page 217
D
Data Protection Act 61
date 156
date_format 41, 71, 81, 97, 148, 187, 202, 231, 237, 256, 259
date_label 165, 221, 231
dating site 153
days 177, 258
Default Friends 171
Default Groups 233, 273
Default Profile Page 20
Default Value 178
delete_all_text 71
delete_label 41, 260
delete_text 185
deleting users 60
Disable Alerts 73
dislike_count_text_plural 145
dislike_count_text_singular 145
dislike_text 144
display_name 54, 125
Divider 157
done_text 145
Dropdown list of alerts 270
dynamic_previews 140
Dynamic Previews 142
E
edit_and_cancel_class 183, 185
Edit Profile 21, 154
Edit Profile Page 47, 53
281

edit_prompt_content 186
edit_prompt_text 182, 183, 189
edit_text 185
email 55
Email alerts 253
Emails to send 74
empty_gallery 183
empty_msg 80
empty_text 158
end_date_label 261
end_time_label 262
Extension Details box 155
extensions 198
Extensions plugin 12
F
Facebook 17, 149
Facebook and Twitter 17
Facebook Application 151
Facebook page URL 155
fail_image 141
fail_text 141
Favorite Activity 147
Featured image 178
featured_image_size 183, 189, 191
featured_image_width 93
file_types_msg 50
flag_size 70, 248
flag_src 71, 248
flag_unread_left 70, 72, 248
flag_unread_radius 71, 72, 248
flag_unread_size 70, 248
flag_unread_top 70, 72, 248
flag_url 71, 248
Forgotten Password? Form 126, 127
forum_count 92
forum_freshness 92
forum_last_activity 92
Forum Permissions 203, 205, 207, 213
Forums 75
Forum Search 199, 203, 205, 207, 213
282

Forum Setup 102


forums_label 211
Forum Subscriptions 207, 213
forum_title 92
Forum User Signatures 205
Forum YouTube videos 217
Frequency of Email alert notifications 74
friend_add_label 166
friend_cancel_label 166
friend_request 67, 165
Friends and Activity 15
friendship_class 166
friendship requests 23
friends_no 67, 165
friends_only 247
Friends Page 63, 69, 75
friends_pending 67, 165
friends with every other member 68
friends_yes 66, 165
From email 74
From name 74
FTP 25, 27
functions.php 25, 26
G
gaming site 153
get_max 40
Getting Started Quickly 15
Getting the Extensions Plugin 117
Getting WordPress 11
Getting WP Symposium Pro 12
Google map 22
go_to 148
gravatar 34
Groups 181, 219, 220, 233, 235, 251, 253, 255, 257, 273
H
header_count 76, 80, 93
header_last_activity 76, 80, 82, 93
header_text 221
header_title 76, 80, 93
283

helpdesk forum 195


Helpdesk Support 13
hide_hidden_text 237
hide_label 41
hide town and country 55
hide_until_loaded 40
Hooks and Filters 24, 38
How this book is arranged 18
HTML 105, 106, 111
I
icon alert for pending friendship requests 73
icon alert for unread activity alerts 72
icon alert for unread messages 73, 131
ignore_images 140
ignore_links 140
image 156
Image and Document attachments 193
Image Galleries 181
image_label 227, 262
image_remove_label 227
include_closed 96
include_comments 96
include_friends 41
include_friendship_action 166
Include in Directory Search? 157
include_meta_show 168
include_posts 96
include_replies 96
include_self 41, 166
Insert Activity Post 273
Introduction To Hooks And Filters 25
item_size 185
L
label 37, 40, 50, 54, 57, 60, 67, 78, 89, 95, 168, 200, 220, 226, 228,
241, 243, 245, 247, 261, 263
label_back_to_login 125
label_cancel 229
label_email 124
label_join 228
284

label_leave 228
label_login 123
label_lostpassword 123
label_lostpassword_send 126
label_name 125
label_noevents 259
label_nomail 237
label_password 124
label_password_confirm 124
label_prefix 158
label_register 123
label_results 201
label_username 123, 124
last_active_format 64, 165
last_active_text 64
layout 65, 166
layouts, Alternative forum 81
left 258
level_0_links 92
licence 12, 117
like_count_text_plural 144
like_count_text_singular 144
like_text 144
limit 164
link 41, 64, 66, 148, 164, 177, 187, 221, 226
list 155
Live chat support 13
locked_msg 78, 89
Login and Redirect 121
login form 121
Login Form 123
Login Form Shortcode Options 123, 124
Login to Facebook 149
login_url 80, 237
logout_text 60
lost_password 123
M
Mailing List 17
make_all_read_text 71
Manage lists 136
285

mandatory 125
mandatory text 126
map_size 23
map_style 23, 57
map_zoom 23
mark_all_read_text 237
max 96, 202
max_names_to_show 145
max_previews 140
max_width 141
Member Directory 163
Menu Alerts 131
Message Attachments 251
meta 57
meta_class 55
mimic_user_id 24, 42
min_width 141
mode 124, 167
moderate 78, 89
moderate_msg 78, 89
months 258
more 40, 189, 191
more_label 40
more_left_adjustment 190, 191
more_text_plural 145
more_text_singular 145
more_top_adjustment 190, 191
moved_to 80
N
name 125
New alerts icon 269
New friend request icon 269
nickname 125
no_activity_text 71
no_albums 189, 191
no_favorites_text 148
no_friends 241
no_indent 92
none 65, 66
no_permission_text 182, 185, 189, 191
286

no_results 201
no_results_msg 164, 221
not_found 42
not_permitted 50
number 164
O
opacity 176
order 96, 164, 221
Order 102, 157, 196
order_by 164, 221
orderby 96, 184, 190, 191
or_text 145
P
padding 192
page_size 84
page_x_of_y 84
pagination 83
pagination_bottom 84
pagination_top 84
password 54, 125
password2 54
password_msg 55
pending 80
pending friendship requests 65, 66
Permalink 177
PHP 26, 73, 269
placeholder 167, 201, 246
please_wait 256
popup 247
popup_cancel_label 247
popup_label 247
Post count 179
post_deleted 84
post_id 41
post_preview 83
posts_label 211
Privacy 102
private 64, 168, 200, 201
private_label 227
287

Private Messages 131


private_msg 37, 42, 78, 80, 89, 168, 200, 201, 211, 229, 230, 237,
258
private_reply_check_msg 90
private_reply_msg 85
profile_extensions 169
Profile Extensions 58, 147, 149, 153, 161
profile_extensions_labels 170
profile_extensions_layout 170
profile header image 156
profile_link 34
Profile Page 19, 47, 49
Profile Parameter 48
Profile Security 161
Q
Quick member select dropdown 270
quick_select 167
R
recent_alerts_text 71
recipients_label 241
Redirecting users from the admin dashboard 127
refresh 256
register 123
registered_label 165
registration_code 128
registration form 121, 157
Registration Form 124
Registration Form Shortcode Options 124
registration_url 124
reject_request_label 66, 166
reopen_label 89
Repeat as editable under replies? 196
replied 82
replies_count_label 83
reply_count_label 83
reply_icon 81
reply_preview 83
Required (text 196
reset 246
288

Reward Details (box) 178


Rewards 143, 173
Rewards: Creating/Editing 177, 179
Rewards for Likes/Dislikes 146
Rewards: User rewards 179
right 259
S
scrolling 191
search_label 167
secure_msg 80
secure_post_msg 84
security 161
select_activity_text 71
select_recipient 241
Send forum posts/replies to activity stream 213
Setting a registration code 128
share activity posts with Facebook 151
ShareThis 99
shortcode parameters 222
Shortcodes (for Group page) 224
show 76, 77, 90, 220, 241, 243, 261
show_allowed_types 186
show_author 96
show_by_default 165
show_closed 79
show_comment_form 84
show_comments 84
show_comments_count 79
show_count 79, 91, 184, 189
show_date 97, 165, 202, 221, 231
show_description 183, 189
show_forum 202
show_freshness 79, 91
show_friendship_status 165
show_header 79, 91
show_hidden_text 237
show_if_empty 158
Showing a Profile Extension 158
Showing forum extensions as a column on forums 197
show_last_active 64
289

show_last_activity 79, 92
show_location 164
show_owner 183, 185
show_posts 92
show_posts_header 92
show_registered 165
show_slideshow 185
show_snippet 97, 202
show_summary 93
show_user_login 167
show_with_results 168, 200
single_redirect 248
Site-wide chat room 255, 257
size 34, 57, 64, 65, 83, 176, 245
size_posts 83
size_replies 83
slideshow_hide_link 185
slideshow_link 185
slug 76, 77, 79, 88, 91, 94, 95, 101, 102, 158, 208, 258, 261
snippet_length 97, 202
SoundCloud 139
start_date_label 261
started 82
start_time_label 261
status 96, 202, 211, 230
Status 102
stick 39
sticky_label 41
sticky_others 41
style 70, 200, 208, 209
subscribe 208, 209
subscribed_msg 208, 209
subs_unsubscribe 211
subs_unsubscribe_ 211
suffix 258
summary 97
summary_avatar_size 98
summary_commented 98
Summary email 74
summary_format 97
290

summary_replied 98
summary_show_unread 98
summary_snippet_length 98
summary_started 97
summary_title_length 98
Support and Help 13
System Messages 129
T
Test WordPress email 74
Test WP Symposium Pro alert 74
text 36, 58, 155
textarea 155
textarea or URL)? 196
text_lostpassword_prompt 127
text_new_password 127
text_password_reset 127
text_pending 229
text_private 229
text_register_prompt 125, 127
text_username_not_found 127
theme 72
thumbnails 259
timeout 84
title_label 77, 220, 227, 241, 261
title_length 81, 93, 97
titles 259
today 259
to_label 241
town 54, 125
Town and Country shortcode options 55
town/city 23
Town/City and Country fields mandatory 126
town_label 24
translate 260
try_again_msg 50
Twitter 17
Type 155, 178
Type of reward to count 179
U
291

undislike_text 145
unlike_text 144
Unread mail messages icon 269
unsticky_label 41
unsubscribe 208, 209, 211
unsubscribed_msg 208, 209
update_button_label 186
updated 227
updated_ok 227
update_label 227, 261
upload images and documents to forum posts 193
Upload Plugin 12, 118
url 59, 60, 123, 167, 200
URL 155
url_preview_fail 141
url_preview_image 141
user_avatar_size 23
user_id 158, 182, 183, 189, 191, 247
user_link 231
Using shortcodes in theme page templates 265
V
value 59
Values (for list type only) 196
Video Tutorials 17
view_count_label 83
views_count_label 83
Visibility 102
W
Website link previews 139
What is WP Symposium Pro? 11
width 221, 225
WordPress filter 25
WordPress hook 25
wps_activity_post_add_hook 274
wps_api_insert_activity_post 273
wpspro_country 57
wpspro_home 57
wpspro_map 57
wps_usermeta_change_filter 58
292

wps_usermeta_change_hook 58
WP Symposium Pro Extensions 12
WP Symposium Pro Extensions Plugin 117
WYSIWYG 215
WYSIWYG Toolbar 216
Y
you_text 145
YouTube 138, 156, 252
Z
zoom 57

293

294

Note that some hooks/filters appear more than once, as they are
covered in more than one section of the book.

Hooks and Filters


Listed in alphabetical order
wps_activity_comment_meta_filter31
wps_activity_comment_meta_filter45
wps_activity_init_hook32
wps_activity_init_hook46
wps_activity_item_filter30
wps_activity_item_filter45
wps_activity_item_filter148
wps_activity_item_meta_filter30
wps_activity_item_meta_filter45
wps_activity_item_meta_filter148
wps_activity_item_recipients_filter148
wps_activity_item_settings_filter29
wps_activity_item_settings_filter44
wps_activity_items_filter28
wps_activity_items_filter43
wps_activity_new_comment_filter31
wps_activity_new_comment_filter46
wps_activity_post_comment_filter31
wps_activity_post_comment_filter46
wps_activity_post_post_form_filter38
wps_activity_post_pre_form_filter38
wps_activity_pre_filter28
wps_activity_pre_filter42
wps_activity_single_item_filter29
wps_activity_single_item_filter43
wps_calendar_post_pre_form_filter262
wps_directory_item_content_filter169
wps_display_name28
wps_forum_attachments_valid_document_extensions_filter194
wps_forum_attachments_valid_image_extensions_filter194
295

wps_forum_comment_pre_form_filter90
wps_forum_comment_pre_form_filter91
wps_forum_get_post_item99
wps_forum_item_content_filter87
wps_forum_item_sub_comment_filter87
wps_forum_name_filter93
wps_forum_post_comment_filter88
wps_forum_post_comment_filter88
wps_forum_post_delete_hook85
wps_forum_post_post_title_filter86
wps_friends_init68
wps_gallery_attachments_valid_document_extensions_filter187
wps_gallery_attachments_valid_image_extensions_filter187
wps_gallery_comment_meta_filter188
wps_group_item_filter222
wps_groups_post_filter223
wps_groups_pre_filter222
wps_mail_comment_add_hook244
wps_mail_comment_post_form_filter244
wps_mail_item_filter 
240
wps_mail_item_filter 
240
wps_mail_message_post_title_filter 
239
wps_mail_message_pre_filter 
239
wps_mail_post_add_hook243
wps_mail_post_comment_filter 
240
wps_mail_post_comment_filter 
240
wps_mail_post_item238
wps_mail_post_pre_form_filter 
242
wps_mail_textarea_pre_form_filter242
wps_my_group_item_filter223
wps_my_groups_post_filter223
wps_my_groups_pre_filter223
wps_usermeta_change_filter55
wps_usermeta_change_hook56
wps_usermeta_init61

296

Change Control
Most recent changes are listed here, to keep you up to date. As
changes are frequent, a complete list since the document was
started is not included.
0.45

Updated for 15.1 release.

0.44

Completed first set of coding examples

0.43

Added Activity to Facebook Chapter

0.42

Updated for 14.12.2 release.

0.41

Added Custom Forum Page

0.40

Added Calendars
Added shortcode function reference list

297

298

You might also like