• No results found

Elgg 1.8 Social Networking

N/A
N/A
Protected

Academic year: 2021

Share "Elgg 1.8 Social Networking"

Copied!
14
0
0

Loading.... (view fulltext now)

Full text

(1)

Elgg

1.8 Social

Networking

Create, customize,

and

deploy

your very

own

social

networking

site

with

Elgg

Cash Costello

open

source*

communityexperiencedistilled

PUBLISHING

BIRMINGHAM-MUMBAI

(2)

Table of Contents

Preface 1

Chapter

1: Social Networking and

Elgg

7

Social features 8

Profiles 8

Relationships

8

Content

sharing

8

Activity

and notifications 8

Groups

8

Communication 9

What is

Elgg?

9

TheElgg engine 10

Usermanagement 11

Privacy

controls 11

Theming

11

Commenting

12

Tagging

12

Widgets

12 Internationalization 13 Feeds 13 Web services 14

The power of

plugins

14

Bundled

plugins

14

Third-party plugins 14

Themes 15

Building

yourown plugins 15

Case studies 15

Nichesocial network 16

Designingandbuildingthesite 16

(3)

Pluginsmentioned 17

Corporate

intranet 17

Designingandbuildingthe site 17

Deployingthe site 18

Pluginsmentioned 18

Educational collaboration 18

Designing and buildingthe site 19

Deployingthe site 19

Pluginsmentioned 19

Elgg

resources 20

Elgg community

20

Elgg wiki 20

Developer

resources 20

A few wordsofadvice 20

Take notes 20

Save resources 21

Be methodical 21

Finding help

21

Summary

21

Chapter

2:

Installing Elgg

23

Preparing

the server 23

Checking requirements

24

Downloading

the latest version 24

Extracting

the files 25

Moving

filesto yourweb server

directory

25

Configuring

the server 27

Create thedatabase 28

Run

Elgg's

installer 29

Loading

the database 31

Configure Elgg

32

Creating

the admin account 33

All done! 34

Summary

35

Chapter

3: ATour of Your First Elgg Site 37

Getting

around 38

Registering

users 39

User profiles and avatars 40

Profile information 41

Avatar 42

(4)

Friends 45

Activity

stream 47 Tools 48

Blogs

48 Bookmarks 49 Files 50

Groups

50

Pages

52

Messages

53 The wire 53 Usersettings 54 Your

settings

54 Tools 55 Notifications 55 Administration 56

Activating plugins

58 Site

categories

58

Custom

profile

fields 59

Default

widgets

59

Site pages 60

Reported

content 61

Customizing

yoursite 61

User

registration

and authentication 62

Widgets

62

Friendship

model 62

Roles 62

Help

and support 63

Summary

63

Chapter

4:

Sharing

Content 65

Blogs

66

Creating

a

blog

post 67

Embedding photosand files 68

Publishing 69

Finding

and

viewing

69

Search 70

Lists ofblog posts 70

RSS feeds 71

Widget 72

Commenting

72

Use cases 73

(5)

Bookmarks 74

Adding

a bookmark 74 Bookmarklet 76

Viewing

77 Usecases 78 File 79

Uploading

afile 79

Viewing

80 Use cases 83 Customizations 83 The wire 83

Posting

84

Viewing

85 Twitterintegration 86 Use cases 89 Customizations 90

Summary

Chapter

5:

Communities, Collaboration,

and Conversation 91

Groups

92

Creating

a group 92

Group profile

94 Membership 95 Discussion forum 96

Group

tools 98

Finding

groups 99 Usecases 100 Customizations 100

Pages

101

Creating

pages 102

Viewing

103 Usecases 104 Customizations 104

Messages

104 Inbox 104

Composing

105 Customizations 106

Message

board 106 Customizations 108

Summary

108

(6)

Chapter

6:

Finding

and Using Plugins 109

Plugin

administration 109

Filtering

and

sorting

109

Plugin dependencies

110

Plugin settings

113

Finding plugins

113

Browsing

the repository 115

Searching

115

Evaluating

before

downloading

115

Look at thepluginoverview 115

Read the comments 115

Check thehistory 116

Custom

plugins

116

Installing plugins

116

Testserver 117

Copying

the code 117

Activating

and

configuring

117

Invalidplugin? 118

Troubleshooting

118

Themes 118

Findingand installingthemes 119

Free themes 119

Commercial themes 120

Custom themes 120

Installingthemes 121

Major community plugins

122

Tidypics

122 Plugin profile 122 Administration 123 Uploading photos 124 Viewing photos 124 Tagging photos 126 Event calendar 126 Plugin profile 127 Administration 127 Sitecalendar 127 Groupcalendar 128 ProfileManager 128 Plugin profile 128

Adding profilefields 129

Configuringtheprofilefields 130

Plugin settings 130

(7)

Chapter

7:

Creating

Your First

Plugin

133

What you need to know 134

Elgg developer

resources 135

Setting

up your

development

environment 136

Editing

code 136

Configuring

yoursite 137

Hello,

World! 138

Plugin

skeleton 138

Createyourplugin directory 138

Plugin manifest 139

Startscript 139

Activatingthe hello worldplugin 140

Register

for the

init,

system event 140

Adding

a new route 141

Creating

a web page 142

Update routing

143

Add to the site menu 144

Extending

the page handler 145

Add a sidebar menu 146

Language

support 148

Personalizing the content 149

Organizing

yourcontentinto views 150

Agreetingview 151

A stats view 153

Review 155

Debugging

155

Debugging

tothe

log

156

Debugging

to the screen 157

Debugging

PHP

through

an IDE 158

Firebug

and other browser

development

tools 159

Elgg developer

tools 161

Inspect 161

Themingsandbox 162

Summary

162

Chapter8: Customization

through Plugins

163

Lesson 1:

Changing wording

164

Problem 164

Solution 164

Example

164

Step1: Create the pluginstructure 165

Step2:Find thelanguage strings 166

(8)

Exercise 167

Lesson 2:

Modifying

a section ofa page 167

Problem 167

Solution 168

Example

168

Step1: Find the view to override 168

Step2: Create thepluginstructure 170

Step3: Edit thelogoview 170

Step4:Stylethe header 172

Exercise 173

Lesson 3:

Adding

newcontent to a page 173

Problem 173

Solution 173

Example 174

Step1: Find the view to extend 175

Step2: Create the plugin structure 175

Step3: Buildourview 175

Step4: Make thetipsrandom 176

Exercise 177

Lesson 4:

Doing something

when X

happens

178

Problem 178

Solution 178

Example

178

Step 1: Find the event 178

Step2: Create thepluginstructure 179

Step3: Write thefunction thatsends the e-mail 180

Exercise 180

Lesson 5:

Creating

acustom

widget

181

Problem 181

Solution 181

Example

181

Step1: Create thepluginstructure 182

Step2:Createthewidgetedit view 182

Step3: Create thewidgetcontent view 184

Exercise 186

Lesson 6:

Giving

your usersoptions 186

Problem 186

Solution 187

Example

187

Step1: Create thepluginstructure 187

Step2: Add usersettings 188

Step3: Create the toolbar view 190

(9)

Exercise 192

Lesson 7:

Adding JavaScript

193

Problem 193

Solution 193

Example

193

Step 1: Create thepluginstructure 194

Step2: Load theJavaScriptfile 194

Step3: Add CSS andJavaScriptinitialization 195

Exercise 196

Lesson 8:

Changing

how

Elgg

doesX 197

Problem 197

Solution 197

Example

197

Step1: Create the pluginstructure 198

Step2: Create the index page 199

Step3: Define the views 201

Step4: AddtheCSS 203

Step5: Add aplugin setting 204

Exercise 206

Lesson 9:

Collecting

and

storing

data 207

Problem 207

Solution 207

Example

207

Overview 208

Step 1: Create thepluginstructure 208

Step2: Create the mainhelppage 209

Step3: Create thecategories 211

Step4:Addanadministrationpage 212

-Step 5: Create the formbody 213

Step6: Create thesaveaction 215

Step7: Create thehelp categorypage 217

Step8: Create thehelp objectview 219

Step9: Add thehelpsidebar 221

Step10: Add CSS for thetopic listingpage 222

Step11: Finish the mainhelppage 223

Exercise 225

Summary

226

Chapter

9:

Theming Elgg

227

What you need to know 228

Theming

basics 228

Elgg's

default theme 228

HTML 229

CSS 231

JavaScript 232

(10)

Views system 233 What isaview? 233 Extendingaview 234 Overridingaview 234 Template language 234 Caching 235 Theviewtype 235 Tools 235 CSS framework 236

Creatingabstractions ofcommon visualpatterns 236

Customizing objects through extension classes 237

Adding

external

JavaScript

and CSS 238

Menu system 238

Registeringa menu item 239

Renderinga menu 240

Comparing theming

in WordPressto

Elgg

240

Building

a theme 241

Plugin

structure 242

Layout 244

Defaultlayout 244

Pageheader 244

Page bodylayout 244

Pagefooter 245

Movingthe search box 246

Styling

the sidebar module 247

Movingthe site menu to thetopbar 248

Creating

a mobile theme 251

Plugin

structure 252

Layout

253

CSS 253

Summary

256

Chapter 10:

Moving

to Production 257

Selecting

a server 258

Performance considerations 258

Competingforresources 258

Usage patterns 259

General guidelinesforserverselection 260

Hosting options

260

Sharedhosting 261

Virtual Private Server 261

Dedicatedserver 262

Cloud hosting 262

Hostingcompanyselection 262

Configuring

a server 263

(11)

PHP 264

MySQL

266

Cron 267

E-mail 268

Managing

the site 268

Backup

269 Code 269 Database 269 Files 270 Serverconfiguration 270 Restoring 270

Log

rotation 270

Spam

271 Registration 271 Detectingspammers 272 Web

analytics

273 Dailytasks 273

Monitoringuserregistration 273

Reviewing reportedcontent 273

Respondingto feedback 273

Community management 274

Testing, upgrading,

and

moving

a site 274

Testing

274

Mirroringtheproductionsite 274

Testplan 275

Upgrading

276

Moving

asite 277

Performance 278

Benchmarking

278

Monitoring and data collection 278

Stresstesting 279

Easy performance

gains

280

Advanced

performance tuning

and

scaling

281

Caching 281

Multipleservers 282

Resources 282

Reporting bugs

283

Steps

to

reproduce

the problem 283

Elgg

or

plugin?

284

Reporting

the

bug

284

Summary

284

Appendix

A:

Developer's

QuickStart Guide 285

Overview of

Elgg

as a framework 285

(12)

of

Object-oriented

or

procedural?

286

Does itusethe Model-View-Controller

pattern?

286

Convention or

configuration?

286

Is it extensible? 286

Whattemplate engine is used? 287

A Model-View-Controller

perspective

of

Elgg

287

Overview 287 Controllers 287 Model 288 Views 289

Routing

290 Code location 290 Actions 290 Code location 290

Page

handlers 291 Codelocation 291 Framework

booting

291 Code location 292 Data model 292 Entities 292

Typeandsubtype 293

GUID 293 Owner 293 Container 293 Access 293 Database 294 Relationships 294 Extenders 294 Database 295 Retrievalfunctions 296 Code location 296 Views 297 Viewtemplates 297

Page

shells and

layout

298

View

type

298

Overriding

and

extending

views 299

Special

views 299

Code location 299

Events and hooks 300

Elgg

events 300

Plugin

hooks 300

(13)

Plugins

301 Initialization 302

Plugin

order 302 Conventions 302 Themes 303 Code location 303

Activity

stream 304 Code location 304 Notifications 304 Code location 304

Internationalization and localization 305

Code location 305

Lightning round 305

Authentication 306

Caching

306

Configuration

306

Debugging

and

logging

306

JavaScript

307 Menus 307 Private

settings

307 Search 307

Security

308 Session

handling

308 Unit tests 308 Web services 308

Widgets

308

Summary

309

Appendix

B: Views

Catalog

311^

Using

views 311

Page

structure 312 Shells 312

Layouts

313 Elements 313 Topbar 314 Header 314 Sidebar 314 Footer 315 Owner block 316 Status messages 316 Comments 317 Searchbox 317 Components 318

(14)

Gallery 318 Imageblock 319 List 319 Module 320

Navigation

321 Breadcrumbs 321

Pagination

321 Menus 321 Topbarmenu 322 Sitemenu 322 Pagemenu 322 Footermenu 323

Userhovermenu 323

Entitymenu 323 Tabs 324 Forms 324

Input

324 Access 325 Buttons 325 Checkboxes 325 Date 326 Drop-downselector 327 Fileupload 327 Hidden input 327 Largetextarea 328 Password 328 Radio buttons 328 Textbox 329 Userpickers 329

Output

330 Date 330 E-mailaddress 330 Link 330 Tagcloud 331 Tags 331 Text 331 The form 331

Users,groups, and

objects

332

Activity

stream 332 Likes 333 Like this 333 List users 333

Widgets

334 Administration 335

Summary

336 Index 337 [xiii]

References

Related documents

2.1.15 In collaboration with Credit Providers and Payment Distribution Agents, refer disputes to the NDMA, DCASA (or other recognised industry body), PDASA, the Credit Ombud

1 NSW Government, Department of Justice, Discussion Paper, Limitation periods in civil claims for child sexual 2 Royal Commission into Institutional Responses to Child

Background: Standing eight-electrode bioelectrical impedance analysis, which can be used to estimate percentage body fat (BF%) and lean soft tissue (LST) in the whole body and

The duty of the Board of Management of a parent company (Section 290 (1) and (2) of the Commercial Code) to provide information at the Annual General Meeting at which the

Failure to follow these instructions can result in death, serious injury, or equipment damage.. For additional information, refer to NEMA ICS 1.1 (latest edition), “Safety

this is why l have stated often - PRICES THINK AHEAD OF TIME, prices already decided to turn because prices cleared the zone of demand by spiking south before they reached

The nest- ing site is often a high point such as a rock, wall, or fence post, from which the gull can Left: Its black back, heavy bill, and large body distinguish the great

Based on that problem, The researcher formulated the problem of this research as follows: ³FDQ the use of students team achievement division method improve the English