Sei sulla pagina 1di 218

The Complete

Guide To
WP Symposium
Pro

From absolute
beginner to expert
WP Symposium Pro v14.12.2.e
Document version: 0.25
www.wpsymposiumpro.com
Simon Goodchild
1

Contents
What is WP Symposium Pro?
Getting WordPress
Getting WP Symposium Pro
WP Symposium Pro Extensions
Support and Help

9
9
10
10
11

Getting Started Quickly


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

Core Features

17

Profile Page
17
Quick Start
17
The Default Profile Page
18
[wps-activity-page]19
Shortcodes
30
[wps-display-name]31
[wps-avatar]32
[wps-avatar-link]33
[wps-activity-post]34
[wps-activity]36
Administration
45
Change Avatar Page
47
Quick Start
47
Shortcodes
48
[wps-avatar-change]48
3

Edit Profile Page


51
Quick Start
51
Shortcodes
52
[wps-usermeta-change]
52
[wps-usermeta]
54
[wps-usermeta-button]
56
[wps-usermeta-change-link]
56
[wps-close-account]
57
Administration59
Friends Page
61
Quick Start
61
Shortcodes
62
[wps-friends]62
[wps-friends-pending]63
[wps-friends-status]64
[wps-friends-add-button]
65
Administration
66
Alerts
67
Quick Start
67
Shortcodes
68
[wps-alerts-activity]68
Adding alerts to your theme
70
Administration
71
Forums
73
Quick Start
73
Shortcodes
74
[wps-forum-page]
74
[wps-forum-post]
75
[wps-forum]
76
[wps-forum-comment]84
[wps-forums]
87
[wps-forum-backto]90
[wps-forum-show-posts]91
Administration95
Building Your Own Profile Page

97

WP Symposium Pro Extensions Plugin

109

WP Symposium Pro Extensions Plugin


Getting the Extensions Plugin
Activating the Individual Extensions

111
111
112

Core Extensions

113

Custom Email Alerts


113
Administration113
Login and Redirect
[wps_login_form]
Login Form
Registration Form
Forgotten Password? Form
Redirecting users from the admin dashboard

115
115
117
118
120
121

System Messages

123

Menu Alerts

125

Activity Extensions

127

Choosing Activity Recipient(s)

127

Activity share lists

129

Activity attachments
131
Images
131
YouTube videos
132
SoundCloud133
Website link previews
133
Website link previews performance
135
Likes and Dislikes
Shortcode options
Rewards for Likes/Dislikes
Administration

137
138
140
140

Members Extensions

141

Profile Extensions
141
Creating Profile Extensions
142
Showing a Profile Extension
145
[wps-extended]146
Profile Security
Areas of security
Levels of security

147
148
148

Member Directory
Quick Start
Shortcodes
[wps-directory]
[wps-directory-search]
Adding Profile Extensions to the Directory

149
149
150
150
153
155

Default Friends

157

Rewards
159
Quick Start
159
Shortcodes
162
[wps-reward]162
[wps-badge]162
[wps-rewards]163
Administration
163
Image Galleries
167
Quick Start
167
Shortcodes
168
[wps-gallery]168
[wps-gallery-list]
175
[wps-gallery-grid]
176
Administration
178

Groups Extensions

181

Groups181
Quick Start
181
Shortcodes (for Groups page)
182
[wps-group-create]182
6

[wps-groups]183
[wps-my-groups]
185
Shortcodes (for Group page)
186
[wps-group-title]
187
[wps-group-image]
187
[wps-group-description]
187
[wps-group-admin]188
[wps-group-edit]188
[wps-group-delete]190
[wps-group-join-button]190
[wps-group-post]191
[wps-group-activity]191
[wps-group-members]192
[wps-group-id]193
[wps-group-url]193
Administration
194
Default Groups

195

Core Functions (API)

199

Accessing the API

199

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

199
199
200

Index203
Hooks and Filters

216

Change Control

218

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
9

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 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!
10

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 support staff online at http://www.
wpsymposiumpro.com who will be happy to chat!
11

12

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).
13

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!
14

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
15

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

16

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
17

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:





18

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
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.
19

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.

20

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
map_size
Default: 150,150

map_style
Default: static

Sets the size, as a square, of the users


avatar in pixels.
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).
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.
21

town_label
Default: Town/City
country_label
Default: Country

Change the label shown for the users town/


city. Can be anything, even office if your
social network is in a company, for example.
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
mimic_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.
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-wordpress-hooks
http://www.smashingmagazine.com/2011/10/07/definitiveguide-wordpress-hooks
https://www.tipsandtricks-hq.com/wordpress-action-hooksand-filter-hooks-an-introduction-4163
22

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

23

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:
24

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!

25

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
26

$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.
27

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

28

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) {

29

$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.
30

[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
link
Default: true
before/after

Set this to the ID of a WordPress user and


their display name will always be shown.
If set to true, i.e. link="1", the display name
will also be a link to that users profile page.
Prepend and append HTML to the output.

Default: false
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
31

[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
change_link
Default: false
profile_link
Default: true
user_id
Default: false
before/after

Sets the size, as a square, of the users


avatar in pixels.
Whether a link is shown over the top of the
users gravatar to let them change it. See
[wps-avatar-change] for more information.
If set to true, the avatar, if not the current
user, will be a link to that users profile page.
If set to a WordPress users ID, will force the
avatar to show that users avatar.
Prepend and append HTML to the output.

Default: false
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>"]

32

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.

33

Shortcode Options
text
Default: string
before/after

The text for the link, defaults to Change


Picture.
Prepend and append HTML to the output.

Default: false
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:

34

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
label
Default: string
private_msg
Default: string
account_closed_
msg
Default: string
user_id
Default: false

An optional class that can be passed that is


added to the Add Post button for styling.
The label that appears on the Add Post
button.
The text that is shown if a member is viewing
another members profile page, but is not a
friend, and therefore cannot post.
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.
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

Prepend and append HTML to the output.

Default: false
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"]

35

Hooks and Filters


There is only one filter available for [wps-activity-post].
wps_activity_post_pre_forum_filter
Filter
before 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.
For example, you can see other friends activity.
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.
Users can also choose to make a post stick to the top of their
activity stream, perhaps because its particularly important. This is
36

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
comment_avatar_
size

The size of avatars shown beside an activity


post.
The size of avatars shown beside an activity
post comment.

Default: 40
count
Default: 100

The maximum number of activity posts


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

37

get_max
Default: 100
more
Default: 50

The maximum number of posts returned


from the database, allowing that some may
not be shown due to permissions.
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
hide_until_loaded
Default: false

comment_size
Default: 5
comment_size_
text_singular
comment_size_
text_plural

The text shown in conjunction with the more


option.
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.
Maximum number of most recent comments
shown below a post, to avoid screen
overload.
Text shown if there is 1 previous comment
which can be viewed, or more than 1 (the
plural version0.

Default: string
label

The label on the button to add a comment.

Default: string
class
Default: string

38

An optional class for the button to add a


comment.

link
Default: true
delete_label

Whether to link to the users profile page. set


to 0 to disable.
Text for delete in settings icon.

Default: string
sticky_label

Text for sticky in settings icon.

Default: string
unsticky_label

Text to un-stick a post in settings icon.

Default: string
hide_label
Default: string
allow_replies
Default: true
date_format
Default: %s ago
include_self
Default: true
include_friends

Text to hide another members post (not all


posts of that member, just that post).
Set to 0 to disable comments on activity
posts.
%s is replaced by how old the post is in
minutes, hours, etc. Quick way to translate
text.
Whether to include only posts from current
user.
Whether to include posts from friends.

Default: true
post_id
Default: false
user_id
Default: false

Can be used to view a single post and its


comments. Normally only used in links from
alerts sent out.
If set the activity will be for the user, using
the WordPress user ID.

39

mimic_user_id
Default: false
private_msg
Default: string
not_found

If set will view the activity as though you


were that user, really on used for admin
purposes.
The text shown if the activity is private and
cannot be seen.

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

Prepend and append HTML to the output.

Default: false
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:
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;
}

40

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):
$the_post = get_post(2);
$a['ID'] = $the_post->ID;
$a['date'] = $the_post->post_date;
$a['sticky'] = 0;
endif;

41

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) {
$a .= 'HERE';
return $a;
}

wps_activity_item_meta_filter
Filter
after an activity items meta information
42

$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
$b
$c
$d

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)
43

$e
$f

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.
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
44

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.
If you manually created the WordPress pages, you should set the
pages as applicable.
45

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.

46

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.
47

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.
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

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

Default: string
file_types_msg
Default: string
not_permitted
Default: string
label
Default: string

48

The message informing the users what files


they can upload. Defaults to Please upload
an image file (.jpeg, .gif, .png)..
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..
The word(s) on the upload button. Defaults to
Upload.

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.
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 s 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:

49

50

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.

51

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: ''
label

An optional class that is applied to the


submit button.
The label that shows on the submit button.

Default: string
town

The label shown above the town/city field.

Default: string
country

The label shown above the country field.

Default: string
display_name
Default: string
password
Default: string
password2
Default: string

52

The label shown above the field for the users


display name, the name shown across the
social network.
The label shown above the field that allows
the user to change their password.
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.

password_msg
Default: string
email

The text shown after the user has changed


their password.
The label shown above the email field.

Default: string
user_id

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.

Default: false
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.

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

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;
}

53

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 above, 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]
With this shortcode, you can display any "user meta" field that has
been entered. You will need to use it with the shortcode options.
user_id
Default: false
label
Default: ''

Shortcode Options
54

Set to a WordPress user ID to over-ride the


currently logged in user.
An optional label shown before the value.
The label is enclosed within a SPAN with a
class of wps_usermeta_label.

before/after

Prepend and append HTML to the output.

Default: false
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.

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
55

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

The text of the link.

Default: string
user_id
Default: false
before/after

Set to a WordPress user ID to over-ride the


currently logged in user.
Prepend and append HTML to the output.

Default: false

[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
url
Default: ''
56

Set to a WordPress user ID to over-ride the


currently logged in user.
The URL that the user will go to when
clicking on the button. user_id=x is
automatically appended to the end.

value

The label on the button

Default: string
class
Default: ''
before/after

An optional class that is applied to the


button.
Prepend and append HTML to the output.

Default: false
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.

[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.

57

Shortcode Options
are_you_sure_text

The "are you sure?" text.

Default: string
logout_text

The "Your account has been closed." text.

Default: string
label

The label on the button

Default: string
class
Default: ''
url
Default: '/'
before/after

An optional class that is applied to the


button.
A URL that the user is taken after closing
their account, by default the root of the site.
Prepend and append HTML to the output.

Default: false

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'));

58

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.
You can also replace their avatar (perhaps their chosen one wasn't
suitable!).

59

60

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.
61

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
count

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

Default: 10

How many friends are shown. They are


shown in the order of when the last logged
in.

size

Size of the member's avatar.

Default: 64
link
Default: true
show_last_active
Default: true
last_active_text

Whether the user's display name is a link to


their profile page. Set to "0" to disable.
Whether to show when the user was last
active, set to "0" to hide.
Text for when they were last active.

Default: string
last_active_format

Format of when they were last active.

Default: "%s ago"


private
Default: string
62

Text if this information is private.

none

The text if this user has no friends.

Default: string
layout

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


'fluid' which is more like a grid.

Default: 'list'
before/after

Prepend and append HTML to the output.

Default: false
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
count

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.

Default: 10

How many friends are shown. They are


shown in the order of when the last logged
in.

size

Size of the member's avatar.

Default: 64
63

link

Whether the user's display name is a link to


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

Default: true
class

Optional class for buttons.

Default: ''
accept_request_
label

Text for the "Accept" button.

Default: string
reject_request_label Text for the "Reject" button.
Default: string
none

Text shown if no pending requests, whilst ''


no text is shown.

Default: ''
before/after

Prepend and append HTML to the output.

Default: false
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
friends_yes
Default: string
64

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.
Text if friends.

friends_pending

Text if friendship is pending.

Default: string
friend_request
Default: string
friends_no

Text if the currently logged in user has a


pending friendship request from this user.
Text if not friends.

Default: string
before/after

Prepend and append HTML to the output.

Default: false
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
label

Over-ride the current user with a WordPress


user ID, to show friends of that user perhaps.
Label for the button to make friends.

Default: string
cancel_label

Label to cancel the friendship.

Default: string

65

cancel_request_
label

Label to cancel a friendship request.

Default: string
class

Optional class for the button.

Default: ''
before/after

Prepend and append HTML to the output.

Default: false
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.

66

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
67

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:
flag_size

Size of the icon.

Default: 24
flag_unread_size
Default: 10
flag_unread_top
Default: 6
flag_unread_left
Default: 8

68

Size of the unread


bubble.
Top offset for the
bubble in pixels.
Left offset for the
bubble in pixels.

flag_unread_radius
Default: 8
flag_url
Default: ''
Mandatory
flag_src
Default: ''
recent_alerts_text

Radius of the corners


of the unread bubble.
The URL that the user
goes to when clicking,
probably a page with
[wps-alerts-activity
style="list"] shortcode
on it.
Optional URL of an
image to replace the
default icon.

Text for "Recent alerts..."

Default: string
no_activity_text

Text for "No activity alerts"

Default: string
select_activity_text
Default: string

make_all_read_text

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.
Text for "Mark all as read"

Default: string
delete_all_text

Text for "Delete all"

Default: string
date_format

Format of the age of the alert.

Default: "%s ago"


before/after

Prepend and append HTML to the output.

Default: false
69

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('');
?>

70

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.

71

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.

72

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:

73

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

show
Default: false
header_title

This is mandatory, and must match the


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

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


topic by default.
By default, set to "Topic".

Default: string
header_count

By default, set to "Replies".

Default: string
header_last_activity
Default: string
74

By default, set to "Last activity".

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

show
Default: false
class
Default: ''
title_label

This is mandatory, and must match the


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

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


topic by default.
An optional class added to the submit button
to allow you to further style the button.
By default, set to "Post title".

Default: string
75

content_label

By default, set to "Post".

Default: string
label
Default: string
moderate
Default: false
moderate_msg
Default: string
locked_msg
Default: string
private_msg
Default: ''
before/after

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


on the submit button.
If set to 1 (true), all posts and comments
must be approved by a site administrator via
the admin dashboard before it is displayed.
By default, set to "Your post will appear once
it has been moderated.".
By default, set to "This forum is locked. New
posts and replies are not allowed.".
The text saying the the forum is private (the
user doesn't have permission to view).
Prepend and append HTML to the output.

Default: false
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.
76

Shortcode Options (when viewing forum topics)


slug
Default: none

closed_switch

This is mandatory, and must match the


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

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

Defaults to " Include closed posts".

Default: string
show_header
Default: true
show_closed
Default: true
show_count
Default: true
show_freshness
Default: true
show_last_activity
Default: true
show_comments_
count

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


columns.
Set to 0 (false) to not show closed forum
posts.
Set to 0 (false) to not show the count
column.
Set to 0 (false) to not show how "fresh" the
forum post is.
Set to 0 (false) to not show the last activity
column.
Set to 0 (false) to not show the count of
replies to a forum post.

Default: true
77

private_msg
Default: string
login_url
Default: ''
secure_msg
Default: string
empty_msg

Defaults to "You must be logged in to view


this forum.".
If set, any links to login will be set to this
URL.
Defaults to "You do not have permission to
view this forum.".
Defaults to "No forum posts.".

Default: string
pending
Default: string
comment_pending
Default: string
closed_prefix
Default: string
header_title

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


added around it.
Defaults to "pending" and has "(" and ")"
added around it.
Prefix for closed forum posts, defaults to
"closed".
Defaults to "Topic".

Default: string
header_count

Defaults to "Replies".

Default: string
header_last_activity

Defaults to "Last activity".

Default: string
moved_to
Default: string

78

Text displayed when a topic is moved


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

date_format
Default: string
count
Default: -1
reply_icon
Default: true
title_length

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


the age of the forum post.
Maximum number of forum posts to show, -1
means no limit.
Set to 0 (false) to hide the icon indicating that
the user has replied to a forum post.
Make length of the post title, in characters.

Default: 50
base_date
Default: post_date_
gmt
before/after

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).
Prepend and append HTML to the output.

Default: false
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"]

Shortcode Options (when viewing a forum post)


size
Default: 96
pagination
Default: true

Size of the avatar for the initial post and


subsequent replies when viewing a topic.
Set to 0 (false) to switch off pagination for
the forum.

79

pagination_top
Default: true
pagination_bottom
Default: true
page_size
Default: 10
page_x_of_y

Set to 0 (false) to switch off pagination pages


at the top of the forum.
Set to 0 (false) to switch off pagination pages
at the bottom of the forum.
How many posts should appear on one
page.
Defaults to "Showing page %d of %d".

Default: string
post_deleted

Defaults to "Post deleted.".

Default: string
secure_post_msg
Default: string
timeout
Default: 120
show_comments
Default: true
show_comment_
form
Default: true
allow_comments
Default: true

Defaults to "You do not have permission to


view this post.".
How many seconds before the forum post is
locked for editing.
Set to 0 (false) to hide all replies made to
a post. This uses the term comments for
legacy reasons.
Set to 0 (false) to hide the reply text area
by default. This uses the term comment for
legacy reasons.
Set to 0 (false) to remove the ability to
comment on a reply.

comment_add_label Defaults to "Add comment".


Default: string
80

comment_class
Default: ''
comments_avatar_
size

Optional class added to the comment submit


button.
Size of the avatar beside comments.

Default: 48
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
81

$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;
}

82

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;
}

83

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

84

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

String shown above the text area.

Default: string
label

Label for the submit button.

Default: string
moderate_msg
Default: string
locked_msg
Default: string
private_msg

Defaults to "Your post will appear once it has


been moderated.".
Defaults to "This forum is locked. New posts
and replies are not allowed.".
Text shown if the forum post is private.

Default: ''
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
close_msg

Defaults to "Your comment will appear once


it has been moderated".
Defaults to "Tick to close this post".

Default: string
comments_closed_
msg

Defaults to "This post is closed.".

Default: true
reopen_label

Defaults to "Re-open this post".

Default: string
85

allow_private
Default: true
private_msg
Default: string
class

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.
Defaults to "Only share reply with %s", with
%s replaced by the original post author.
Optional class added to the submit button.

Default: ''
show

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


default.

Default: true
before/after

Prepend and append HTML to the output.

Default: false
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;
}

86

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

show_header
Default: true
show_count

Optionally, set the slug to a forum (as shown


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

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


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

Default: true
show_freshness
Default: true

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


post is.
87

show_last_activity
Default: true
forum_title

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


activity post.
Defaults to "Forum".

Default: string
forum_count

Defaults to "Count".

Default: string
forum_freshness

Defaults to "Freshness".

Default: string
forum_last_activity

Defaults to "Last Poster".

Default: string
base_date
Default: post_date_
gmt
no_indent

You can, if you prefer, set this to post_date


(so it doesn't refer to GMT).
Set to 0 (false) to indent the forum headings.

Default: true
level_0_links
Default: true
before/after

Set to 0 (false) to remove the hyperlinks from


the forum headings.
Prepend and append HTML to the output.

Default: false

The following relate 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
88

show_posts

How many posts to show from the forum.

Default: 0
show_summary
Default: 0
count_include_
replies

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


and last activity values.
Set to 0 (false) to exclude replies from the
forum counts.

Default: true
title_length

Maximum number of characters shown from


the topic post title.

Default: 50
header_title

Defaults to "Topic".

Default: string
header_count

Defaults to "Replies".

Default: string
header_last_activity

Defaults to "Last activity".

Default: string
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
89

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

90

This is mandatory, and must match the


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

label

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


replaced by the forum name.

Default: string
before/after

Prepend and append HTML to the output.

Default: false
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.

91

order
Default: date
orderby
Default: DESC
max

Which field is used to retrive the posts. Valid


options are date, date_gmt, author, title,
content or name (the post slug).
Set to DESC (descending and the default) or
ASC (ascending).
Maximum number of posts displayed.

Default: 10
status
Default: ''
include_posts

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


both.
Set to 0 (false) to exclude posts.

Default: true
include_replies

Set to 0 (false) to exclude replies.

Default: true
include_comments
Default: false
include_closed
Default: true
closed_prefix
Default: string
show_author

Set to 1 (true) to include comments on


replies.
Set to 0 (false) to excude closed forum posts.
A preferred alternative to using status.
Text that is prepended to a forum post topic
if closed, defaults to "closed".
Set to 0 (false) to hide the post author.

Default: true
author_format
Default: string

92

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


the post author.

author_link
Default: true
show_date

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


author's profile page.
Set to 0 (false) to hide the post date.

Default: true
date_format

Defaults to "%s ago".

Default: string
show_snippet

Set to 0 (false) to hide the snippet.

Default: true
title_length
Default: 50
snippet_length
Default: 30
base_date
Default: post_date_
gmt
before/after

Maximum number of characters included in


the forum topic title.
Maximum number of characters included in
the snippet.
You can, if you prefer, set this to post_date
(so it doesn't refer to GMT).

Prepend and append HTML to the output.

Default: false
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".
93

summary_replied

Defaults to "replied to".

Default: string
summary_
commented

Defaults to "commented on".

Default: string
summary_title_
length

Maximum number of characters


included in the forum topic title.

Default: 150
summary_
snippet_length

Maximum number of characters


included in the snippet.

Default: 50
summary_avatar_
size

Size of the avatar in pixels.

Default: 32
summary_show_
unread

Set to 0 (false) to exclude read forum


posts, if user is logged in.

Default: true
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):

94

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:

Administration
There are two areas on the WordPress admin dashboard related to
forum administration.
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
95

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.

96

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:

97

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]

98

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,
99

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
padding
border-radius
background-color
overflow

15 pixels (px)
top and right 6px, bottom 0px, left 12px
3 pixel (px) radius
#CCCCFF
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
100

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:

101

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:

102

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.
103

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.
104

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.
105

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.
106

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

107

108

WP Symposium Pro
Extensions Plugin

109

110

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.
111

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.

112

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.
113

HTML added to top of alert


<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:

114

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:
115

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.
116

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

The login label, defaults to "Log In".

Default: string
label_username

Text for "Username".

Default: string
label_register

Label for the "Register" button.

Default: string
label_lostpassword

Label for the "Forgotten password?" button.

Default: string
register

Set to "0" to hide the registration button.

Default: 1
lost_password
Default: 1
captcha

Set to "0" to hide the forgotten password


button.
Set to "0" to hide the CAPTCHA code.

Default: 1
text_password_
closed
Default: string

Text for " This account was closed".

117

before/after

Prepend and append HTML to the output.

Default: false
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
registration_url

Set to 'register' to show the registration


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

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

Text for "Username".

Default: string
label_email

Text for "Email address".

Default: string
label_password

Text for "Password".

Default: string
label_password_
confirm
Default: string
118

Text for "Re-enter password".

town
Default: Town/City
country
Default: Country
password
Default: false
label_name

Prefix with a "*" to make mandatory, for


example: town="*City"
Prefix with a "*" to make mandatory, for
example: town="*Country"
Set to "1" to allow user's to enter their own
password.
Text for "Your first name and family name".

Default: false
name
Default: true
display_name
Default: false
nickname
Default: false
mandatory

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


name fields.
Set to "1" to allow user's to set their display
name on registration. Can always be
changed via the Edit Profile page.
Set to "1" to allow user's to set their
WordPress nickname. This field is not used
by WP Symposium Pro.

Default: string

The text shown after mandatory fields.


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

text_register_
prompt

The text for " A password will be sent to the


email address you enter."

Default: string
label_back_to_login
Default: false
text_register_
prompt

Text for the link that goes back to the login


form.
Text for "A password will be sent to the email
address you enter."

Default: string
119

before/after

Prepend and append HTML to the output.

Default: false
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

120

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

The text for "Your password has been reset


and sent to the email address..."

Default: string
text_register_
prompt

The text for "A password will be sent to the


email address you enter."

Default: string
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
121

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.

122

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.

123

124

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:

125

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.

126

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:

127

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.

128

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.

129

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.

130

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
131

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.
132

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.

Images with the word "adserver" in the URL are ignored.


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.
Active via WPS Pro->Setup underneath "Activity".

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

url_preview_image
Default: 100
url_preview_fail
Default: true
fail_text
Default: string
fail_image
Default: string
ignore_images
Default: ''

Size of the preview image, set to 0 to


disable, which will improve performance (as
not searched for/fetched from the URL).
Set to 0 (false) to not show the preview if the
remove site cannot be connected to.
The text shown as the description if the site
cannot be connected to. Can be set to "" to
not show a message.
The URL of an image to use, if no image can
be retrieved from the site (no image or due to
ignore_images list).
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: ''

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"

max_previews
Default: 1

134

To get the details for the preview, your server


has to fetch the information and the first
image. If there are lots of links to generate
previews for, this can add load to your server
and increase the time it takes for the activity
to load.You can control this by setting
max_previews to the maximum number of
previews that you want to generate.
Use a smaller value to reduce server load
and increase page load speed. A larger
number will have the opposite affect but
display more previews.

min_width
Default: 200
max_width
Default: 1000

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.
Maximum width of image to show, or 0
to ignore. Can be used to avoid sending
large images to the browser for better
performance.

Website link previews


performance
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 all the images
and determines if it is to be shown, based on max_previews, ignore_
images, min_width and max_width.
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.
So be aware that 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 decreased.
You can improve this in two ways. The first is to improve your
server's power and internet connection speed.
The second is by reducing the shortcode paramters as follows:
max_previews
min_width
ignore_images

1 (only show first preview link)


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

On www.wpsymposiumpro.com, the following options are used:


[wps-activity max_previews="1" min_width="300" ignore_
images="adserver,adchoice"]

135

136

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:

137

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
allow_undislikes
Default: true
like_text

Set to 0 (false) to remove the ability to


remove likes.
Set to 0 (false) to remove the ability to
remove dislikes.
Defaults to "Like".

Default: string
unlike_text

Defaults to "Unlike".

Default: string
like_count_text_
singular

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


1.

Default: string
like_count_text_
plural

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


the number if 2 or more.

Default: string
dislike_text
Default: string

138

Defaults to "Dislike".

undislike_text

Defaults to "Undislike".

Default: string
dislike_count_text_
singular

Defaults to "%d distlike" with %d replaced


with 1.

Default: string
dislike_count_text_
plural

Defaults to "%d dislikes" with %d replaced


with the number if 2 or more.

Default: string
more_text_singular
Default: string
more_text_plural
Default: string
done_text
Default: string
by_text

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


replaced with 1.
Defaults to "and %d more..." with %d
replaced with 2 or more.
Defaults to "Done!" (shown after clicking on
Like or Dislike).
Defaults to " by ".

Default: string
or_text

Defaults to " or ".

Default: string
you_text

Defaults to "you".

Default: string
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.

139

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"]

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).

140

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.
141

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, choose that menu item and you will be
presented with a list of current extensions (none to start with). Click
on the "Add New" button to add a profile extension.

To create a profile extension, you would go through the following


steps.
142

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.
143

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.

YouTube

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
144

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).
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.
145

[wps-extended]
Displays a profile extension.

Shortcode Options
slug
Default: none
user_id
Default: false
show_if_empty
Default: true
empty_text
Default: ''
label_prefix
Default: false
before/after

This is mandatory, and must match the


slug as displayed via WPS Pro->Profile
Extensions.
Set to the ID of a WordPress user to display
the profile extension for that user.
Set to 0 (false) to hide if no value has been
entered.
Text shown if the field is empty, and the type
of field is applicable.
Set to 1 (true) to add the title of the profile
extension before the value.
Prepend and append HTML to the output.

Default: false
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:

146

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:

147

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.

148

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]

149

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

Shortcode Options
order
Default: last_active
order_by
Default: DESC
no_results_msg

The order in which the members are


displayed, can be last_active, user_
registered or any field from the WordPress
users table.
Can be ASC (ascending) or DESC
(descending).
Defaults to "No users found.".

Default: string
number

Maximum number of members displayed.

Default: 50
limit
Default: false

Optionally set to a value to limit the number


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

avatar_size

The size of the member's avatar in pixelst.

Default: 64
link
Default: true
show_location
Default: true

150

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


user's profile page.
Set to 0 (false) to hide the user's location (as
entered via their Edit Profile page).

show_date
Default: true
date_label

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


active.
Defaults to "Last active".

Default: string
last_active_format
Default: string
show_by_default
Default: true
show_friendship_
status
Default: true
friends_yes

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


by when they were last active.
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.
Set to 0 (false) to hide the friendship status
between the member of the directory and the
currently logged in user.
Defaults to "You are friends".

Default: string
friends_pending
Default: string
friend_request

Defaults to "You have requested to be


friends".
Defaults to "You have a friends request".

Default: string
friends_no

Defaults to "You are not friends".

Default: string
show_registered
Default: true
registered_label

Set to 0 (false) to hide when the user


registered with the site.
Defaults to "Joined".

Default: string
151

layout
Default: list
include_friendship_
action

To display the directory in a more grid-like


fashion, set to fluid.
Set to 9 (false) to hide the button to make a
friendship request, cancel, etc.

Default: true
friendship_class
Default: ''
friend_add_label

An optional class added to the friendship


action buttons.
Defaults to "Make friends".

Default: string
friend_cancel_label

Defaults to "Cancel friendship".

Default: string
accept_request_
label

Defaults to "Accept friendship request".

Default: string
reject_request_label Defaults to "Reject".
Default: string
include_self
Default: false
before/after

Set to 1 (true) to include the currently logged


in user in the member directory.
Prepend and append HTML to the output.

Default: false
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"]

152

[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: ''
url
Default: ''
mode
Default: text

An optional class added to the search submit


button.
A URL that the search term is sent to, leave
along if search form is on same page as the
directory.
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
placeholder

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


beside their display name.
Defaults to "Enter part of a name...".

Default: string
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

Defaults to "Member search".

Default: string
153

label

Label for the button, defaults to "Search".

Default: string
show_with_results
Default: true
private

Set to 0 (false) to hide after displaying the


results.
Set to 0 (false) to only show if the user has
logged in to the site.

Default: false
private_msg

Defaults to "You need to login first.".

Default: string
include_meta_show
Default: false

Set to 1 (true) to show the advanced search


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

before/after

Prepend and append HTML to the output.

Default: false
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.

Hooks and Filters


wps_directory_item_content_filter
Filter
after the user meta information.
$a
154

HTML generated so far

$b
$c

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: ''
profile_extensions_
layout
Default: ''
profile_extensions_
labels
Default: ''

Comma seperated list of profile extensions


to show.
Comma seperated list of either 'left', '' to
float the labels accordingly. Count of values
must match count of profile_extensions
option.
Whether or not to show the profile extension
label (title). Count of values must match
count of profile_extensions option.
155

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:

156

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.

157

158

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
159

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:
160

<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.

161

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

Prepend and append HTML to the output.

Default: false

[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
opacity
Default: 20
size
Default: false
162

This is mandatory and must be set to the


value of a reward slug.
How transparent the badge is, if the
associated activity has not been done, as a
percentage.
If not set, the size of the badge is as set
when creating the reward, but you can override this by setting this option.

before/after

Prepend and append HTML to the output.

Default: false

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

Shortcode Options
count
Default: 10
days

Number of users to show. For example, for a


"top 50" set count to 50.

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

Size of the user's avatar in pixels.

Default: 32
link
Default: true
before/after

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


user's profile page.
Prepend and append HTML to the output.

Default: false

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
163

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

164

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].

165

166

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.
167

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

Shown if no permission, defaults to ''.

Default: string
edit_prompt_text
Default: string
before/after

Defaults to "Click the title to add a


description and/or add items...".
Prepend and append HTML to the output.

Default: false

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.

168

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

Optional class added to the edit and cancel


buttons.

Default: ''
empty_gallery

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

Default: string
create_placeholder

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

Default: string
create_label

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

Default: string
create_button_label

Defaults to "Create".

Default: string
cancel_button_label Defaults to "Cancel".
Default: string
edit_prompt_text
Default: string
featured_image_
size

Defaults to "Click the title to add a


description and/or add items...".
Size in pixels of the featured image, as a
square.

Default: 150
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

Set to 0 (false) to hide the description.

Default: true
169

show_count

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


inside each gallery.

Default: true
count

Maximum number of galleries to show.

Default: 100
orderby

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

Default: 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.

170

class
Default: false
edit_and_cancel_
class

Optional class for the comment submit


button.
Optional class for the buttons when editing
the gallery's description.t

Default: false
show_slideshow
Default: false
slideshow_link

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


show as default.
Defaults to "View slideshow".

Default: string
slideshow_hide_link Defaults to "Close slideshow".
Default: string
no_permission_text
Default: ''
edit_text

Text shown if permission not valid to see the


gallery.
Defaults to "Edit description".

Default: string
delete_text

Defaults to "Delete".

Default: string
item_size
Default: 150
show_owner

Size of the image thumbnails (as a square, in


pixels).

Default: string

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


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

back_to

Defaults to "Back to Albums".

Default: string
171

add_text

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

Default: string
button_label

Defaults to "Upload".

Default: string
cancel_button_label Defaults to "Cancel".
Default: string
update_button_
label

Defaults to "Update".

Default: string
edit_prompt_
content

Defaults to "Enter a description...".

Default: string
show_allowed_
types
Default: string
allowed_image_
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.
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
172

Size of user avatar's beside comments in


pixels, as a square.

comment_label

Defaults to "Add Comment".

Default: string
link

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


page of the user who has added a comment.

Default: true
date_format
Default: 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
173

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, $format='Last active:
%s ago');
return $a;
}

174

[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
featured_image_
size

Set to a WordPress user ID to limit the


galleries to that user.
Size of the featured image, as a square, in
pixels.

Default: 75
show_description
Default: true
no_permission_text
Default: ''
no_albums

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


if user's are tending not to edit their gallery
descriptions.
Text shown if permission is not adequate,
only applicable if user_id is not set to "all".
Defaults to "No albums to view.".

Default: string
edit_prompt_text
Default: string
show_count
Default: false
count

Defaults to "Click the title to add a


description and/or add items...".
Set to 1 (true) to show the number of items in
each gallery album.
Maximum to show.

Default: 30
more
Default: string

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


the gallery page for that album.

175

more_top_
adjustment

Top offset in pixels for fine-tuning the


position of the more link.

Default: 0
more_left_
adjustment

Left offset in pixels for fine-tuning the


position of the more link.

Default: 0
orderby

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

Default: updated
before/after

Prepend and append HTML to the output.

Default: false
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.

176

Shortcode Options
user_id
Default: all
featured_image_
size

Set to a WordPress user ID to limit the


galleries to that user.
Size of the featured image, as a square, in
pixels.

Default: 75
no_permission_text
Default: ''
no_albums

Text shown if permission is not adequate,


only applicable if user_id is not set to "all".
Defaults to "No albums to view.".

Default: string
count

Maximum to show.

Default: 30
more
Default: string
more_top_
adjustment

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


gallery page for that album.
Top offset in pixels for fine-tuning the
position of the more link.

Default: 10
more_left_
adjustment

Left offset in pixels for fine-tuning the


position of the more link.

Default: 0
orderby

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

Default: updated
scrolling
Default: true

Set to 0 (false) to disable horizontal scrolling,


and show all in one grid.

177

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.

178

179

180

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.
181

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.
Shortcodes (for Groups 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: ''
show

Optional class to add to the button


displayed.

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

Defaults to "Create Group".

Default: string
title_label
Default: string
182

Defaults to "Enter a group name".

content_label

Defaults to "Enter a brief description".

Default: string
before/after

Prepend and append HTML to the output.

Default: false

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

Shortcode Options
header_text

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

Default: string
no_results_msg

Defaults to "No groups found.".

Default: string
link
Default: true
show_date
Default: true
date_label
Default: string
width
Default: 64
order_by
Default: active
order
Default: DESC

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


group's page.
Set to 0 (false) to hide how long since the
group was last active.
Defaults to "Last active %s ago" where %s
is replaced with how long since the group
was last active.
Size of the group's featured image, as set y
the group admin. Set to 0 to hide.
Set to active (last activity), title (name of
group) or created (when the group was
created).
Set to ASC (ascending) or DESC
(descending).

183

before/after

Prepend and append HTML to the output.

Default: false

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;
}

184

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
185

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:

186

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

Prepend and append HTML to the output.

Default: false

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

Shortcode Options
width
Default: 200
before/after

Width of the image shown. The height is


displayed proportionately.
Prepend and append HTML to the output.

Default: false

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

Shortcode Options
before/after

Prepend and append HTML to the output.

Default: false

[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
before/after

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


name without a link to their profile page.
Prepend and append HTML to the output.

Default: false

[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
188

Defaults to "Edit this group".

updated

Defaults to "Group details updated.".

Default: string
updated_ok

Defaults to "Refresh page...".

Default: string
before/after

Prepend and append HTML to the output.

Default: false
The following are used when editing a group.
class

Optional class for the update button.

Default: ''
title_label

Defaults to "Group title".

Default: string
content_label

Defaults to "Description".

Default: string
cancel_label

Defaults to "Cancel".

Default: string
update_label
Default: string
private_label
Default: string
image_label

Defaults to "Update Group", used on the


submit button.
Defaults to "Set group as private (join
requests will need to be approved)".
Defaults to "Upload group image".

Default: string
image_remove_
label
Default: string

Defaults to "Remove group image".


189

[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

Defaults to "Delete this group".

Default: string
before/after

Prepend and append HTML to the output.

Default: false

[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: ''
label_join

An optional class added to the button for


styling purposes.
Defaults to "Join this group".

Default: string
label_leave
Default: string

190

Defaults to "Leave this group".

label_cancel

Defaults to "Cancel request".

Default: string
text_pending
Default: string
text_private
Default: string
before/after

Defaults to "Your request to join this group is


pending.".
Defaults to "Your request will need to be
approved.".
Prepend and append HTML to the output.

Default: false

[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
before
Default: string
after
Default: string

What is shown if user is not a member of the


group. Defaults to "".
Defaults to '<div style="clear:both">' to
support the usual layout of the page, works
with the value for after.
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.".
191

back_to
Default: string
before/after

Defaults to "Back to %s...", with %s


replaced with the group name.
Prepend and append HTML to the output.

Default: false
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

192

Optional class added to the buttons


displayed.
Can also be set to pending (just those
requiring group administraor approval) or
member (just those who are members).
What is shown if user is not a member of the
group. Defaults to "".
Use avatar size, in pixels.

show_date
Default: true
date_label

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


active.
Defaults to "Last active:".

Default: string
date_format
Default: string
user_link
Default: true
before/after

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


how long ago they were active.
Set to 0 (false) to remove the link to the
user's profile page.
Prepend and append HTML to the output.

Default: false

[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.

193

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!

194

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:

195

196

197

198

Core Functions (API)


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:
require_once(path/to/plugins/wp-symposium-pro/core_api.php);

API Functions
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
$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.
$_FILES of any other fields to be used via
wps_activity_post_add_hook filter.

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
199

friends) you would use the following:


wps_api_insert_activity_post('The post', 99, 99);

To pass $_POST and $_FILES if you have information within, 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 as
above.

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");

200

201

202

Index
Shortcodes
[wps-activity] 36, 133, 138
[wps-activity-page] 18, 19
[wps-activity-post] 34
[wps-alerts-activity] 68
[wps-avatar] 30
[wps-avatar-change] 48, 52, 62, 63, 64, 65, 68
[wps-avatar-link] 33, 34
[wps-badge] 162
[wps-close-account] 57
[wps-directory] 150
[wps-directory-search] 153
[wps-forum] 76, 84, 87
[wps-forum-comment] 84, 87
[wps-forum-page] 74
[wps-friends] 62, 63, 64, 65, 68
[wps-friends-add-button] 65
[wps-friends-pending] 63, 64, 65
[wps-friends-status] 64, 65
[wps-gallery] 178
[wps-group-activity] 191
[wps-group-admin] 188
[wps-group-create] 182, 187
[wps-group-delete] 190
[wps-group-description] 187
[wps-group-edit] 188
[wps-group-id] 193
[wps-group-image] 187
[wps-group-join-button] 190
[wps-group-members] 192
[wps-group-post] 191
[wps-groups] 183, 185
[wps-group-title] 187
[wps-group-url] 193
[wps-my-groups] 185
[wps-reward] 162, 168, 175, 176
203

[wps-rewards] 163
[wps-usermeta-button] 56, 57
[wps-usermeta-change-link] 56
A
accept_request_label 64, 152
Accessing the API 199
account_closed_msg 35
Activating the Individual Extensions 112
Activity attachments 131
Activity share lists 129, 131
activity stream 36
Add Forum 14
Add Forums 14
Adding alerts to your theme 70
Adding Profile Extensions to the Directory 155
Add Profile Page 13
Add Profile pages 13
add_text 172
Admin Only 145
Alerts 67
All Forums 95
allow_comments 80
allowed_document_types 172
allowed_image_types 172, 173
allow_replies 39
allow_undislikes 138
allow_unlikes 138
Always Show? 145
are_you_sure_text 58
author_format 92
author_link 93
Autosubscribe 96
avatar 18, 33
avatar_size 37, 150, 163, 192
B
back_to 171, 192
Badge for post count 164
Badge size 165
base_date 75, 79, 88, 93
204

Blog 15
Building Your Own Profile Page 97, 178
button_label 172
by_text 139
C
cancel_button_label 169, 172
cancel_label 65, 189
cancel_request_label 66
captcha 117
CAPTCHA 116
Change Avatar Page 45, 47
change_link 32
choose 48
Choosing Activity Recipient(s) 127, 129
class 35, 38, 52, 57, 58, 64, 66, 75, 153, 171, 182, 189, 190, 192
clear out your alerts 71
close an account 57
closed_prefix 78, 92
closed_switch 77
closed_switch_msg 77
comment_add_label 80
comment_avatar_size 37, 172
comment_class 81
comment_label 173
comment_pending 78
comments_avatar_size 81
comment_size 38
comment_size_text_plural 38
comment_size_text_singular 38
content_label 76, 183, 189
Core Functions 199
count 37, 62, 63, 79, 163, 170, 175, 177
count_include_replies 89
country 21, 52, 119
country_label 22
create_button_label 169
create_label 169
create_placeholder 169
Creating Profile Extensions 142
crop 48, 49
205

CSS 99, 105


Custom Email Alerts 113, 115, 123, 127, 129, 141, 147
D
Data Protection Act 59
date 144
date_format 39, 69, 79, 93, 173, 193
date_label 151, 183, 193
dating site 141
days 163
Default Friends 157
Default Groups 195, 199
Default Profile Page 18
Default Value 164
delete_all_text 69
delete_label 39
delete_text 171
deleting users 57
Disable Alerts 71
dislike_count_text_plural 139
dislike_count_text_singular 139
dislike_text 138
display_name 52, 119
Divider 144
done_text 139
E
edit_and_cancel_class 169, 171
Edit Profile 19, 142
Edit Profile Page 45, 51
edit_prompt_content 172
edit_prompt_text 168, 169, 175
edit_text 171
email 53
Emails to send 72
empty_gallery 169
empty_msg 78
empty_text 146
Extension Details box 143
Extensions plugin 10
206

F
Facebook 15
Facebook and Twitter 15
Facebook page URL 143
fail_text 134
Featured image 164
featured_image_size 169, 175, 177
file_types_msg 48
flag_size 68
flag_src 69
flag_unread_left 68, 70
flag_unread_radius 69, 70
flag_unread_size 68
flag_unread_top 68, 70
flag_url 69
Forgotten Password? Form 120, 121
forum_count 88
forum_freshness 88
forum_last_activity 88
Forums 73
Forum Setup 96
forum_title 88
Frequency of Email alert notifications 72
friend_add_label 152
friend_cancel_label 152
friend_request 65, 151
Friends and Activity 13
friendship_class 152
friendship requests 21
friends_no 65, 151
Friends Page 61, 67, 73
friends_pending 65, 151
friends with every other member 66
friends_yes 64, 151
From email 72
From name 72
FTP 23, 25
functions.php 23, 24
G
gaming site 141
207

get_max 38
Getting Started Quickly 13
Getting the Extensions Plugin 111
Getting WordPress 9
Getting WP Symposium Pro 10
Google map 20
gravatar 32
Groups 167, 181, 195, 199
H
header_count 74, 78, 89
header_last_activity 74, 78, 89
header_text 183
header_title 74, 78, 89
Helpdesk Support 11
hide_label 39
hide_until_loaded 38
Hooks and Filters 22, 36
How this book is arranged 16
HTML 99, 100, 105
I
icon alert for pending friendship requests 71
icon alert for unread activity alerts 70
icon alert for unread messages 71, 125
ignore_images 134
ignore_links 134
image 144
Image Galleries 167
image_label 189
image_remove_label 189
include_closed 92
include_comments 92
include_friends 39
include_friendship_action 152
Include in Directory Search? 145
include_meta_show 154
include_posts 92
include_replies 92
include_self 39, 152
Insert Activity Post 199
208

Introduction To Hooks And Filters 23


item_size 171
L
label 35, 38, 48, 52, 54, 58, 65, 76, 91, 154, 182, 188, 190
label_back_to_login 119
label_cancel 191
label_email 118
label_join 190
label_leave 190
label_login 117
label_lostpassword 117
label_lostpassword_send 120
label_name 119
label_password 118
label_password_confirm 118
label_prefix 146
label_register 117
label_username 117, 118
last_active_format 62, 151
last_active_text 62
layout 63, 152
level_0_links 88
licence 10, 111
like_count_text_plural 138
like_count_text_singular 138
like_text 138
limit 150
link 39, 62, 64, 150, 163, 173, 183, 188
list 143
Live chat support 11
locked_msg 76
Login and Redirect 115
login form 115
Login Form 117
Login Form Shortcode Options 117, 118
login_url 78
logout_text 58
lost_password 117
M
209

Mailing List 15
make_all_read_text 69
Manage lists 130
mandatory 119
mandatory text 120
map_size 21
map_style 21, 55
map_zoom 21
max 92
max_names_to_show 139
max_previews 134
Member Directory 149
Menu Alerts 125
meta 55
meta_class 53
mimic_user_id 22, 40
mode 118, 153
moderate 76
moderate_msg 76
more 38, 175, 177
more_label 38
more_left_adjustment 176, 177
more_text_plural 139
more_text_singular 139
more_top_adjustment 176, 177
moved_to 78
N
name 119
nickname 119
no_activity_text 69
no_albums 175, 177
no_indent 88
none 63, 64
no_permission_text 168, 171, 175, 177
no_results_msg 150, 183
not_found 40
not_permitted 48
number 150
O
210

opacity 162
order 92, 150, 183
Order 96, 144
order_by 150, 183
orderby 92, 170, 176, 177
or_text 139
P
padding 178
page_size 80
page_x_of_y 80
pagination 79
pagination_bottom 80
pagination_top 80
password 52, 119
password2 52
password_msg 53
pending 78
pending friendship requests 63, 64
Permalink 163
PHP 24, 71
placeholder 153
Post count 165
post_deleted 80
post_id 39
Privacy 96
private 62, 154
private_label 189
Private Messages 125
private_msg 35, 40, 76, 78, 154, 191, 192
private_reply_msg 81
profile_extensions 155
Profile Extensions 55, 141, 147
profile_extensions_labels 155
profile_extensions_layout 155
profile_link 32
Profile Page 17, 45, 47
Profile Parameter 46
Profile Security 147
Q
211

quick_select 153
R
recent_alerts_text 69
Redirecting users from the admin dashboard 121
register 117
registered_label 151
registration form 115, 145
Registration Form 118
Registration Form Shortcode Options 118
registration_url 118
reject_request_label 64, 152
reply_icon 79
Reward Details (box) 164
Rewards 137, 159
Rewards: Creating/Editing 163, 165
Rewards for Likes/Dislikes 140
Rewards: User rewards 165
S
scrolling 177
search_label 153
secure_msg 78
secure_post_msg 80
security 147
select_activity_text 69
shortcode parameters 184
Shortcodes (for Group page) 186
show 74, 75, 182
show_allowed_types 172
show_author 92
show_by_default 151
show_closed 77
show_comment_form 80
show_comments 80
show_comments_count 77
show_count 77, 87, 170, 175
show_date 93, 151, 183, 193
show_description 169, 175
show_freshness 77, 87
show_friendship_status 151
212

show_header 77, 87
show_if_empty 146
Showing a Profile Extension 145
show_last_active 62
show_last_activity 77, 88
show_location 150
show_owner 169, 171
show_posts 89
show_posts_header 88
show_registered 151
show_slideshow 171
show_snippet 93
show_summary 89
show_user_login 153
show_with_results 154
size 32, 55, 62, 63, 79, 162
slideshow_hide_link 171
slideshow_link 171
slug 74, 75, 77, 84, 87, 90, 91, 96, 146
snippet_length 93
SoundCloud 133
status 92, 192
Status 96
stick 36
sticky_label 39
style 68
summary 93
summary_avatar_size 94
summary_commented 94
Summary email 72
summary_format 93
summary_replied 94
summary_show_unread 94
summary_snippet_length 94
summary_started 93
summary_title_length 94
Support and Help 11
System Messages 123
T
Test WordPress email 72
213

Test WP Symposium Pro alert 72


text 34, 56, 143
textarea 143
text_lostpassword_prompt 121
text_new_password 121
text_password_reset 121
text_pending 191
text_private 191
text_register_prompt 119, 121
text_username_not_found 121
theme 70
timeout 80
title_label 75, 182, 189
title_length 79, 89, 93
town 52, 119
town/city 21
Town/City and Country fields mandatory 120
town_label 22
try_again_msg 48
Twitter 15
Type 143, 164
Type of reward to count 165
U
undislike_text 139
unlike_text 138
unsticky_label 39
update_button_label 172
updated 189
updated_ok 189
update_label 189
Upload Plugin 10, 112
url 56, 58, 117, 153
URL 143
url_preview_fail 134
url_preview_image 134
user_avatar_size 21
user_id 146, 168, 169, 175, 177
user_link 193
V
214

value 57
Video Tutorials 15
Visibility 96
W
Website link previews 133
What is WP Symposium Pro? 9
width 183, 187
WordPress filter 23
WordPress hook 23
wps_activity_post_add_hook 200
wps_api_insert_activity_post 199
wpspro_country 55
wpspro_home 55
wpspro_map 55
wps_usermeta_change_filter 55
wps_usermeta_change_hook 55
WP Symposium Pro Extensions 10
WP Symposium Pro Extensions Plugin 111
Y
you_text 139
YouTube 132, 144
Z
zoom 55

215

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_filter
wps_activity_comment_meta_filter
wps_activity_init_hook
wps_activity_init_hook
wps_activity_item_filter
wps_activity_item_filter
wps_activity_item_meta_filter
wps_activity_item_meta_filter
wps_activity_item_settings_filter
wps_activity_item_settings_filter
wps_activity_items_filter
wps_activity_items_filter
wps_activity_new_comment_filter
wps_activity_new_comment_filter
wps_activity_post_comment_filter
wps_activity_post_comment_filter
wps_activity_post_pre_forum_filter
wps_activity_pre_filter
wps_activity_pre_filter
wps_activity_single_item_filter
wps_activity_single_item_filter
wps_directory_item_content_filter
wps_display_name
wps_forum_comment_pre_form_filter
wps_forum_comment_pre_form_filter
wps_forum_get_post_item
wps_forum_item_content_filter
wps_forum_item_sub_comment_filter
wps_forum_name_filter
wps_forum_post_comment_filter
216

29
43
30
44
28
43
28
42
27
42
26
41
29
44
29
44
36
26
40
27
41
154
26
86
87
95
83
83
89
84

wps_forum_post_comment_filter
wps_forum_post_delete_hook
wps_forum_post_post_title_filter
wps_friends_init
wps_gallery_attachments_valid_document_extensions_filter
wps_gallery_attachments_valid_image_extensions_filter
wps_gallery_comment_meta_filter
wps_group_item_filter
wps_groups_post_filter
wps_groups_pre_filter
wps_my_group_item_filter
wps_my_groups_post_filter
wps_my_groups_pre_filter
wps_usermeta_change_filter
wps_usermeta_change_hook
wps_usermeta_init

84
81
82
66
173
173
174
184
185
184
185
185
185
53
54
58

217

Change Control
0.25

Updated Website link previews

0.24

Added Galleries and updated Core Functions (API)

0.23

Added Core Functions (API) chapter

0.22

Added new parameter to wps_activity_item_filter

0.21

Added Website link previews (for activity)

0.20

Added Likes and Dislikes

0.19
Added Rewards

Added Default Friends
Added Groups
0.18

Added Profile Extensions


Added Profile Security
Added Member Directory

0.17

Added Forums (Core)

0.16 - 0.1

Unpublished

218

Potrebbero piacerti anche