├── README.md ├── doc ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap.min.css │ ├── jquery.iviewer.css │ ├── prettify.css │ └── template.css ├── img │ ├── apple-touch-icon-114x114.png │ ├── apple-touch-icon-72x72.png │ ├── apple-touch-icon.png │ ├── favicon.ico │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ └── icons │ │ ├── class.png │ │ └── method.png ├── index.html └── js │ ├── bootstrap.js │ ├── jquery-1.7.1.min.js │ ├── jquery-ui-1.8.2.custom.min.js │ ├── jquery.mousewheel.min.js │ ├── prettify │ ├── lang-apollo.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lisp.js │ ├── lang-lua.js │ ├── lang-ml.js │ ├── lang-n.js │ ├── lang-proto.js │ ├── lang-scala.js │ ├── lang-sql.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-yaml.js │ └── prettify.min.js │ └── template.js └── json-api-for-buddypress ├── controllers └── BuddypressRead.php ├── json-api-for-buddypress.php ├── languages ├── json-api-for-buddypress-de_DE.mo ├── json-api-for-buddypress-de_DE.po ├── json-api-for-buddypress-es_ES.mo ├── json-api-for-buddypress-es_ES.po ├── json-api-for-buddypress.mo └── json-api-for-buddypress.pot └── library ├── functions.class.php └── parameters.php /README.md: -------------------------------------------------------------------------------- 1 | JSON-API-for-BuddyPress 2 | ======================= 3 | 4 | JSON API for BuddyPress Plugin 5 | 6 | ==Introduction== 7 | 8 | JSON API for BuddyPress is a plugin, that supports the JSON API Plugin with a new Controller to get information from BuddyPress. 9 | 10 | For further information refer to the GitHub Project Page at http://tweichart.github.com/JSON-API-for-BuddyPress 11 | 12 | ==Release Notes== 13 | 14 | ===1.0.2=== 15 | * added possibility to get avatars and user meta data from profile_get_profile 16 | 17 | ===1.0.1=== 18 | * added support for de_DE 19 | * added support for es_ES (all credits to the spanish translation to Andrew Kurtis from webhostinghub.com) 20 | * changed folder structure 21 | 22 | ===1.0=== 23 | * code review 24 | * added documentation 25 | 26 | ===0.9=== 27 | * now checking for permissions bevore retrieving data (security) 28 | * need for authentication pushed to 2.0 29 | 30 | ===0.8=== 31 | * extended functionality for settings 32 | 33 | ===0.7=== 34 | * extended functionality for forums 35 | 36 | ===0.6=== 37 | * extended functionality for groups 38 | 39 | ===0.5=== 40 | * extended functionality for friends 41 | 42 | ===0.4=== 43 | * extended functionality for messages / notifications 44 | * reworked the framework 45 | 46 | ===0.3=== 47 | * extended functionality for profile 48 | * new parameter 'limit' for get_activity 49 | * including error handler function 50 | 51 | ===0.2=== 52 | * extended functionality for activity 53 | 54 | ===0.1=== 55 | * initial commit 56 | -------------------------------------------------------------------------------- /doc/css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.0.0 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | .hidden { 11 | display: none; 12 | visibility: hidden; 13 | } 14 | @media (max-width: 480px) { 15 | .nav-collapse { 16 | -webkit-transform: translate3d(0, 0, 0); 17 | } 18 | .page-header h1 small { 19 | display: block; 20 | line-height: 18px; 21 | } 22 | input[class*="span"], 23 | select[class*="span"], 24 | textarea[class*="span"], 25 | .uneditable-input { 26 | display: block; 27 | width: 100%; 28 | height: 28px; 29 | /* Make inputs at least the height of their button counterpart */ 30 | 31 | /* Makes inputs behave like true block-level elements */ 32 | 33 | -webkit-box-sizing: border-box; 34 | /* Older Webkit */ 35 | 36 | -moz-box-sizing: border-box; 37 | /* Older FF */ 38 | 39 | -ms-box-sizing: border-box; 40 | /* IE8 */ 41 | 42 | box-sizing: border-box; 43 | /* CSS3 spec*/ 44 | 45 | } 46 | .input-prepend input[class*="span"], .input-append input[class*="span"] { 47 | width: auto; 48 | } 49 | input[type="checkbox"], input[type="radio"] { 50 | border: 1px solid #ccc; 51 | } 52 | .form-horizontal .control-group > label { 53 | float: none; 54 | width: auto; 55 | padding-top: 0; 56 | text-align: left; 57 | } 58 | .form-horizontal .controls { 59 | margin-left: 0; 60 | } 61 | .form-horizontal .control-list { 62 | padding-top: 0; 63 | } 64 | .form-horizontal .form-actions { 65 | padding-left: 10px; 66 | padding-right: 10px; 67 | } 68 | .modal { 69 | position: absolute; 70 | top: 10px; 71 | left: 10px; 72 | right: 10px; 73 | width: auto; 74 | margin: 0; 75 | } 76 | .modal.fade.in { 77 | top: auto; 78 | } 79 | .modal-header .close { 80 | padding: 10px; 81 | margin: -10px; 82 | } 83 | .carousel-caption { 84 | position: static; 85 | } 86 | } 87 | @media (max-width: 768px) { 88 | .container { 89 | width: auto; 90 | padding: 0 20px; 91 | } 92 | .row-fluid { 93 | width: 100%; 94 | } 95 | .row { 96 | margin-left: 0; 97 | } 98 | .row > [class*="span"], .row-fluid > [class*="span"] { 99 | float: none; 100 | display: block; 101 | width: auto; 102 | margin: 0; 103 | } 104 | } 105 | @media (min-width: 768px) and (max-width: 980px) { 106 | .row { 107 | margin-left: -20px; 108 | *zoom: 1; 109 | } 110 | .row:before, .row:after { 111 | display: table; 112 | content: ""; 113 | } 114 | .row:after { 115 | clear: both; 116 | } 117 | [class*="span"] { 118 | float: left; 119 | margin-left: 20px; 120 | } 121 | .span1 { 122 | width: 42px; 123 | } 124 | .span2 { 125 | width: 104px; 126 | } 127 | .span3 { 128 | width: 166px; 129 | } 130 | .span4 { 131 | width: 228px; 132 | } 133 | .span5 { 134 | width: 290px; 135 | } 136 | .span6 { 137 | width: 352px; 138 | } 139 | .span7 { 140 | width: 414px; 141 | } 142 | .span8 { 143 | width: 476px; 144 | } 145 | .span9 { 146 | width: 538px; 147 | } 148 | .span10 { 149 | width: 600px; 150 | } 151 | .span11 { 152 | width: 662px; 153 | } 154 | .span12, .container { 155 | width: 724px; 156 | } 157 | .offset1 { 158 | margin-left: 82px; 159 | } 160 | .offset2 { 161 | margin-left: 144px; 162 | } 163 | .offset3 { 164 | margin-left: 206px; 165 | } 166 | .offset4 { 167 | margin-left: 268px; 168 | } 169 | .offset5 { 170 | margin-left: 330px; 171 | } 172 | .offset6 { 173 | margin-left: 392px; 174 | } 175 | .offset7 { 176 | margin-left: 454px; 177 | } 178 | .offset8 { 179 | margin-left: 516px; 180 | } 181 | .offset9 { 182 | margin-left: 578px; 183 | } 184 | .offset10 { 185 | margin-left: 640px; 186 | } 187 | .offset11 { 188 | margin-left: 702px; 189 | } 190 | .row-fluid { 191 | width: 100%; 192 | *zoom: 1; 193 | } 194 | .row-fluid:before, .row-fluid:after { 195 | display: table; 196 | content: ""; 197 | } 198 | .row-fluid:after { 199 | clear: both; 200 | } 201 | .row-fluid > [class*="span"] { 202 | float: left; 203 | margin-left: 2.762430939%; 204 | } 205 | .row-fluid > [class*="span"]:first-child { 206 | margin-left: 0; 207 | } 208 | .row-fluid .span1 { 209 | width: 5.801104972%; 210 | } 211 | .row-fluid .span2 { 212 | width: 14.364640883%; 213 | } 214 | .row-fluid .span3 { 215 | width: 22.928176794%; 216 | } 217 | .row-fluid .span4 { 218 | width: 31.491712705%; 219 | } 220 | .row-fluid .span5 { 221 | width: 40.055248616%; 222 | } 223 | .row-fluid .span6 { 224 | width: 48.618784527%; 225 | } 226 | .row-fluid .span7 { 227 | width: 57.182320438000005%; 228 | } 229 | .row-fluid .span8 { 230 | width: 65.74585634900001%; 231 | } 232 | .row-fluid .span9 { 233 | width: 74.30939226%; 234 | } 235 | .row-fluid .span10 { 236 | width: 82.87292817100001%; 237 | } 238 | .row-fluid .span11 { 239 | width: 91.436464082%; 240 | } 241 | .row-fluid .span12 { 242 | width: 99.999999993%; 243 | } 244 | input.span1, textarea.span1, .uneditable-input.span1 { 245 | width: 32px; 246 | } 247 | input.span2, textarea.span2, .uneditable-input.span2 { 248 | width: 94px; 249 | } 250 | input.span3, textarea.span3, .uneditable-input.span3 { 251 | width: 156px; 252 | } 253 | input.span4, textarea.span4, .uneditable-input.span4 { 254 | width: 218px; 255 | } 256 | input.span5, textarea.span5, .uneditable-input.span5 { 257 | width: 280px; 258 | } 259 | input.span6, textarea.span6, .uneditable-input.span6 { 260 | width: 342px; 261 | } 262 | input.span7, textarea.span7, .uneditable-input.span7 { 263 | width: 404px; 264 | } 265 | input.span8, textarea.span8, .uneditable-input.span8 { 266 | width: 466px; 267 | } 268 | input.span9, textarea.span9, .uneditable-input.span9 { 269 | width: 528px; 270 | } 271 | input.span10, textarea.span10, .uneditable-input.span10 { 272 | width: 590px; 273 | } 274 | input.span11, textarea.span11, .uneditable-input.span11 { 275 | width: 652px; 276 | } 277 | input.span12, textarea.span12, .uneditable-input.span12 { 278 | width: 714px; 279 | } 280 | } 281 | @media (max-width: 980px) { 282 | body { 283 | padding-top: 0; 284 | } 285 | .navbar-fixed-top { 286 | position: static; 287 | margin-bottom: 18px; 288 | } 289 | .navbar-fixed-top .navbar-inner { 290 | padding: 5px; 291 | } 292 | .navbar .container { 293 | width: auto; 294 | padding: 0; 295 | } 296 | .navbar .brand { 297 | padding-left: 10px; 298 | padding-right: 10px; 299 | margin: 0 0 0 -5px; 300 | } 301 | .navbar .nav-collapse { 302 | clear: left; 303 | } 304 | .navbar .nav { 305 | float: none; 306 | margin: 0 0 9px; 307 | } 308 | .navbar .nav > li { 309 | float: none; 310 | } 311 | .navbar .nav > li > a { 312 | margin-bottom: 2px; 313 | } 314 | .navbar .nav > .divider-vertical { 315 | display: none; 316 | } 317 | .navbar .nav > li > a, .navbar .dropdown-menu a { 318 | padding: 6px 15px; 319 | font-weight: bold; 320 | color: #999999; 321 | -webkit-border-radius: 3px; 322 | -moz-border-radius: 3px; 323 | border-radius: 3px; 324 | } 325 | .navbar .dropdown-menu li + li a { 326 | margin-bottom: 2px; 327 | } 328 | .navbar .nav > li > a:hover, .navbar .dropdown-menu a:hover { 329 | background-color: #222222; 330 | } 331 | .navbar .dropdown-menu { 332 | position: static; 333 | top: auto; 334 | left: auto; 335 | float: none; 336 | display: block; 337 | max-width: none; 338 | margin: 0 15px; 339 | padding: 0; 340 | background-color: transparent; 341 | border: none; 342 | -webkit-border-radius: 0; 343 | -moz-border-radius: 0; 344 | border-radius: 0; 345 | -webkit-box-shadow: none; 346 | -moz-box-shadow: none; 347 | box-shadow: none; 348 | } 349 | .navbar .dropdown-menu:before, .navbar .dropdown-menu:after { 350 | display: none; 351 | } 352 | .navbar .dropdown-menu .divider { 353 | display: none; 354 | } 355 | .navbar-form, .navbar-search { 356 | float: none; 357 | padding: 9px 15px; 358 | margin: 9px 0; 359 | border-top: 1px solid #222222; 360 | border-bottom: 1px solid #222222; 361 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 362 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 363 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 364 | } 365 | .navbar .nav.pull-right { 366 | float: none; 367 | margin-left: 0; 368 | } 369 | .navbar-static .navbar-inner { 370 | padding-left: 10px; 371 | padding-right: 10px; 372 | } 373 | .btn-navbar { 374 | display: block; 375 | } 376 | .nav-collapse { 377 | overflow: hidden; 378 | height: 0; 379 | } 380 | } 381 | @media (min-width: 980px) { 382 | .nav-collapse.collapse { 383 | height: auto !important; 384 | } 385 | } 386 | @media (min-width: 1200px) { 387 | .row { 388 | margin-left: -30px; 389 | *zoom: 1; 390 | } 391 | .row:before, .row:after { 392 | display: table; 393 | content: ""; 394 | } 395 | .row:after { 396 | clear: both; 397 | } 398 | [class*="span"] { 399 | float: left; 400 | margin-left: 30px; 401 | } 402 | .span1 { 403 | width: 70px; 404 | } 405 | .span2 { 406 | width: 170px; 407 | } 408 | .span3 { 409 | width: 270px; 410 | } 411 | .span4 { 412 | width: 370px; 413 | } 414 | .span5 { 415 | width: 470px; 416 | } 417 | .span6 { 418 | width: 570px; 419 | } 420 | .span7 { 421 | width: 670px; 422 | } 423 | .span8 { 424 | width: 770px; 425 | } 426 | .span9 { 427 | width: 870px; 428 | } 429 | .span10 { 430 | width: 970px; 431 | } 432 | .span11 { 433 | width: 1070px; 434 | } 435 | .span12, .container { 436 | width: 1170px; 437 | } 438 | .offset1 { 439 | margin-left: 130px; 440 | } 441 | .offset2 { 442 | margin-left: 230px; 443 | } 444 | .offset3 { 445 | margin-left: 330px; 446 | } 447 | .offset4 { 448 | margin-left: 430px; 449 | } 450 | .offset5 { 451 | margin-left: 530px; 452 | } 453 | .offset6 { 454 | margin-left: 630px; 455 | } 456 | .offset7 { 457 | margin-left: 730px; 458 | } 459 | .offset8 { 460 | margin-left: 830px; 461 | } 462 | .offset9 { 463 | margin-left: 930px; 464 | } 465 | .offset10 { 466 | margin-left: 1030px; 467 | } 468 | .offset11 { 469 | margin-left: 1130px; 470 | } 471 | .row-fluid { 472 | width: 100%; 473 | *zoom: 1; 474 | } 475 | .row-fluid:before, .row-fluid:after { 476 | display: table; 477 | content: ""; 478 | } 479 | .row-fluid:after { 480 | clear: both; 481 | } 482 | .row-fluid > [class*="span"] { 483 | float: left; 484 | margin-left: 2.564102564%; 485 | } 486 | .row-fluid > [class*="span"]:first-child { 487 | margin-left: 0; 488 | } 489 | .row-fluid .span1 { 490 | width: 5.982905983%; 491 | } 492 | .row-fluid .span2 { 493 | width: 14.529914530000001%; 494 | } 495 | .row-fluid .span3 { 496 | width: 23.076923077%; 497 | } 498 | .row-fluid .span4 { 499 | width: 31.623931624%; 500 | } 501 | .row-fluid .span5 { 502 | width: 40.170940171000005%; 503 | } 504 | .row-fluid .span6 { 505 | width: 48.717948718%; 506 | } 507 | .row-fluid .span7 { 508 | width: 57.264957265%; 509 | } 510 | .row-fluid .span8 { 511 | width: 65.81196581200001%; 512 | } 513 | .row-fluid .span9 { 514 | width: 74.358974359%; 515 | } 516 | .row-fluid .span10 { 517 | width: 82.905982906%; 518 | } 519 | .row-fluid .span11 { 520 | width: 91.45299145300001%; 521 | } 522 | .row-fluid .span12 { 523 | width: 100%; 524 | } 525 | input.span1, textarea.span1, .uneditable-input.span1 { 526 | width: 60px; 527 | } 528 | input.span2, textarea.span2, .uneditable-input.span2 { 529 | width: 160px; 530 | } 531 | input.span3, textarea.span3, .uneditable-input.span3 { 532 | width: 260px; 533 | } 534 | input.span4, textarea.span4, .uneditable-input.span4 { 535 | width: 360px; 536 | } 537 | input.span5, textarea.span5, .uneditable-input.span5 { 538 | width: 460px; 539 | } 540 | input.span6, textarea.span6, .uneditable-input.span6 { 541 | width: 560px; 542 | } 543 | input.span7, textarea.span7, .uneditable-input.span7 { 544 | width: 660px; 545 | } 546 | input.span8, textarea.span8, .uneditable-input.span8 { 547 | width: 760px; 548 | } 549 | input.span9, textarea.span9, .uneditable-input.span9 { 550 | width: 860px; 551 | } 552 | input.span10, textarea.span10, .uneditable-input.span10 { 553 | width: 960px; 554 | } 555 | input.span11, textarea.span11, .uneditable-input.span11 { 556 | width: 1060px; 557 | } 558 | input.span12, textarea.span12, .uneditable-input.span12 { 559 | width: 1160px; 560 | } 561 | .thumbnails { 562 | margin-left: -30px; 563 | } 564 | .thumbnails > li { 565 | margin-left: 30px; 566 | } 567 | } 568 | -------------------------------------------------------------------------------- /doc/css/jquery.iviewer.css: -------------------------------------------------------------------------------- 1 | .iviewer_common { 2 | position:absolute; 3 | bottom:10px; 4 | border: 1px solid #000; 5 | height: 28px; 6 | z-index: 5000; 7 | } 8 | 9 | .iviewer_cursor { 10 | cursor: url(../img/iviewer/hand.cur) 6 8, pointer; 11 | } 12 | 13 | .iviewer_drag_cursor { 14 | cursor: url(../img/iviewer/grab.cur) 6 8, pointer; 15 | } 16 | 17 | .iviewer_button { 18 | width: 28px; 19 | cursor: pointer; 20 | background-position: center center; 21 | background-repeat: no-repeat; 22 | } 23 | 24 | .iviewer_zoom_in { 25 | left: 20px; 26 | background: url(../img/iviewer/iviewer.zoom_in.png); 27 | } 28 | 29 | .iviewer_zoom_out { 30 | left: 55px; 31 | background: url(../img/iviewer/iviewer.zoom_out.png); 32 | } 33 | 34 | .iviewer_zoom_zero { 35 | left: 90px; 36 | background: url(../img/iviewer/iviewer.zoom_zero.png); 37 | } 38 | 39 | .iviewer_zoom_fit { 40 | left: 125px; 41 | background: url(../img/iviewer/iviewer.zoom_fit.png); 42 | } 43 | 44 | .iviewer_zoom_status { 45 | left: 160px; 46 | font: 1em/28px Sans; 47 | color: #000; 48 | background-color: #fff; 49 | text-align: center; 50 | width: 60px; 51 | } 52 | 53 | .iviewer_rotate_left { 54 | left: 227px; 55 | background: #fff url(../img/iviewer/iviewer.rotate_left.png) center center no-repeat; 56 | } 57 | 58 | .iviewer_rotate_right { 59 | left: 262px; 60 | background: #fff url(../img/iviewer/iviewer.rotate_right.png) center center no-repeat; 61 | } 62 | 63 | .viewer 64 | { 65 | width: 100%; 66 | height: 500px; 67 | position: relative; 68 | background: transparent url('../img/loader.gif') no-repeat center center; 69 | } 70 | 71 | .viewer img 72 | { 73 | max-width: none; 74 | } 75 | 76 | .wrapper 77 | { 78 | overflow: hidden; 79 | } 80 | 81 | .iviewer_common 82 | { 83 | border: 0; 84 | bottom: auto; 85 | top: 10px; 86 | } 87 | 88 | .iviewer_zoom_status 89 | { 90 | border: 1px solid black; 91 | } 92 | -------------------------------------------------------------------------------- /doc/css/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /doc/css/template.css: -------------------------------------------------------------------------------- 1 | @import url(bootstrap.min.css); 2 | @import url(bootstrap-responsive.css); 3 | @import url(prettify.css); 4 | @import url(jquery.iviewer.css); 5 | @import url(http://fonts.googleapis.com/css?family=Crimson+Text|Philosopher|Forum); 6 | 7 | body 8 | { 9 | padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ 10 | background: #f9f9f9; 11 | color: #444; 12 | } 13 | 14 | a 15 | { 16 | color: #55A72F; 17 | } 18 | 19 | li.l0, li.l1, li.l2, li.l3, li.l5, li.l6, li.l7, li.l8 20 | { 21 | list-style-type: decimal; 22 | } 23 | 24 | a.brand, h2, .hero-unit h1 25 | { 26 | font-family: 'Forum', "Helvetica Neue", Helvetica, Arial, sans-serif; 27 | } 28 | 29 | .element .span4 30 | { 31 | width: 275px; 32 | } 33 | 34 | .namespace-contents hr, .package-contents hr 35 | { 36 | border-top: 3px dotted silver; 37 | } 38 | 39 | .namespace-indent, .package-indent 40 | { 41 | padding-left: 10px; border-left: 1px dashed #f0f0f0; 42 | } 43 | 44 | .element h3 i, .namespace-contents h3 i, .package-contents h3 i 45 | { 46 | margin-top: 2px; 47 | margin-right: 5px; 48 | } 49 | 50 | .element h3, .namespace-contents h3, .package-contents h3 51 | { 52 | margin-top: 25px; 53 | margin-bottom: 20px; 54 | border-bottom: 1px solid silver; 55 | } 56 | 57 | .element h3:first-of-type, .namespace-contents h3:first-of-type, 58 | .package-contents h3:first-of-type 59 | { 60 | margin-top: 30px; 61 | } 62 | 63 | .element h2 64 | { 65 | font-family: inherit; 66 | font-size: 1.2em; 67 | color: black; 68 | } 69 | 70 | .element .type 71 | { 72 | font-weight: bold; 73 | } 74 | 75 | #search-query 76 | { 77 | height: auto; 78 | } 79 | 80 | .hero-unit, div.element, .well 81 | { 82 | border: 1px solid #e0e0e0; 83 | background: white; 84 | } 85 | 86 | .dropdown-menu a{ 87 | overflow: hidden; 88 | text-overflow: ellipsis; 89 | } 90 | h2 91 | { 92 | border-bottom: 1px dashed #55A72F; 93 | margin-bottom: 10px; 94 | padding-bottom: 0; 95 | padding-left: 5px; 96 | color: #e9e9e9; 97 | font-weight: normal; 98 | margin-top: 40px; 99 | } 100 | 101 | h2:first-of-type 102 | { 103 | margin-top: 0; 104 | } 105 | 106 | .hero-unit 107 | { 108 | background: #75a70d; /* Old browsers */ 109 | background: -moz-radial-gradient(center, ellipse cover, #bfd255 0%, #8eb92a 72%, #72aa00 96%, #9ecb2d 100%); /* FF3.6+ */ 110 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#bfd255), color-stop(72%,#8eb92a), color-stop(96%,#72aa00), color-stop(100%,#9ecb2d)); /* Chrome,Safari4+ */ 111 | background: -webkit-radial-gradient(center, ellipse cover, #bfd255 0%,#8eb92a 72%,#72aa00 96%,#9ecb2d 100%); /* Chrome10+,Safari5.1+ */ 112 | background: -o-radial-gradient(center, ellipse cover, #bfd255 0%,#8eb92a 72%,#72aa00 96%,#9ecb2d 100%); /* Opera 12+ */ 113 | background: -ms-radial-gradient(center, ellipse cover, #bfd255 0%,#8eb92a 72%,#72aa00 96%,#9ecb2d 100%); /* IE10+ */ 114 | background: radial-gradient(center, ellipse cover, #bfd255 0%,#8eb92a 72%,#72aa00 96%,#9ecb2d 100%); /* W3C */ 115 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bfd255', endColorstr='#9ecb2d',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ 116 | 117 | padding: 40px 0 15px 0; 118 | box-shadow: inset 0 0 10px gray; 119 | } 120 | 121 | .hero-unit h1 122 | { 123 | text-align: center; 124 | font-weight: normal; 125 | text-align: center; 126 | color: white; 127 | text-shadow: black 0px 0px 15px; 128 | } 129 | 130 | .hero-unit h2 131 | { 132 | border: none; 133 | color: white; 134 | background: rgba(48, 48, 48, 0.5); 135 | padding: 0; 136 | margin: 0; 137 | margin-top: 15px; 138 | text-align: center; 139 | } 140 | 141 | .namespace-contents h2, .package-contents h2 142 | { 143 | padding-left: 44px; 144 | background: transparent url('../img/icons/icon-th-big.png') no-repeat 3px center; 145 | } 146 | 147 | .package-contents h2 148 | { 149 | background-image: url('../img/icons/icon-folder-open-big.png'); 150 | } 151 | 152 | .namespace-contents .element h2, .package-contents .element h2 153 | { 154 | padding-left: 0; 155 | background: none; 156 | } 157 | 158 | div.element 159 | { 160 | border-left: 10px solid #55A72F; 161 | border-radius: 5px; 162 | padding: 7px 7px 2px 7px; 163 | margin-bottom: 15px; 164 | margin-left: 0; 165 | } 166 | 167 | div.element.protected 168 | { 169 | border-left-color: orange; 170 | } 171 | 172 | div.element.private 173 | { 174 | border-left-color: red; 175 | } 176 | 177 | div.element.class, div.element.interface 178 | { 179 | border-left-color: #e0e0e0; 180 | } 181 | 182 | div.element.class.abstract h1, div.element.interface.abstract h1 183 | { 184 | font-style: italic; 185 | } 186 | 187 | div.element h1 188 | { 189 | font-size: 1.2em; 190 | line-height: 1.5em; 191 | margin-bottom: 10px; 192 | padding-left: 22px; 193 | background: transparent no-repeat left 2px; 194 | word-wrap: break-word; 195 | } 196 | 197 | div.element h1 a 198 | { 199 | color: transparent; 200 | margin-left: 10px; 201 | } 202 | 203 | div.element h1:hover a 204 | { 205 | color: silver; 206 | } 207 | 208 | div.element h1 a:hover 209 | { 210 | color: navy; 211 | } 212 | 213 | div.element a.more:hover 214 | { 215 | background: #f0f0f0; 216 | color: #444; 217 | text-decoration: none; 218 | } 219 | 220 | div.element a.more 221 | { 222 | font-weight: bold; 223 | text-align: center; 224 | color: gray; 225 | border-top: 1px dashed silver; 226 | display: block; 227 | margin-top: 5px; 228 | padding: 5px 0; 229 | border-bottom-left-radius: 5px; 230 | border-bottom-right-radius: 5px; 231 | } 232 | 233 | div.element p 234 | { 235 | font-size: 0.9em; 236 | } 237 | 238 | div.element .table 239 | { 240 | font-size: 0.9em; 241 | } 242 | 243 | div.element .table th 244 | { 245 | text-transform: capitalize; 246 | } 247 | 248 | div.detail-description 249 | { 250 | padding-left: 30px; 251 | } 252 | 253 | body.invert 254 | { 255 | background: white; 256 | } 257 | 258 | body.invert div.element 259 | { 260 | background: #f9f9f9; 261 | } 262 | 263 | ul.side-nav 264 | { 265 | clear: both; 266 | } 267 | 268 | ul.side-nav li 269 | { 270 | word-wrap: break-word; 271 | padding-left: 10px; 272 | text-indent: -10px; 273 | } 274 | 275 | ul.side-nav li a 276 | { 277 | background: transparent no-repeat 5px 3px; 278 | padding-bottom: 10px; 279 | font-style: italic; 280 | } 281 | 282 | ul.side-nav li pre 283 | { 284 | font-size: 0.8em; 285 | margin: 5px 15px 0 15px; 286 | padding: 2px 5px; 287 | background-color: #f8f8f8; 288 | color: gray; 289 | font-style: normal; 290 | word-wrap: break-word; 291 | text-indent: 0; 292 | } 293 | 294 | ul.side-nav li.view-simple span.description 295 | { 296 | display: none; 297 | } 298 | 299 | ul.side-nav li.view-simple pre 300 | { 301 | font-size: inherit; 302 | margin: inherit; 303 | padding: inherit; 304 | background-color: inherit; 305 | border: none; 306 | color: inherit; 307 | font-family: inherit; 308 | font-style: inherit; 309 | padding-bottom: 0; 310 | padding-left: 5px; 311 | } 312 | 313 | ul.side-nav li.view-simple a 314 | { 315 | padding-bottom: 0px; 316 | } 317 | 318 | i.icon-custom 319 | { 320 | width: 16px; 321 | height: 16px; 322 | background-position: 0; 323 | } 324 | 325 | .table.markers 326 | { 327 | background: white; 328 | } 329 | 330 | /* JS only functionality; disable by default */ 331 | .btn-group.visibility, .btn-group.view, .btn-group.type-filter 332 | { 333 | display: none; 334 | } 335 | 336 | .btn-group.view 337 | { 338 | margin-left: 20px; 339 | margin-bottom: 20px; 340 | } 341 | 342 | .visibility button 343 | { 344 | height: 24px; 345 | } 346 | 347 | div.element.constant h1, 348 | i.icon-constant { background-image: url('../img/icons/constant.png'); } 349 | 350 | div.element.function h1, 351 | i.icon-function { background-image: url('../img/icons/function.png'); } 352 | 353 | div.element.method h1, 354 | i.icon-method { background-image: url('../img/icons/method.png'); } 355 | 356 | div.element.class h1, 357 | i.icon-class { background-image: url('../img/icons/class.png'); } 358 | 359 | div.element.interface h1, 360 | i.icon-interface { background-image: url('../img/icons/interface.png'); } 361 | 362 | div.element.property h1, 363 | i.icon-property { background-image: url('../img/icons/property.png'); } 364 | 365 | i.icon-show-public { background-image: url('../img/icons/visibility_public.png'); } 366 | i.icon-show-protected { background-image: url('../img/icons/visibility_protected.png'); } 367 | i.icon-show-private { background-image: url('../img/icons/visibility_private.png'); } 368 | 369 | span.empty-namespace 370 | { 371 | color: silver; 372 | } 373 | 374 | footer 375 | { 376 | text-align: right; 377 | font-size: 0.8em; 378 | opacity: 0.5; 379 | } 380 | 381 | #mapHolder 382 | { 383 | border: 4px solid #555; 384 | padding: 0 !important; 385 | overflow: hidden 386 | } 387 | 388 | div.element div.subelement 389 | { 390 | margin-left: 10px; 391 | padding-bottom: 5px; 392 | clear: both; 393 | } 394 | 395 | pre code 396 | { 397 | border: none; 398 | } 399 | 400 | div.element div.subelement > code 401 | { 402 | font-size: 0.8em; 403 | float: left; 404 | margin-right: 10px; 405 | padding: 0 5px; 406 | line-height: 16px; 407 | } 408 | 409 | div.element div.subelement > p 410 | { 411 | margin-left: 20px; 412 | margin-right: 50px; 413 | } 414 | 415 | div.element div.subelement h4 416 | { 417 | color: #666; 418 | margin-bottom: 5px; 419 | } 420 | 421 | div.element div.subelement.response 422 | { 423 | padding-bottom: 15px; 424 | margin-right: 50px; 425 | } 426 | 427 | div.labels 428 | { 429 | text-align: right; 430 | } 431 | 432 | .nav-list .nav-header 433 | { 434 | font-size: 13px; 435 | } 436 | 437 | .go_to_top 438 | { 439 | float: right; 440 | margin-right: 20px; 441 | background: #2C2C2C; 442 | color: #999; 443 | padding: 3px 10px; 444 | border-bottom-right-radius: 5px; 445 | border-bottom-left-radius: 5px; 446 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 447 | line-height: 19px; 448 | } 449 | 450 | .visibility .btn { 451 | text-transform: uppercase; 452 | font-size: 0.7em; 453 | font-weight: bold; 454 | } 455 | 456 | .iviewer_common 457 | { 458 | z-index: 100; 459 | } 460 | 461 | @media (min-width: 980px) 462 | { 463 | a[name] 464 | { 465 | margin-top: -50px; 466 | position: absolute; 467 | } 468 | } 469 | 470 | @media (min-width: 1200px) 471 | { 472 | .method .span4 473 | { 474 | width: 345px; 475 | } 476 | } 477 | 478 | /* redefined because twitter bootstrap assumes that bootstrap-responsive.css */ 479 | @media (max-width: 980px) 480 | { 481 | body 482 | { 483 | padding-top: 0; 484 | } 485 | 486 | .go_to_top 487 | { 488 | display: none; 489 | } 490 | 491 | .btn-group.visibility 492 | { 493 | font-size: 0.80em; 494 | margin-bottom: 7px; 495 | display: block; 496 | float: right; 497 | } 498 | } 499 | 500 | @media (max-width: 768px) 501 | { 502 | .hero-unit h1 { 503 | font-size: 30px; 504 | } 505 | .hero-unit h2 { 506 | font-size: 19px; 507 | } 508 | 509 | } 510 | @media (min-width: 768px) and (max-width: 980px) 511 | { 512 | .method .span4 513 | { 514 | width: 203px; 515 | } 516 | } 517 | -------------------------------------------------------------------------------- /doc/img/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /doc/img/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /doc/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/apple-touch-icon.png -------------------------------------------------------------------------------- /doc/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/favicon.ico -------------------------------------------------------------------------------- /doc/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /doc/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /doc/img/icons/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/icons/class.png -------------------------------------------------------------------------------- /doc/img/icons/method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/img/icons/method.png -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » \JSON_API_BuddypressRead_Controller 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 |
30 | 34 |
35 |
36 |
37 | 38 |
39 | 66 |
67 |
68 | 69 |
70 |

Controller-Class for BuddyPressRead

71 |
72 |
73 |

74 |  Methods

75 | 76 |
77 |

Returns an Array with all activities

78 |
activity_get_activities() : array
79 |
80 |
81 |
82 |

Parameters

83 |
84 |

pages

85 | int

pages: number of pages to display (default unset)

86 |
87 |
88 |

offset

89 | int

offset: number of entries per page (default 10 if pages is set, otherwise unset)

90 |
91 |
92 |

limit

93 | int

limit: number of maximum results (default 0 for unlimited)

94 |
95 |
96 |

sort

97 | String

sort: sort ASC or DESC (default DESC)

98 |
99 |
100 |

comments

101 | String

comments: 'stream' for within stream display, 'threaded' for below each activity item (default unset)

102 |
103 |
104 |

userid

105 | Int

userid: userID to filter on, comma-separated for more than one ID (default unset)

106 |
107 |
108 |

component

109 | String

component: object to filter on e.g. groups, profile, status, friends (default unset)

110 |
111 |
112 |

type

113 | String

type: action to filter on e.g. activity_update, profile_updated (default unset)

114 |
115 |
116 |

itemid

117 | int

itemid: object ID to filter on e.g. a group_id or forum_id or blog_id etc. (default unset)

118 |
119 |
120 |

secondaryitemid

121 | int

secondaryitemid: secondary object ID to filter on e.g. a post_id (default unset)

122 |
123 |

Returns

124 |
125 | arrayactivities: an array containing the activities
126 |
127 |
128 |
129 |

Returns an array with friends for the given user

130 |
friends_get_friends() : array
131 |
132 |
133 |
134 |

Parameters

135 |
136 |

username

137 | String

username: the username you want information from (required)

138 |
139 |

Returns

140 |
141 | arrayfriends: array with the friends the user got
142 |
143 |
144 |
145 |

Returns an array with friendship requests for the given user

146 |
friends_get_friendship_request() : array
147 |
148 |
149 |
150 |

Parameters

151 |
152 |

username

153 | String

username: the username you want information from (required)

154 |
155 |

Returns

156 |
157 | arrayfriends: an array containing friends with some mor info
158 |
159 |
160 |
161 |

Returns a string with the status of friendship of the two users

162 |
friends_get_friendship_status() : string
163 |
164 |
165 |
166 |

Parameters

167 |
168 |

username

169 | String

username: the username you want information from (required)

170 |
171 |
172 |

friendname

173 | String

friendname: the name of the possible friend (required)

174 |
175 |

Returns

176 |
177 | stringfriendshipstatus: 'is_friend', 'not_friends' or 'pending'
178 |
179 |
180 |
181 |

Returns an array containing info about the group forum

182 |
groupforum_get_forum() : array
183 |
184 |
185 |
186 |

Parameters

187 |
188 |

forumid

189 | int

forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required)

190 |
191 |
192 |

forumslug

193 | String

forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required)

194 |
195 |

Returns

196 |
197 | arrayforums: the group forum with metainfo
198 |
199 |
200 |
201 |

Returns an array containing info about the group forum

202 |
groupforum_get_forum_by_group() : array
203 |
204 |
205 |
206 |

Parameters

207 |
208 |

groupid

209 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

210 |
211 |
212 |

groupslug

213 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

214 |
215 |

Returns

216 |
217 | arrayforums: the group forum for the group
218 |
219 |
220 |
221 |

Returns an array containing the topics from a group's forum

222 |
groupforum_get_forum_topics() : array
223 |
224 |
225 |
226 |

Parameters

227 |
228 |

forumid

229 | int

forumid: the forumid you are searching for (if not set, forumid is searched; forumid or forumslug required)

230 |
231 |
232 |

forumslug

233 | String

forumslug: the forumslug to search for (just used if forumid is not set; forumid or forumslug required)

234 |
235 |
236 |

page

237 | int

page: the page number you want to display (default 1)

238 |
239 |
240 |

per_page

241 | int

per_page: the number of results you want per page (default 15)

242 |
243 |
244 |

type

245 | String

type: newest, popular, unreplied, tag (default newest)

246 |
247 |
248 |

taqgname

249 | String

tagname: just used if type = tag

250 |
251 |
252 |

detailed

253 | boolean

detailed: true for detailed view (default false)

254 |
255 |

Returns

256 |
257 | arraytopics: all the group forum topics found
258 |
259 |
260 |
261 |

Returns an array containing the posts from a group's forum

262 |
groupforum_get_topic_posts() : array
263 |
264 |
265 |
266 |

Parameters

267 |
268 |

topicid

269 | int

topicid: the topicid you are searching for (if not set, topicslug is searched; topicid or topicslug required)

270 |
271 |
272 |

topicslug

273 | String

topicslug: the slug to search for (just used if topicid is not set; topicid or topicslugs required)

274 |
275 |
276 |

page

277 | int

page: the page number you want to display (default 1)

278 |
279 |
280 |

per_page

281 | int

per_page: the number of results you want per page (default 15)

282 |
283 |
284 |

order

285 | String

order: desc for descending or asc for ascending (default asc)

286 |
287 |

Returns

288 |
289 | arrayposts: all the group forum posts found
290 |
291 |
292 |
293 |

Returns a boolean depending on an existing invite

294 |
groups_check_user_has_invite_to_group() : boolean
295 |
296 |
297 |
298 |

Parameters

299 |
300 |

username

301 | String

username: the username you want information from (required)

302 |
303 |
304 |

groupid

305 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

306 |
307 |
308 |

groupslug

309 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

310 |
311 |
312 |

type

313 | String

type: sent to check for sent invites, all to check for all

314 |

Returns

315 |
316 | booleanis_invited: true if invited, else false
317 |
318 |
319 |
320 |

Returns a boolean depending on an existing memebership request

321 |
groups_check_user_membership_request_to_group() : boolean
322 |
323 |
324 |
325 |

Parameters

326 |
327 |

username

328 | String

username: the username you want information from (required)

329 |
330 |
331 |

groupit

332 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

333 |
334 |
335 |

groupslug

336 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

337 |
338 |

Returns

339 |
340 | booleanmembership_requested: true if requested, else false
341 |
342 |
343 |
344 |

Returns an array containing all admins for the given group

345 |
groups_get_group_admins() : array
346 |
347 |
348 |
349 |

Parameters

350 |
351 |

groupid

352 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

353 |
354 |
355 |

groupslug

356 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

357 |
358 |

Returns

359 |
360 | arraygroup_admins: array containing the admins
361 |
362 |
363 |
364 |

Returns an array containing all members for the given group

365 |
groups_get_group_members() : array
366 |
367 |
368 |
369 |

Parameters

370 |
371 |

groupid

372 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

373 |
374 |
375 |

groupslug

376 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

377 |
378 |
379 |

limit

380 | int

limit: maximum members displayed

381 |

Returns

382 |
383 | arraygroup_members: group members with some more info
384 |
385 |
386 |
387 |

Returns an array containing all mods for the given group

388 |
groups_get_group_mods() : array
389 |
390 |
391 |
392 |

Parameters

393 |
394 |

groupid

395 | int

groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required)

396 |
397 |
398 |

groupslug

399 | String

groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required)

400 |
401 |

Returns

402 |
403 | arraygroup_mods: array containing the mods
404 |
405 |
406 |
407 |

Returns an array with groups matching to the given parameters

408 |
groups_get_groups() : array
409 |
410 |
411 |
412 |

Parameters

413 |
414 |

username

415 | String

username: the username you want information from (default => all groups)

416 |
417 |
418 |

show_hidden

419 | Boolean

show_hidden: Show hidden groups to non-admins (default: false)

420 |
421 |
422 |

type

423 | String

type: active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts (default active)

424 |
425 |
426 |

page

427 | int

page: The page to return if limiting per page (default 1)

428 |
429 |
430 |

per_page

431 | int

per_page: The number of results to return per page (default 20)

432 |
433 |

Returns

434 |
435 | arraygroups: array with meta infos
436 |
437 |
438 |
439 |

Returns an array with messages for the current username

440 |
messages_get_messages() : array
441 |
442 |
443 |
444 |

Parameters

445 |
446 |

box

447 | String

box: the box you the messages are in (possible values are 'inbox', 'sentbox', 'notices', default is 'inbox')

448 |
449 |
450 |

per_page

451 | int

per_page: items to be displayed per page (default 10)

452 |
453 |
454 |

limit

455 | boolean

limit: maximum numbers of emtries (default no limit)

456 |
457 |

Returns

458 |
459 | arraymessages: contains the messages
460 |
461 |
462 |
463 |

Returns an array with notifications for the current user

464 |
notifications_get_notifications() : array
465 |
466 |
467 |
468 |

Returns

469 |
470 | arraynotifications: the notifications as a link
471 |
472 |
473 |
474 |

Returns an array with the profile's fields

475 |
profile_get_profile() : array
476 |
477 |
478 |
479 |

Parameters

480 |
481 |

username

482 | String

username: the username you want information from (required)

483 |
484 |

Returns

485 |
486 | arrayprofilefields: an array containing the profilefields
487 |
488 |
489 |
490 |

Returns the settings for the current user

491 |
settings_get_settings() : object
492 |
493 |
494 |
495 |

Returns

496 |
497 | objectsettings: an object full of the settings
498 |
499 |
500 |
501 |

Returns an array containing all sitewide forums

502 |
sitewideforum_get_all_forums() : array
503 |
504 |
505 |
506 |

Parameters

507 |
508 |

parentid

509 | int

parentid: all children of the given id (default 0 = all)

510 |
511 |

Returns

512 |
513 | arrayforums: all sitewide forums
514 |
515 |
516 |
517 |

Returns an array containing info about the sitewide forum

518 |
sitewideforum_get_forum() : array
519 |
520 |
521 |
522 |

Parameters

523 |
524 |

forumid

525 | int

forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required)

526 |
527 |
528 |

forumslug

529 | String

forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required)

530 |
531 |

Returns

532 |
533 | arrayforums: sitewide forum with some infos
534 |
535 |
536 |
537 |

Returns an array containing all topics of a sitewide forum

538 |
sitewideforum_get_forum_topics() : array
539 |
540 |
541 |
542 |

Parameters

543 |
544 |

forumid

545 | int

forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required)

546 |
547 |
548 |

forumslug

549 | String

forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required)

550 |
551 |
552 |

display_content

553 | boolean

display_content: set this to true if you want the content to be displayed too (default false)

554 |
555 |

Returns

556 |
557 | arrayforums->topics: array of sitewide forums with the topics in it
558 |
559 |
560 |
561 |

Returns an array containing all replies to a topic from a sitewide forum

562 |
sitewideforum_get_topic_replies() : array
563 |
564 |
565 |
566 |

Parameters

567 |
568 |

topicid

569 | int

topicid: the topicid you are searching for (if not set, topicslug is searched; topicid or topicsslug required)

570 |
571 |
572 |

topicslug

573 | String

topicslug: the slug to search for (just used if topicid is not set; topicid or topicslug required)

574 |
575 |
576 |

display_content

577 | boolean

display_content: set this to true if you want the content to be displayed too (default false)

578 |
579 |

Returns

580 |
581 | arraytopics->replies: an array containing the replies
582 |
583 |
584 |
585 |
586 |
587 |
588 |
592 |
593 | 594 | 595 | -------------------------------------------------------------------------------- /doc/js/jquery.mousewheel.min.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.6 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= 13 | d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); -------------------------------------------------------------------------------- /doc/js/prettify/lang-apollo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-apollo.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-go.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-go.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); 4 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-lua.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-lua.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-ml.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-ml.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-scala.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-scala.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-sql.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-sql.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-tex.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-tex.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-vb.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-vb.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-vhdl.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-wiki.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/doc/js/prettify/lang-wiki.js -------------------------------------------------------------------------------- /doc/js/prettify/lang-xq.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], 2 | ["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], 3 | ["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); 4 | -------------------------------------------------------------------------------- /doc/js/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /doc/js/prettify/prettify.min.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p b.innerHTML.toLowerCase() ? 1 : -1; } 77 | // ).appendTo('ol'); 78 | } 79 | 80 | $(document).ready(function() { 81 | prettyPrint(); 82 | 83 | initializeContents(); 84 | 85 | // do not show tooltips on iPad; it will cause the user having to click twice 86 | if(!$.browser.ipad) { 87 | $(".side-nav a").tooltip({'placement': 'top'}); 88 | } 89 | 90 | // chrome cannot deal with certain situations; warn the user about reduced features 91 | if ($.browser.chrome && (window.location.protocol == 'file:')) { 92 | $("body > .container").prepend( 93 | '
×' + 94 | 'You are using Google Chrome in a local environment; AJAX interaction has been ' + 95 | 'disabled because Chrome cannot ' + 96 | 'retrieve files using Ajax.
' 97 | ); 98 | } 99 | 100 | $('ul.nav-namespaces li a, ul.nav-packages li a').click(function(){ 101 | // Google Chrome does not do Ajax locally 102 | if ($.browser.chrome && (window.location.protocol == 'file:')) 103 | { 104 | return true; 105 | } 106 | 107 | $(this).parents('.side-nav').find('.active').removeClass('active'); 108 | $(this).parent().addClass('active'); 109 | $('div.namespace-contents').load( 110 | this.href + ' div.namespace-contents', function(){ 111 | initializeContents(); 112 | $(window).scrollTop($('div.namespace-contents').position().top); 113 | } 114 | ); 115 | $('div.package-contents').load( 116 | this.href + ' div.package-contents', function(){ 117 | initializeContents(); 118 | $(window).scrollTop($('div.package-contents').position().top); 119 | } 120 | ); 121 | 122 | return false; 123 | }); 124 | 125 | function filterPath(string) 126 | { 127 | return string 128 | .replace(/^\//, '') 129 | .replace(/(index|default).[a-zA-Z]{3,4}$/, '') 130 | .replace(/\/$/, ''); 131 | } 132 | 133 | var locationPath = filterPath(location.pathname); 134 | 135 | // the ipad already smoothly scrolls and does not detect the scrollable 136 | // element if top=0; as such we disable this behaviour for the iPad 137 | if (!$.browser.ipad) { 138 | $('a[href*=#]').each(function () 139 | { 140 | var thisPath = filterPath(this.pathname) || locationPath; 141 | if (locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && this.hash.replace(/#/, '')) 142 | { 143 | var target = decodeURIComponent(this.hash.replace(/#/,'')); 144 | // note: I'm using attribute selector, because id selector can't match elements with '$' 145 | var $target = $('[id="'+target+'"]'); 146 | 147 | if ($target.length > 0) 148 | { 149 | $(this).click(function (event) 150 | { 151 | var scrollElem = scrollableElement('html', 'body'); 152 | var targetOffset = $target.offset().top; 153 | 154 | event.preventDefault(); 155 | $(scrollElem).animate({scrollTop:targetOffset}, 400, function () 156 | { 157 | location.hash = target; 158 | }); 159 | }); 160 | } 161 | } 162 | }); 163 | } 164 | 165 | // use the first element that is "scrollable" 166 | function scrollableElement(els) 167 | { 168 | for (var i = 0, argLength = arguments.length; i < argLength; i++) 169 | { 170 | var el = arguments[i], $scrollElement = $(el); 171 | if ($scrollElement.scrollTop() > 0) 172 | { 173 | return el; 174 | } 175 | else 176 | { 177 | $scrollElement.scrollTop(1); 178 | var isScrollable = $scrollElement.scrollTop() > 0; 179 | $scrollElement.scrollTop(0); 180 | if (isScrollable) 181 | { 182 | return el; 183 | } 184 | } 185 | } 186 | return []; 187 | } 188 | }); 189 | -------------------------------------------------------------------------------- /json-api-for-buddypress/controllers/BuddypressRead.php: -------------------------------------------------------------------------------- 1 | init('activity', 'see_activity'); 29 | 30 | if (!bp_has_activities()) 31 | return $this->error('activity'); 32 | if ($this->pages !== 1) { 33 | $aParams ['max'] = true; 34 | $aParams ['per_page'] = $this->offset; 35 | $iPages = $this->pages; 36 | } 37 | 38 | $aParams ['display_comments'] = $this->comments; 39 | $aParams ['sort'] = $this->sort; 40 | 41 | $aParams ['filter'] ['user_id'] = $this->userid; 42 | $aParams ['filter'] ['object'] = $this->component; 43 | $aParams ['filter'] ['action'] = $this->type; 44 | $aParams ['filter'] ['primary_id'] = $this->itemid; 45 | $aParams ['filter'] ['secondary_id'] = $this->secondaryitemid; 46 | $iLimit = $this->limit; 47 | 48 | if ($this->pages === 1) { 49 | $aParams ['page'] = 1; 50 | if ($iLimit != 0) 51 | $aParams['per_page'] = $iLimit; 52 | $aTempActivities = bp_activity_get($aParams); 53 | 54 | 55 | if (!empty($aTempActivities['activities'])) { 56 | foreach ($aTempActivities['activities'] as $oActivity) { 57 | $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component; 58 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login; 59 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email; 60 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name; 61 | $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type; 62 | $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded; 63 | $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === "0" ? false : true; 64 | $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === "0" ? false : true; 65 | } 66 | $oReturn->count = count($aTempActivities['activities']); 67 | } else { 68 | return $this->error('activity'); 69 | } 70 | return $oReturn; 71 | } 72 | 73 | for ($i = 1; $i <= $iPages; $i++) { 74 | if ($iLimit != 0 && ($i * $aParams['per_page']) > $iLimit) { 75 | $aParams['per_page'] = $aParams['per_page'] - (($i * $aParams['per_page']) - $iLimit); 76 | $bLastRun = true; 77 | } 78 | $aParams ['page'] = $i; 79 | $aTempActivities = bp_activity_get($aParams); 80 | if (empty($aTempActivities['activities'])) { 81 | if ($i == 1) 82 | return $this->error('activity'); 83 | else 84 | break; 85 | } 86 | else { 87 | foreach ($aTempActivities['activities'] as $oActivity) { 88 | $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component; 89 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login; 90 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email; 91 | $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name; 92 | $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type; 93 | $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded; 94 | $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === "0" ? false : true; 95 | $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === "0" ? false : true; 96 | } 97 | $oReturn->count = count($aTempActivities['activities']); 98 | if ($bLastRun) 99 | break; 100 | } 101 | } 102 | 103 | return $oReturn; 104 | } 105 | 106 | /** 107 | * Returns an array with the profile's fields 108 | * @param String username: the username you want information from (required) 109 | * @return array profilefields: an array containing the profilefields 110 | */ 111 | public function profile_get_profile() { 112 | $this->init('xprofile'); 113 | $oReturn = new stdClass(); 114 | 115 | if ($this->username === false || !username_exists($this->username)) { 116 | return $this->error('xprofile', 1); 117 | } 118 | 119 | $oUser = get_user_by('login', $this->username); 120 | 121 | if (!bp_has_profile(array('user_id' => $oUser->data->ID))) { 122 | return $this->error('xprofile', 0); 123 | } 124 | 125 | while (bp_profile_groups(array('user_id' => $oUser->data->ID))) { 126 | bp_the_profile_group(); 127 | if (bp_profile_group_has_fields()) { 128 | $sGroupName = bp_get_the_profile_group_name(); 129 | while (bp_profile_fields()) { 130 | bp_the_profile_field(); 131 | $sFieldName = bp_get_the_profile_field_name(); 132 | if (bp_field_has_data()) { 133 | $sFieldValue = bp_get_the_profile_field_value(); 134 | } 135 | $oReturn->profilefields->$sGroupName->$sFieldName = $sFieldValue; 136 | } 137 | } 138 | } 139 | return $oReturn; 140 | } 141 | 142 | /** 143 | * Returns an array with messages for the current username 144 | * @param String box: the box you the messages are in (possible values are 'inbox', 'sentbox', 'notices', default is 'inbox') 145 | * @param int per_page: items to be displayed per page (default 10) 146 | * @param boolean limit: maximum numbers of emtries (default no limit) 147 | * @return array messages: contains the messages 148 | */ 149 | public function messages_get_messages() { 150 | $this->init('messages'); 151 | $oReturn = new stdClass(); 152 | 153 | $aParams ['box'] = $this->box; 154 | $aParams ['per_page'] = $this->per_page; 155 | $aParams ['max'] = $this->limit; 156 | 157 | if (bp_has_message_threads($aParams)) { 158 | while (bp_message_threads()) { 159 | bp_message_thread(); 160 | $aTemp = new stdClass(); 161 | preg_match("#>(.*?)<#", bp_get_message_thread_from(), $aFrom); 162 | $oUser = get_user_by('login', $aFrom[1]); 163 | $aTemp->from[(int) $oUser->data->ID]->username = $aFrom[1]; 164 | $aTemp->from[(int) $oUser->data->ID]->mail = $oUser->data->user_email; 165 | $aTemp->from[(int) $oUser->data->ID]->display_name = $oUser->data->display_name; 166 | preg_match("#>(.*?)<#", bp_get_message_thread_to(), $aTo); 167 | $oUser = get_user_by('login', $aTo[1]); 168 | $aTemp->to[(int) $oUser->data->ID]->username = $aTo[1]; 169 | $aTemp->to[(int) $oUser->data->ID]->mail = $oUser->data->user_email; 170 | $aTemp->to[(int) $oUser->data->ID]->display_name = $oUser->data->display_name; 171 | $aTemp->subject = bp_get_message_thread_subject(); 172 | $aTemp->excerpt = bp_get_message_thread_excerpt(); 173 | $aTemp->link = bp_get_message_thread_view_link(); 174 | 175 | $oReturn->messages [(int) bp_get_message_thread_id()] = $aTemp; 176 | } 177 | } else { 178 | return $this->error('messages'); 179 | } 180 | return $oReturn; 181 | } 182 | 183 | /** 184 | * Returns an array with notifications for the current user 185 | * @param none there are no parameters to be used 186 | * @return array notifications: the notifications as a link 187 | */ 188 | public function notifications_get_notifications() { 189 | $this->init('notifications'); 190 | $oReturn = new stdClass(); 191 | 192 | $aNotifications = bp_core_get_notifications_for_user(get_current_user_id()); 193 | 194 | if (empty($aNotifications)) { 195 | return $this->error('notifications'); 196 | } 197 | 198 | foreach ($aNotifications as $sNotificationMessage) { 199 | $oReturn->notifications [] = $sNotificationMessage; 200 | } 201 | $oReturn->count = count($aNotifications); 202 | 203 | return $oReturn; 204 | } 205 | 206 | /** 207 | * Returns an array with friends for the given user 208 | * @param String username: the username you want information from (required) 209 | * @return array friends: array with the friends the user got 210 | */ 211 | public function friends_get_friends() { 212 | $this->init('friends'); 213 | $oReturn = new stdClass(); 214 | 215 | if ($this->username === false || !username_exists($this->username)) { 216 | return $this->error('friends', 0); 217 | } 218 | 219 | $oUser = get_user_by('login', $this->username); 220 | 221 | $sFriends = bp_get_friend_ids($oUser->data->ID); 222 | $aFriends = explode(",", $sFriends); 223 | if ($aFriends[0] == "") 224 | return $this->error('friends', 1); 225 | foreach ($aFriends as $sFriendID) { 226 | $oUser = get_user_by('id', $sFriendID); 227 | $oReturn->friends [(int) $sFriendID]->username = $oUser->data->user_login; 228 | $oReturn->friends [(int) $sFriendID]->display_name = $oUser->data->display_name; 229 | $oReturn->friends [(int) $sFriendID]->mail = $oUser->data->user_email; 230 | } 231 | $oReturn->count = count($aFriends); 232 | return $oReturn; 233 | } 234 | 235 | /** 236 | * Returns an array with friendship requests for the given user 237 | * @params String username: the username you want information from (required) 238 | * @return array friends: an array containing friends with some mor info 239 | */ 240 | public function friends_get_friendship_request() { 241 | $this->init('friends'); 242 | $oReturn = new stdClass(); 243 | 244 | if ($this->username === false || !username_exists($this->username)) { 245 | return $this->error('friends', 0); 246 | } 247 | $oUser = get_user_by('login', $this->username); 248 | 249 | if (!is_user_logged_in() || get_current_user_id() != $oUser->data->ID) 250 | return $this->error('base', 0); 251 | 252 | $sFriends = bp_get_friendship_requests($oUser->data->ID); 253 | $aFriends = explode(",", $sFriends); 254 | 255 | if ($aFriends[0] == "0") 256 | return $this->error('friends', 2); 257 | foreach ($aFriends as $sFriendID) { 258 | $oUser = get_user_by('id', $sFriendID); 259 | $oReturn->friends [(int) $sFriendID]->username = $oUser->data->user_login; 260 | $oReturn->friends [(int) $sFriendID]->display_name = $oUser->data->display_name; 261 | $oReturn->friends [(int) $sFriendID]->mail = $oUser->data->user_email; 262 | } 263 | $oReturn->count = count($oReturn->friends); 264 | return $oReturn; 265 | } 266 | 267 | /** 268 | * Returns a string with the status of friendship of the two users 269 | * @param String username: the username you want information from (required) 270 | * @param String friendname: the name of the possible friend (required) 271 | * @return string friendshipstatus: 'is_friend', 'not_friends' or 'pending' 272 | */ 273 | public function friends_get_friendship_status() { 274 | $this->init('friends'); 275 | $oReturn = new stdClass(); 276 | 277 | if ($this->username === false || !username_exists($this->username)) { 278 | return $this->error('friends', 0); 279 | } 280 | 281 | if ($this->friendname === false || !username_exists($this->friendname)) { 282 | return $this->error('friends', 3); 283 | } 284 | 285 | $oUser = get_user_by('login', $this->username); 286 | $oUserFriend = get_user_by('login', $this->friendname); 287 | 288 | $oReturn->friendshipstatus = friends_check_friendship_status($oUser->data->ID, $oUserFriend->data->ID); 289 | return $oReturn; 290 | } 291 | 292 | /** 293 | * Returns an array with groups matching to the given parameters 294 | * @param String username: the username you want information from (default => all groups) 295 | * @param Boolean show_hidden: Show hidden groups to non-admins (default: false) 296 | * @param String type: active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts (default active) 297 | * @param int page: The page to return if limiting per page (default 1) 298 | * @param int per_page: The number of results to return per page (default 20) 299 | * @return array groups: array with meta infos 300 | */ 301 | public function groups_get_groups() { 302 | $this->init('groups'); 303 | $oReturn = new stdClass(); 304 | 305 | if ($this->username !== false || username_exists($this->username)) { 306 | $oUser = get_user_by('login', $this->username); 307 | $aParams ['user_id'] = $oUser->data->ID; 308 | } 309 | 310 | $aParams ['show_hidden'] = $this->show_hidden; 311 | $aParams ['type'] = $this->type; 312 | $aParams ['page'] = $this->page; 313 | $aParams ['per_page'] = $this->per_page; 314 | 315 | $aGroups = groups_get_groups($aParams); 316 | 317 | if ($aGroups['total'] == "0") 318 | return $this->error('groups', 0); 319 | 320 | foreach ($aGroups['groups'] as $aGroup) { 321 | $oReturn->groups[(int) $aGroup->id]->name = $aGroup->name; 322 | $oReturn->groups[(int) $aGroup->id]->description = $aGroup->description; 323 | $oReturn->groups[(int) $aGroup->id]->status = $aGroup->status; 324 | if ($aGroup->status == "private" && !is_user_logged_in() && !$aGroup->is_member === true) 325 | continue; 326 | $oUser = get_user_by('id', $aGroup->creator_id); 327 | $oReturn->groups[(int) $aGroup->id]->creator[(int) $aGroup->creator_id]->username = $oUser->data->user_login; 328 | $oReturn->groups[(int) $aGroup->id]->creator[(int) $aGroup->creator_id]->mail = $oUser->data->user_email; 329 | $oReturn->groups[(int) $aGroup->id]->creator[(int) $aGroup->creator_id]->display_name = $oUser->data->display_name; 330 | $oReturn->groups[(int) $aGroup->id]->slug = $aGroup->slug; 331 | $oReturn->groups[(int) $aGroup->id]->is_forum_enabled = $aGroup->enable_forum == "1" ? true : false; 332 | $oReturn->groups[(int) $aGroup->id]->date_created = $aGroup->date_created; 333 | $oReturn->groups[(int) $aGroup->id]->count_member = $aGroup->total_member_count; 334 | } 335 | 336 | $oReturn->count = count($aGroups['groups']); 337 | 338 | return $oReturn; 339 | } 340 | 341 | /** 342 | * Returns a boolean depending on an existing invite 343 | * @param String username: the username you want information from (required) 344 | * @param int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 345 | * @param String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 346 | * @param String type: sent to check for sent invites, all to check for all 347 | * @return boolean is_invited: true if invited, else false 348 | */ 349 | public function groups_check_user_has_invite_to_group() { 350 | $this->init('groups'); 351 | 352 | $oReturn = new stdClass(); 353 | 354 | if ($this->username === false || !username_exists($this->username)) { 355 | return $this->error('groups', 1); 356 | } 357 | $oUser = get_user_by('login', $this->username); 358 | 359 | $mGroupName = $this->get_group_from_params(); 360 | 361 | if ($mGroupName !== true) 362 | return $this->error('groups', $mGroupName); 363 | 364 | if ($this->type === false || $this->type != "sent" || $this->type != "all") 365 | $this->type = 'sent'; 366 | 367 | $oReturn->is_invited = groups_check_user_has_invite((int) $oUser->data->ID, $this->groupid, $this->type); 368 | $oReturn->is_invited = is_null($oReturn->is_invited) ? false : true; 369 | 370 | return $oReturn; 371 | } 372 | 373 | /** 374 | * Returns a boolean depending on an existing memebership request 375 | * @param String username: the username you want information from (required) 376 | * @param int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 377 | * @param String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 378 | * @return boolean membership_requested: true if requested, else false 379 | */ 380 | public function groups_check_user_membership_request_to_group() { 381 | $this->init('groups'); 382 | 383 | $oReturn = new stdClass(); 384 | 385 | if ($this->username === false || !username_exists($this->username)) { 386 | return $this->error('groups', 1); 387 | } 388 | $oUser = get_user_by('login', $this->username); 389 | 390 | $mGroupName = $this->get_group_from_params(); 391 | 392 | if ($mGroupName !== true) 393 | return $this->error('groups', $mGroupName); 394 | 395 | $oReturn->membership_requested = groups_check_for_membership_request((int) $oUser->data->ID, $this->groupid); 396 | $oReturn->membership_requested = is_null($oReturn->membership_requested) ? false : true; 397 | 398 | return $oReturn; 399 | } 400 | 401 | /** 402 | * Returns an array containing all admins for the given group 403 | * @param int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 404 | * @param String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 405 | * @return array group_admins: array containing the admins 406 | */ 407 | public function groups_get_group_admins() { 408 | $this->init('groups'); 409 | 410 | $oReturn = new stdClass(); 411 | 412 | $mGroupExists = $this->get_group_from_params(); 413 | 414 | if ($mGroupExists === false) 415 | return $this->error('base', 0); 416 | else if (is_int($mGroupExists) && $mGroupExists !== true) 417 | return $this->error('groups', $mGroupExists); 418 | 419 | $aGroupAdmins = groups_get_group_admins($this->groupid); 420 | foreach ($aGroupAdmins as $oGroupAdmin) { 421 | $oUser = get_user_by('id', $oGroupAdmin->user_id); 422 | $oReturn->group_admins[(int) $oGroupAdmin->user_id]->username = $oUser->data->user_login; 423 | $oReturn->group_admins[(int) $oGroupAdmin->user_id]->mail = $oUser->data->user_email; 424 | $oReturn->group_admins[(int) $oGroupAdmin->user_id]->display_name = $oUser->data->display_name; 425 | } 426 | $oReturn->count = count($aGroupAdmins); 427 | return $oReturn; 428 | } 429 | 430 | /** 431 | * Returns an array containing all mods for the given group 432 | * @params int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 433 | * @params String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 434 | * @return array group_mods: array containing the mods 435 | */ 436 | public function groups_get_group_mods() { 437 | $this->init('groups'); 438 | 439 | $oReturn = new stdClass(); 440 | 441 | $mGroupExists = $this->get_group_from_params(); 442 | 443 | if ($mGroupExists === false) 444 | return $this->error('base', 0); 445 | else if (is_int($mGroupExists) && $mGroupExists !== true) 446 | return $this->error('groups', $mGroupExists); 447 | 448 | $oReturn->group_mods = groups_get_group_mods($this->groupid); 449 | $aGroupMods = groups_get_group_mods($this->groupid); 450 | foreach ($aGroupMods as $aGroupMod) { 451 | $oUser = get_user_by('id', $aGroupMod->user_id); 452 | $oReturn->group_mods[(int) $aGroupMod->user_id]->username = $oUser->data->user_login; 453 | $oReturn->group_mods[(int) $aGroupMod->user_id]->mail = $oUser->data->user_email; 454 | $oReturn->group_mods[(int) $aGroupMod->user_id]->display_name = $oUser->data->display_name; 455 | } 456 | return $oReturn; 457 | } 458 | 459 | /** 460 | * Returns an array containing all members for the given group 461 | * @params int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 462 | * @params String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 463 | * @params int limit: maximum members displayed 464 | * @return array group_members: group members with some more info 465 | */ 466 | public function groups_get_group_members() { 467 | $this->init('groups'); 468 | 469 | $oReturn = new stdClass(); 470 | 471 | $mGroupExists = $this->get_group_from_params(); 472 | 473 | if ($mGroupExists === false) 474 | return $this->error('base', 0); 475 | else if (is_int($mGroupExists) && $mGroupExists !== true) 476 | return $this->error('groups', $mGroupExists); 477 | 478 | $aMembers = groups_get_group_members($this->groupid, $this->limit); 479 | if ($aMembers === false) { 480 | $oReturn->group_members = array(); 481 | $oReturn->count = 0; 482 | return $oReturn; 483 | } 484 | 485 | foreach ($aMembers['members'] as $aMember) { 486 | $oReturn->group_members[(int) $aMember->user_id]->username = $aMember->user_login; 487 | $oReturn->group_members[(int) $aMember->user_id]->mail = $aMember->user_email; 488 | $oReturn->group_members[(int) $aMember->user_id]->display_name = $aMember->display_name; 489 | } 490 | $oReturn->count = $aMembers['count']; 491 | 492 | return $oReturn; 493 | } 494 | 495 | /** 496 | * Returns an array containing info about the group forum 497 | * @param int forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required) 498 | * @param String forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required) 499 | * @return array forums: the group forum with metainfo 500 | */ 501 | public function groupforum_get_forum() { 502 | $this->init('forums'); 503 | 504 | $oReturn = new stdClass(); 505 | 506 | $mForumExists = $this->groupforum_check_forum_existence(); 507 | 508 | if ($mForumExists === false) 509 | return $this->error('base', 0); 510 | else if (is_int($mForumExists) && $mForumExists !== true) 511 | return $this->error('forums', $mForumExists); 512 | 513 | $oForum = bp_forums_get_forum((int) $this->forumid); 514 | 515 | $oReturn->forums[(int) $oForum->forum_id]->name = $oForum->forum_name; 516 | $oReturn->forums[(int) $oForum->forum_id]->slug = $oForum->forum_slug; 517 | $oReturn->forums[(int) $oForum->forum_id]->description = $oForum->forum_desc; 518 | $oReturn->forums[(int) $oForum->forum_id]->topics_count = (int) $oForum->topics; 519 | $oReturn->forums[(int) $oForum->forum_id]->post_count = (int) $oForum->posts; 520 | return $oReturn; 521 | } 522 | 523 | /** 524 | * Returns an array containing info about the group forum 525 | * @param int groupid: the groupid you are searching for (if not set, groupslug is searched; groupid or groupslug required) 526 | * @param String groupslug: the slug to search for (just used if groupid is not set; groupid or groupslug required) 527 | * @return array forums: the group forum for the group 528 | */ 529 | public function groupforum_get_forum_by_group() { 530 | $this->init('forums'); 531 | 532 | $oReturn = new stdClass(); 533 | 534 | $mGroupExists = $this->get_group_from_params(); 535 | 536 | if ($mGroupExists === false) 537 | return $this->error('base', 0); 538 | else if (is_int($mGroupExists) && $mGroupExists !== true) 539 | return $this->error('forums', $mGroupExists); 540 | 541 | $oGroup = groups_get_group(array('group_id' => $this->groupid)); 542 | if ($oGroup->enable_forum == "0") 543 | return $this->error('forums', 0); 544 | $iForumId = groups_get_groupmeta($oGroup->id, 'forum_id'); 545 | if ($iForumId == "0") 546 | return $this->error('forums', 1); 547 | $oForum = bp_forums_get_forum((int) $iForumId); 548 | 549 | $oReturn->forums[(int) $oForum->forum_id]->name = $oForum->forum_name; 550 | $oReturn->forums[(int) $oForum->forum_id]->slug = $oForum->forum_slug; 551 | $oReturn->forums[(int) $oForum->forum_id]->description = $oForum->forum_desc; 552 | $oReturn->forums[(int) $oForum->forum_id]->topics_count = (int) $oForum->topics; 553 | $oReturn->forums[(int) $oForum->forum_id]->post_count = (int) $oForum->posts; 554 | return $oReturn; 555 | } 556 | 557 | /** 558 | * Returns an array containing the topics from a group's forum 559 | * @param int forumid: the forumid you are searching for (if not set, forumid is searched; forumid or forumslug required) 560 | * @param String forumslug: the forumslug to search for (just used if forumid is not set; forumid or forumslug required) 561 | * @param int page: the page number you want to display (default 1) 562 | * @param int per_page: the number of results you want per page (default 15) 563 | * @param String type: newest, popular, unreplied, tag (default newest) 564 | * @param String tagname: just used if type = tag 565 | * @param boolean detailed: true for detailed view (default false) 566 | * @return array topics: all the group forum topics found 567 | */ 568 | public function groupforum_get_forum_topics() { 569 | $this->init('forums'); 570 | 571 | $oReturn = new stdClass(); 572 | 573 | $mForumExists = $this->groupforum_check_forum_existence(); 574 | 575 | if ($mForumExists === false) 576 | return $this->error('base', 0); 577 | else if (is_int($mForumExists) && $mForumExists !== true) 578 | return $this->error('forums', $mForumExists); 579 | 580 | $aConfig = array(); 581 | $aConfig['type'] = $this->type; 582 | $aConfig['filter'] = $this->type == 'tag' ? $this->tagname : false; 583 | $aConfig['forum_id'] = $this->forumid; 584 | $aConfig['page'] = $this->page; 585 | $aConfig['per_page'] = $this->per_page; 586 | 587 | $aTopics = bp_forums_get_forum_topics($aConfig); 588 | if (is_null($aTopics)) 589 | $this->error('forums', 7); 590 | foreach ($aTopics as $aTopic) { 591 | $oReturn->topics[(int) $aTopic->topic_id]->title = $aTopic->topic_title; 592 | $oReturn->topics[(int) $aTopic->topic_id]->slug = $aTopic->topic_slug; 593 | $oUser = get_user_by('id', $aTopic->topic_poster); 594 | $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->username = $oUser->data->user_login; 595 | $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->mail = $oUser->data->user_email; 596 | $oReturn->topics[(int) $aTopic->topic_id]->poster[(int) $oUser->data->ID]->display_name = $oUser->data->display_name; 597 | $oReturn->topics[(int) $aTopic->topic_id]->post_count = (int) $aTopic->topic_posts; 598 | if ($this->detailed === true) { 599 | $oTopic = bp_forums_get_topic_details($aTopic->topic_id); 600 | 601 | $oUser = get_user_by('id', $oTopic->topic_last_poster); 602 | $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->username = $oUser->data->user_login; 603 | $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->mail = $oUser->data->user_email; 604 | $oReturn->topics[(int) $aTopic->topic_id]->last_poster[(int) $oTopic->topic_last_poster]->display_name = $oUser->data->display_name; 605 | $oReturn->topics[(int) $aTopic->topic_id]->start_time = $oTopic->topic_start_time; 606 | $oReturn->topics[(int) $aTopic->topic_id]->forum_id = (int) $oTopic->forum_id; 607 | $oReturn->topics[(int) $aTopic->topic_id]->topic_status = $oTopic->topic_status; 608 | $oReturn->topics[(int) $aTopic->topic_id]->is_open = (int) $oTopic->topic_open === 1 ? true : false; 609 | $oReturn->topics[(int) $aTopic->topic_id]->is_sticky = (int) $oTopic->topic_sticky === 1 ? true : false; 610 | } 611 | } 612 | $oReturn->count = count($aTopics); 613 | return $oReturn; 614 | } 615 | 616 | /** 617 | * Returns an array containing the posts from a group's forum 618 | * @param int topicid: the topicid you are searching for (if not set, topicslug is searched; topicid or topicslug required) 619 | * @param String topicslug: the slug to search for (just used if topicid is not set; topicid or topicslugs required) 620 | * @param int page: the page number you want to display (default 1) 621 | * @param int per_page: the number of results you want per page (default 15) 622 | * @param String order: desc for descending or asc for ascending (default asc) 623 | * @return array posts: all the group forum posts found 624 | */ 625 | public function groupforum_get_topic_posts() { 626 | $this->init('forums'); 627 | 628 | $oReturn = new stdClass(); 629 | 630 | $mTopicExists = $this->groupforum_check_topic_existence(); 631 | if ($mTopicExists === false) 632 | return $this->error('base', 0); 633 | else if (is_int($mTopicExists) && $mTopicExists !== true) 634 | return $this->error('forums', $mTopicExists); 635 | 636 | $aConfig = array(); 637 | $aConfig['topic_id'] = $this->topicid; 638 | $aConfig['page'] = $this->page; 639 | $aConfig['per_page'] = $this->per_page; 640 | $aConfig['order'] = $this->order; 641 | $aPosts = bp_forums_get_topic_posts($aConfig); 642 | 643 | foreach ($aPosts as $oPost) { 644 | $oReturn->posts[(int) $oPost->post_id]->topicid = (int) $oPost->topic_id; 645 | $oUser = get_user_by('id', (int) $oPost->poster_id); 646 | $oReturn->posts[(int) $oPost->post_id]->poster[(int) $oPost->poster_id]->username = $oUser->data->user_login; 647 | $oReturn->posts[(int) $oPost->post_id]->poster[(int) $oPost->poster_id]->mail = $oUser->data->user_email; 648 | $oReturn->posts[(int) $oPost->post_id]->poster[(int) $oPost->poster_id]->display_name = $oUser->data->display_name; 649 | $oReturn->posts[(int) $oPost->post_id]->post_text = $oPost->post_text; 650 | $oReturn->posts[(int) $oPost->post_id]->post_time = $oPost->post_time; 651 | $oReturn->posts[(int) $oPost->post_id]->post_position = (int) $oPost->post_position; 652 | } 653 | $oReturn->count = count($aPosts); 654 | 655 | return $oReturn; 656 | } 657 | 658 | /** 659 | * Returns an array containing info about the sitewide forum 660 | * @param int forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required) 661 | * @param String forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required) 662 | * @return array forums: sitewide forum with some infos 663 | */ 664 | public function sitewideforum_get_forum() { 665 | $this->init('forums'); 666 | 667 | $oReturn = new stdClass(); 668 | 669 | $mForumExists = $this->sitewideforum_check_forum_existence(); 670 | 671 | if ($mForumExists !== true) 672 | return $this->error('forums', $mForumExists); 673 | foreach ($this->forumid as $iId) { 674 | $oForum = bbp_get_forum((int) $iId); 675 | $oReturn->forums[$iId]->title = $oForum->post_title; 676 | $oReturn->forums[$iId]->name = $oForum->post_name; 677 | $oUser = get_user_by('id', $oForum->post_author); 678 | $oReturn->forums[$iId]->author[$oForum->post_author]->username = $oUser->data->user_login; 679 | $oReturn->forums[$iId]->author[$oForum->post_author]->mail = $oUser->data->user_email; 680 | $oReturn->forums[$iId]->author[$oForum->post_author]->display_name = $oUser->data->display_name; 681 | $oReturn->forums[$iId]->date = $oForum->post_date; 682 | $oReturn->forums[$iId]->last_change = $oForum->post_modified; 683 | $oReturn->forums[$iId]->status = $oForum->post_status; 684 | $oReturn->forums[$iId]->name = $oForum->post_name; 685 | $iTopicCount = bbp_get_forum_topic_count((int) $this->forumid); 686 | $oReturn->forums[$iId]->topics_count = is_null($iTopicCount) ? 0 : (int) $iTopicCount; 687 | $iPostCount = bbp_get_forum_post_count((int) $this->forumid); 688 | $oReturn->forums[$iId]->post_count = is_null($iPostCount) ? 0 : (int) $iPostCount; 689 | } 690 | 691 | return $oReturn; 692 | } 693 | 694 | /** 695 | * Returns an array containing all sitewide forums 696 | * @params int parentid: all children of the given id (default 0 = all) 697 | * @return array forums: all sitewide forums 698 | */ 699 | public function sitewideforum_get_all_forums() { 700 | $this->init('forums'); 701 | 702 | $oReturn = new stdClass(); 703 | global $wpdb; 704 | $sParentQuery = $this->parentid === false ? "" : " AND post_parent=" . (int) $this->parentid; 705 | $aForums = $wpdb->get_results($wpdb->prepare( 706 | "SELECT ID, post_parent, post_author, post_title, post_date, post_modified 707 | FROM $wpdb->posts 708 | WHERE post_type='forum'" . $sParentQuery 709 | )); 710 | 711 | if (empty($aForums)) 712 | return $this->error('forums', 9); 713 | 714 | foreach ($aForums as $aForum) { 715 | $iId = (int) $aForum->ID; 716 | $oUser = get_user_by('id', (int) $aForum->post_author); 717 | $oReturn->forums[$iId]->author[(int) $aForum->post_author]->username = $oUser->data->user_login; 718 | $oReturn->forums[$iId]->author[(int) $aForum->post_author]->mail = $oUser->data->user_email; 719 | $oReturn->forums[$iId]->author[(int) $aForum->post_author]->display_name = $oUser->data->display_name; 720 | $oReturn->forums[$iId]->date = $aForum->post_date; 721 | $oReturn->forums[$iId]->last_changes = $aForum->post_modified; 722 | $oReturn->forums[$iId]->title = $aForum->post_title; 723 | $oReturn->forums[$iId]->parent = (int) $aForum->post_parent; 724 | } 725 | $oReturn->count = count($aForums); 726 | return $oReturn; 727 | } 728 | 729 | /** 730 | * Returns an array containing all topics of a sitewide forum 731 | * @param int forumid: the forumid you are searching for (if not set, forumslug is searched; forumid or forumslug required) 732 | * @param String forumslug: the slug to search for (just used if forumid is not set; forumid or forumslug required) 733 | * @param boolean display_content: set this to true if you want the content to be displayed too (default false) 734 | * @return array forums->topics: array of sitewide forums with the topics in it 735 | */ 736 | public function sitewideforum_get_forum_topics() { 737 | $this->init('forums'); 738 | 739 | $oReturn = new stdClass(); 740 | 741 | $mForumExists = $this->sitewideforum_check_forum_existence(); 742 | 743 | if ($mForumExists !== true) 744 | return $this->error('forums', $mForumExists); 745 | global $wpdb; 746 | foreach ($this->forumid as $iId) { 747 | $aTopics = $wpdb->get_results($wpdb->prepare( 748 | "SELECT ID, post_parent, post_author, post_title, post_date, post_modified, post_content 749 | FROM $wpdb->posts 750 | WHERE post_type='topic' 751 | AND post_parent='" . $iId . "'" 752 | )); 753 | if (empty($aTopics)) { 754 | $oReturn->forums[(int) $iId]->topics = ""; 755 | continue; 756 | } 757 | foreach ($aTopics as $aTopic) { 758 | $oUser = get_user_by('id', (int) $aTopic->post_author); 759 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->author[(int) $aTopic->post_author]->username = $oUser->data->user_login; 760 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->author[(int) $aTopic->post_author]->mail = $oUser->data->user_email; 761 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->author[(int) $aTopic->post_author]->display_name = $oUser->data->display_name; 762 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->date = $aTopic->post_date; 763 | if ($this->display_content !== false) 764 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->content = $aTopic->post_content; 765 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->last_changes = $aTopic->post_modified; 766 | $oReturn->forums[(int) $iId]->topics[(int) $aTopic->ID]->title = $aTopic->post_title; 767 | } 768 | $oReturn->forums[(int) $iId]->count = count($aTopics); 769 | } 770 | return $oReturn; 771 | } 772 | 773 | /** 774 | * Returns an array containing all replies to a topic from a sitewide forum 775 | * @param int topicid: the topicid you are searching for (if not set, topicslug is searched; topicid or topicsslug required) 776 | * @param String topicslug: the slug to search for (just used if topicid is not set; topicid or topicslug required) 777 | * @param boolean display_content: set this to true if you want the content to be displayed too (default false) 778 | * @return array topics->replies: an array containing the replies 779 | */ 780 | public function sitewideforum_get_topic_replies() { 781 | $this->init('forums'); 782 | 783 | $oReturn = new stdClass(); 784 | 785 | $mForumExists = $this->sitewideforum_check_topic_existence(); 786 | 787 | if ($mForumExists !== true) 788 | return $this->error('forums', $mForumExists); 789 | foreach ($this->topicid as $iId) { 790 | global $wpdb; 791 | $aReplies = $wpdb->get_results($wpdb->prepare( 792 | "SELECT ID, post_parent, post_author, post_title, post_date, post_modified, post_content 793 | FROM $wpdb->posts 794 | WHERE post_type='reply' 795 | AND post_parent='" . $iId . "'" 796 | )); 797 | 798 | if (empty($aReplies)) { 799 | $oReturn->topics[$iId]->replies = ""; 800 | $oReturn->topics[$iId]->count = 0; 801 | continue; 802 | } 803 | foreach ($aReplies as $oReply) { 804 | $oUser = get_user_by('id', (int) $oReply->post_author); 805 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->author[(int) $oReply->post_author]->username = $oUser->data->user_login; 806 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->author[(int) $oReply->post_author]->mail = $oUser->data->user_email; 807 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->author[(int) $oReply->post_author]->display_name = $oUser->data->display_name; 808 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->date = $oReply->post_date; 809 | if ($this->display_content !== false) 810 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->content = $oReply->post_content; 811 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->last_changes = $oReply->post_modified; 812 | $oReturn->topics[$iId]->replies[(int) $oReply->ID]->title = $oReply->post_title; 813 | } 814 | $oReturn->topics[$iId]->count = count($aReplies); 815 | } 816 | 817 | return $oReturn; 818 | } 819 | 820 | /** 821 | * Returns the settings for the current user 822 | * @params none no parameters 823 | * @return object settings: an object full of the settings 824 | */ 825 | public function settings_get_settings() { 826 | $this->init('settings'); 827 | $oReturn = new stdClass(); 828 | 829 | if ($this->username === false || !username_exists($this->username)) { 830 | return $this->error('settings', 0); 831 | } 832 | 833 | $oUser = get_user_by('login', $this->username); 834 | 835 | if (!is_user_logged_in() || get_current_user_id() != $oUser->data->ID) 836 | return $this->error('base', 0); 837 | 838 | $oReturn->user->mail = $oUser->data->user_email; 839 | 840 | $sNewMention = bp_get_user_meta($oUser->data->ID, 'notification_activity_new_mention', true); 841 | $sNewReply = bp_get_user_meta($oUser->data->ID, 'notification_activity_new_reply', true); 842 | $sSendRequests = bp_get_user_meta($oUser->data->ID, 'notification_friends_friendship_request', true); 843 | $sAcceptRequests = bp_get_user_meta($oUser->data->ID, 'notification_friends_friendship_accepted', true); 844 | $sGroupInvite = bp_get_user_meta($oUser->data->ID, 'notification_groups_invite', true); 845 | $sGroupUpdate = bp_get_user_meta($oUser->data->ID, 'notification_groups_group_updated', true); 846 | $sGroupPromo = bp_get_user_meta($oUser->data->ID, 'notification_groups_admin_promotion', true); 847 | $sGroupRequest = bp_get_user_meta($oUser->data->ID, 'notification_groups_membership_request', true); 848 | $sNewMessages = bp_get_user_meta($oUser->data->ID, 'notification_messages_new_message', true); 849 | $sNewNotices = bp_get_user_meta($oUser->data->ID, 'notification_messages_new_notice', true); 850 | 851 | $oReturn->settings->new_mention = $sNewMention == 'yes' ? true : false; 852 | $oReturn->settings->new_reply = $sNewReply == 'yes' ? true : false; 853 | $oReturn->settings->send_requests = $sSendRequests == 'yes' ? true : false; 854 | $oReturn->settings->accept_requests = $sAcceptRequests == 'yes' ? true : false; 855 | $oReturn->settings->group_invite = $sGroupInvite == 'yes' ? true : false; 856 | $oReturn->settings->group_update = $sGroupUpdate == 'yes' ? true : false; 857 | $oReturn->settings->group_promo = $sGroupPromo == 'yes' ? true : false; 858 | $oReturn->settings->group_request = $sGroupRequest == 'yes' ? true : false; 859 | $oReturn->settings->new_message = $sNewMessages == 'yes' ? true : false; 860 | $oReturn->settings->new_notice = $sNewNotices == 'yes' ? true : false; 861 | 862 | return $oReturn; 863 | } 864 | 865 | public function __call($sName, $aArguments) { 866 | if (class_exists("JSON_API_FOR_BUDDYPRESS_FUNCTION") && 867 | method_exists(JSON_API_FOR_BUDDYPRESS_FUNCTION, $sName) && 868 | is_callable("JSON_API_FOR_BUDDYPRESS_FUNCTION::" . $sName)) { 869 | try { 870 | return call_user_func_array("JSON_API_FOR_BUDDYPRESS_FUNCTION::" . $sName, $aArguments); 871 | } catch (Exception $e) { 872 | $oReturn = new stdClass(); 873 | $oReturn->status = "error"; 874 | $oReturn->msg = $e->getMessage(); 875 | die(json_encode($oReturn)); 876 | } 877 | } 878 | else 879 | return NULL; 880 | } 881 | 882 | public function __get($sName) { 883 | return isset(JSON_API_FOR_BUDDYPRESS_FUNCTION::$sVars[$sName]) ? JSON_API_FOR_BUDDYPRESS_FUNCTION::$sVars[$sName] : NULL; 884 | } 885 | 886 | } 887 | 888 | ?> -------------------------------------------------------------------------------- /json-api-for-buddypress/json-api-for-buddypress.php: -------------------------------------------------------------------------------- 1 |

'; 36 | _e('JSON API for Buddypress requires the BuddyPress plugin to be activated. Please install / activate BuddyPress first, or deactivate JSON API for Buddypress.', 'json-api-for-buddypress'); 37 | echo '

'; 38 | } 39 | 40 | function draw_notice_json_api() { 41 | echo '

'; 42 | _e('JSON API for Buddypress requires the JSON API plugin to be activated. Please install / activate JSON API first, or deactivate JSON API for Buddypress.', 'json-api-for-buddypress'); echo '

'; 43 | } 44 | 45 | function addJsonApiController($aControllers) { 46 | $aControllers[] = 'BuddypressRead'; 47 | return $aControllers; 48 | } 49 | 50 | function setBuddypressReadControllerPath($sDefaultPath) { 51 | return dirname(__FILE__) . '/controllers/BuddypressRead.php'; 52 | } -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/json-api-for-buddypress/languages/json-api-for-buddypress-de_DE.mo -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress-de_DE.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: JSON API for BuddyPress\n" 4 | "POT-Creation-Date: 2013-11-29 15:20+0100\n" 5 | "PO-Revision-Date: 2013-11-29 15:49+0100\n" 6 | "Last-Translator: Tobias Weichart \n" 7 | "Language-Team: tweichart \n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "X-Generator: Poedit 1.5.7\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "\\json-api-for-buddypress\n" 14 | "Language: German\n" 15 | "X-Poedit-SearchPath-0: .\n" 16 | "X-Poedit-SearchPath-1: controllers\n" 17 | 18 | #: json-api-for-buddypress.php:32 19 | msgid "" 20 | "JSON API for Buddypress requires the BuddyPress plugin to " 21 | "be activated. Please install / activate " 22 | "BuddyPress first, or deactivate JSON API for " 23 | "Buddypress." 24 | msgstr "" 25 | "JSON API for Buddypress benötigt ein installiertes " 26 | "BuddyPress Plugin. Bitte installieren / " 27 | "aktivieren Sie BuddyPress zuerst oder deaktivieren Sie JSON API for Buddypress." 29 | 30 | #: json-api-for-buddypress.php:38 31 | msgid "" 32 | "JSON API for Buddypress requires the JSON API plugin to be " 33 | "activated. Please install / activate JSON API first, or deactivate JSON API for Buddypress." 36 | msgstr "" 37 | "JSON API for Buddypress benötigt ein installiertes JSON API " 38 | "Plugin. Bitte >installieren / aktivieren Sie JSON API zuerst oder deaktivieren Sie JSON API for Buddypress." 41 | 42 | #: library/functions.class.php:205 43 | msgid "No Activities found." 44 | msgstr "Keine Aktivitäten gefunden." 45 | 46 | #: library/functions.class.php:210 47 | msgid "No Profile found." 48 | msgstr "Kein Profil gefunden." 49 | 50 | #: library/functions.class.php:213 library/functions.class.php:226 51 | #: library/functions.class.php:245 library/functions.class.php:295 52 | msgid "Username not found." 53 | msgstr "Benutzername nicht gefunden." 54 | 55 | #: library/functions.class.php:218 56 | msgid "No messages found." 57 | msgstr "Keine Nachrichten gefunden." 58 | 59 | #: library/functions.class.php:221 60 | msgid "No notifications found." 61 | msgstr "Keine Benachrichtigungen gefunden." 62 | 63 | #: library/functions.class.php:229 64 | msgid "No friends found." 65 | msgstr "Keine Freunde gefunden." 66 | 67 | #: library/functions.class.php:232 68 | msgid "No friendship requests found." 69 | msgstr "Keine Freundschaftsanfragen gefunden." 70 | 71 | #: library/functions.class.php:235 72 | msgid "Friendname not found." 73 | msgstr "Name des Freundes nicht gefunden." 74 | 75 | #: library/functions.class.php:242 76 | msgid "No groups found." 77 | msgstr "Keine Gruppen gefunden." 78 | 79 | #: library/functions.class.php:248 library/functions.class.php:267 80 | msgid "Neither groupid nor groupslug are set." 81 | msgstr "Weder die Gruppen-ID noch der Gruppen-Slug wurden gefunden." 82 | 83 | #: library/functions.class.php:251 library/functions.class.php:270 84 | msgid "Group not found." 85 | msgstr "Gruppe nicht gefunden" 86 | 87 | #: library/functions.class.php:254 88 | msgid "No Members in Group" 89 | msgstr "Keine Mitglieder in der Gruppe" 90 | 91 | #: library/functions.class.php:261 92 | msgid "Forums are disabled for this group." 93 | msgstr "Foren sind für diese Gruppe deaktiviert." 94 | 95 | #: library/functions.class.php:264 96 | msgid "No forum assigned to this group." 97 | msgstr "Kein Forum ist dieser Gruppe zugewiesen." 98 | 99 | #: library/functions.class.php:273 100 | msgid "Neither forumid nor forumslug are set." 101 | msgstr "Weder die Foren-ID noch der Foren-Slug wurden gefunden." 102 | 103 | #: library/functions.class.php:276 104 | msgid "Forum not found." 105 | msgstr "Forum nicht gefunden" 106 | 107 | #: library/functions.class.php:279 108 | msgid "Neither topicid nor topicslug are set." 109 | msgstr "Weder die Themen-ID noch der Themen-Slug wurden gefunden." 110 | 111 | #: library/functions.class.php:282 112 | msgid "No topics in this forum." 113 | msgstr "Keine Themen in diesem Forum." 114 | 115 | #: library/functions.class.php:285 116 | msgid "No topics found." 117 | msgstr "Keine Themen gefunden." 118 | 119 | #: library/functions.class.php:288 120 | msgid "No forums found." 121 | msgstr "Keine Foren gefunden." 122 | 123 | #: library/functions.class.php:302 124 | msgid "You are not allowed to view this information." 125 | msgstr "Sie dürfen diese Informationen nicht sehen." 126 | 127 | #: library/functions.class.php:307 128 | msgid "An undefined error occured." 129 | msgstr "Ein unbekannter Fehler ist aufgetreten." 130 | -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/json-api-for-buddypress/languages/json-api-for-buddypress-es_ES.mo -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress-es_ES.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: JSON API for BuddyPress\n" 4 | "POT-Creation-Date: 2013-11-29 15:20+0100\n" 5 | "PO-Revision-Date: 2013-12-16 18:19+0100\n" 6 | "Last-Translator: Andrew Kurtis \n" 7 | "Language-Team: Andrew Kurtis \n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "X-Generator: Poedit 1.5.7\n" 12 | "X-Poedit-KeywordsList: __;_e\n" 13 | "Language: Spanish\n" 14 | "X-Poedit-SourceCharset: UTF-8\n" 15 | "X-Poedit-SearchPath-0: .\n" 16 | "X-Poedit-SearchPath-1: controllers\n" 17 | 18 | #: json-api-for-buddypress.php:32 19 | msgid "" 20 | "JSON API for Buddypress requires the BuddyPress plugin to " 21 | "be activated. Please install / activate " 22 | "BuddyPress first, or deactivate JSON API for " 23 | "Buddypress." 24 | msgstr "" 25 | "JSON API para Buddypress requiere que el plugin Buddypress " 26 | "esté activado. Por favor instale/ active " 27 | "BuddyPress primero, o desactive JSON API para " 28 | "Buddypress." 29 | 30 | #: json-api-for-buddypress.php:38 31 | msgid "" 32 | "JSON API for Buddypress requires the JSON API plugin to be " 33 | "activated. Please install / activate JSON API first, or deactivate JSON API for Buddypress." 36 | msgstr "" 37 | "JSON API para Buddypress requiere que el plugin Buddypress " 38 | "esté activado. Por favor instale/active JSON API primero, o desactive " 40 | "JSON API para Buddypress." 41 | 42 | #: library/functions.class.php:205 43 | msgid "No Activities found." 44 | msgstr "No se encontraron Actividades." 45 | 46 | #: library/functions.class.php:210 47 | msgid "No Profile found." 48 | msgstr "No se encontraron Perfiles." 49 | 50 | #: library/functions.class.php:213 library/functions.class.php:226 51 | #: library/functions.class.php:245 library/functions.class.php:295 52 | msgid "Username not found." 53 | msgstr "No se encontró el usuario." 54 | 55 | #: library/functions.class.php:218 56 | msgid "No messages found." 57 | msgstr "No se encontraron mensajes." 58 | 59 | #: library/functions.class.php:221 60 | msgid "No notifications found." 61 | msgstr "No se encontraron notificaciones." 62 | 63 | #: library/functions.class.php:229 64 | msgid "No friends found." 65 | msgstr "No se encontraron amigos." 66 | 67 | #: library/functions.class.php:232 68 | msgid "No friendship requests found." 69 | msgstr "No se encontraron pedidos de amistad." 70 | 71 | #: library/functions.class.php:235 72 | msgid "Friendname not found." 73 | msgstr "No se encontró el nombre de amigo." 74 | 75 | #: library/functions.class.php:242 76 | msgid "No groups found." 77 | msgstr "No se encontraron grupos." 78 | 79 | #: library/functions.class.php:248 library/functions.class.php:267 80 | msgid "Neither groupid nor groupslug are set." 81 | msgstr "Ni el groupid ni el groupslug se han establecido." 82 | 83 | #: library/functions.class.php:251 library/functions.class.php:270 84 | msgid "Group not found." 85 | msgstr "No se encontró el grupo." 86 | 87 | #: library/functions.class.php:254 88 | msgid "No Members in Group" 89 | msgstr "No hay miembros en el Grupo" 90 | 91 | #: library/functions.class.php:261 92 | msgid "Forums are disabled for this group." 93 | msgstr "Los foros están deshabilitados para este grupo." 94 | 95 | #: library/functions.class.php:264 96 | msgid "No forum assigned to this group." 97 | msgstr "No se han asignado foros a este grupo." 98 | 99 | #: library/functions.class.php:273 100 | msgid "Neither forumid nor forumslug are set." 101 | msgstr "Ni el forumid ni el forumslug se han establecido." 102 | 103 | #: library/functions.class.php:276 104 | msgid "Forum not found." 105 | msgstr "No se encontró el foro." 106 | 107 | #: library/functions.class.php:279 108 | msgid "Neither topicid nor topicslug are set." 109 | msgstr "Ni el topicid ni el topicslug se han establecido." 110 | 111 | #: library/functions.class.php:282 112 | msgid "No topics in this forum." 113 | msgstr "No hay tópicos en este foro." 114 | 115 | #: library/functions.class.php:285 116 | msgid "No topics found." 117 | msgstr "No se encontraron tópicos." 118 | 119 | #: library/functions.class.php:288 120 | msgid "No forums found." 121 | msgstr "No se encontraron foros." 122 | 123 | #: library/functions.class.php:302 124 | msgid "You are not allowed to view this information." 125 | msgstr "Usted no tiene permitido ver esta información." 126 | 127 | #: library/functions.class.php:307 128 | msgid "An undefined error occured." 129 | msgstr "Un error indefinido ocurrió." 130 | -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweichart/JSON-API-for-BuddyPress/67f46f8e3431026f50ee09d7c41d8c6c71209f70/json-api-for-buddypress/languages/json-api-for-buddypress.mo -------------------------------------------------------------------------------- /json-api-for-buddypress/languages/json-api-for-buddypress.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: JSON API for BuddyPress\n" 4 | "POT-Creation-Date: 2013-11-29 15:20+0100\n" 5 | "PO-Revision-Date: 2013-11-29 15:20+0100\n" 6 | "Last-Translator: Tobias Weichart \n" 7 | "Language-Team: tweichart \n" 8 | "Language: English\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 1.5.7\n" 13 | "X-Poedit-KeywordsList: __;_e\n" 14 | "\\json-api-for-buddypress\n" 15 | "X-Poedit-SearchPath-0: .\n" 16 | "X-Poedit-SearchPath-1: controllers\n" 17 | 18 | #: json-api-for-buddypress.php:32 19 | msgid "" 20 | "JSON API for Buddypress requires the BuddyPress plugin to " 21 | "be activated. Please install / activate " 22 | "BuddyPress first, or deactivate JSON API for " 23 | "Buddypress." 24 | msgstr "" 25 | 26 | #: json-api-for-buddypress.php:38 27 | msgid "" 28 | "JSON API for Buddypress requires the JSON API plugin to be " 29 | "activated. Please install / activate JSON API first, or deactivate JSON API for Buddypress." 32 | msgstr "" 33 | 34 | #: library/functions.class.php:205 35 | msgid "No Activities found." 36 | msgstr "" 37 | 38 | #: library/functions.class.php:210 39 | msgid "No Profile found." 40 | msgstr "" 41 | 42 | #: library/functions.class.php:213 library/functions.class.php:226 43 | #: library/functions.class.php:245 library/functions.class.php:295 44 | msgid "Username not found." 45 | msgstr "" 46 | 47 | #: library/functions.class.php:218 48 | msgid "No messages found." 49 | msgstr "" 50 | 51 | #: library/functions.class.php:221 52 | msgid "No notifications found." 53 | msgstr "" 54 | 55 | #: library/functions.class.php:229 56 | msgid "No friends found." 57 | msgstr "" 58 | 59 | #: library/functions.class.php:232 60 | msgid "No friendship requests found." 61 | msgstr "" 62 | 63 | #: library/functions.class.php:235 64 | msgid "Friendname not found." 65 | msgstr "" 66 | 67 | #: library/functions.class.php:242 68 | msgid "No groups found." 69 | msgstr "" 70 | 71 | #: library/functions.class.php:248 library/functions.class.php:267 72 | msgid "Neither groupid nor groupslug are set." 73 | msgstr "" 74 | 75 | #: library/functions.class.php:251 library/functions.class.php:270 76 | msgid "Group not found." 77 | msgstr "" 78 | 79 | #: library/functions.class.php:254 80 | msgid "No Members in Group" 81 | msgstr "" 82 | 83 | #: library/functions.class.php:261 84 | msgid "Forums are disabled for this group." 85 | msgstr "" 86 | 87 | #: library/functions.class.php:264 88 | msgid "No forum assigned to this group." 89 | msgstr "" 90 | 91 | #: library/functions.class.php:273 92 | msgid "Neither forumid nor forumslug are set." 93 | msgstr "" 94 | 95 | #: library/functions.class.php:276 96 | msgid "Forum not found." 97 | msgstr "" 98 | 99 | #: library/functions.class.php:279 100 | msgid "Neither topicid nor topicslug are set." 101 | msgstr "" 102 | 103 | #: library/functions.class.php:282 104 | msgid "No topics in this forum." 105 | msgstr "" 106 | 107 | #: library/functions.class.php:285 108 | msgid "No topics found." 109 | msgstr "" 110 | 111 | #: library/functions.class.php:288 112 | msgid "No forums found." 113 | msgstr "" 114 | 115 | #: library/functions.class.php:302 116 | msgid "You are not allowed to view this information." 117 | msgstr "" 118 | 119 | #: library/functions.class.php:307 120 | msgid "An undefined error occured." 121 | msgstr "" 122 | -------------------------------------------------------------------------------- /json-api-for-buddypress/library/functions.class.php: -------------------------------------------------------------------------------- 1 | error("The BuddyPress module '" . $sModule . "' has to be enabled to use this function."); 16 | require_once (JSON_API_FOR_BUDDYPRESS_HOME . '/library/parameters.php'); 17 | 18 | if (!isset($aParams [$sModule])) 19 | throw new Exception("Parameters for module not defined."); 20 | 21 | foreach ($aParams [$sModule] as $sType => $aParameters) { 22 | foreach ($aParameters as $sValName => $sVal) { 23 | self::$sVars [$sValName] = self::getVar($sValName, $sVal, $sType); 24 | } 25 | } 26 | } 27 | 28 | private function checkModuleActive($sModule) { 29 | if ($sModule != 'notifications' && !key_exists($sModule, bp_get_option('bp-active-components'))) { 30 | if ($sModule == 'forums') 31 | if (!function_exists("bbp_version")) 32 | return false; 33 | return false; 34 | } 35 | return true; 36 | } 37 | 38 | private static function getVar($sValName, $sVal, $sType) { 39 | global $json_api; 40 | $mReturnVal = is_null($json_api->query->$sValName) ? $sVal : $json_api->query->$sValName; 41 | return self::sanitize($mReturnVal, $sType); 42 | } 43 | 44 | /** 45 | * Method to sanitize the values given 46 | * @param mixed $mValue Value to sanitize 47 | * @param String $sType type of the Value given by parameters array 48 | * @return mixed sanitized value 49 | */ 50 | private static function sanitize($mValue, $sType) { 51 | switch ($sType) { 52 | case "int": 53 | if ($mValue !== false) 54 | $mValue = (int) $mValue; 55 | break; 56 | case "boolean": 57 | $mValue = (boolean) $mValue; 58 | case "string": 59 | default: 60 | switch (gettype($mValue)) { 61 | case 'string': 62 | $mValue = strip_tags($mValue); 63 | break; 64 | case 'boolean': 65 | default: 66 | break; 67 | } 68 | break; 69 | } 70 | return $mValue; 71 | } 72 | 73 | protected static function get_group_from_params() { 74 | if (self::$sVars ['groupid'] === false && self::$sVars ['groupslug'] === false) 75 | return 2; 76 | $oGroup = groups_get_group(array('group_id' => self::$sVars ['groupid'])); 77 | if (is_null($oGroup->id)) { 78 | self::$sVars ['groupid'] = groups_get_id(sanitize_title(self::$sVars ['groupslug'])); 79 | if (self::$sVars ['groupid'] === 0) 80 | return 3; 81 | else 82 | $oGroup = groups_get_group(array('group_id' => self::$sVars ['groupid'])); 83 | } 84 | else { 85 | self::$sVars ['groupid'] = $oGroup->id; 86 | } 87 | if ($oGroup->status == 'private' && !$oGroup->is_member) 88 | return false; 89 | return true; 90 | } 91 | 92 | protected static function groupforum_check_forum_existence() { 93 | if (self::$sVars['forumid'] === false && self::$sVars['forumslug'] === false) 94 | return 4; 95 | $oForum = bp_forums_get_forum(self::$sVars['forumid']); 96 | if (is_null($oForum) || $oForum === false) { 97 | $iForumId = bb_get_id_from_slug('forum', sanitize_title(self::$sVars['forumslug'])); 98 | if ($iForumId === 0) 99 | return 5; 100 | else { 101 | self::$sVars['forumid'] = $iForumId; 102 | } 103 | } else { 104 | self::$sVars['forumid'] = $oForum->id; 105 | } 106 | $iGroupId = groups_get_id(sanitize_title(self::$sVars ['groupslug'])); 107 | $oGroup = groups_get_group(array('group_id' => $iGroupId)); 108 | if ($oGroup->status == 'private' && !$oGroup->is_member) 109 | return false; 110 | return true; 111 | } 112 | 113 | protected static function sitewideforum_check_forum_existence() { 114 | if (self::$sVars['forumid'] === false && self::$sVars['forumslug'] === false) 115 | return 4; 116 | $oForum = bbp_get_forum(self::$sVars['forumid']); 117 | if (is_null($oForum)) { 118 | global $wpdb; 119 | $aForums = $wpdb->get_results($wpdb->prepare( 120 | "SELECT ID 121 | FROM $wpdb->posts 122 | WHERE post_type='forum' 123 | AND post_name='" . self::$sVars['forumslug'] . "'" 124 | )); 125 | if (empty($aForums)) 126 | return 5; 127 | else { 128 | self::$sVars['forumid'] = array(); 129 | foreach ($aForums as $aForum) { 130 | self::$sVars['forumid'][] = $aForum->ID; 131 | } 132 | } 133 | } else { 134 | self::$sVars['forumid'] = array(); 135 | self::$sVars['forumid'][] = $oForum->ID; 136 | } 137 | return true; 138 | } 139 | 140 | protected static function groupforum_check_topic_existence() { 141 | if (self::$sVars['topicid'] === false && self::$sVars['topicslug'] === false) 142 | return 6; 143 | $oTopic = bp_forums_get_topic_details(self::$sVars['topicid']); 144 | if (is_null($oTopic) || (int) $oTopic->topic_id != self::$sVars['topicid']) { 145 | $iTopicId = bb_get_id_from_slug('topic', sanitize_title(self::$sVars['topicslug'])); 146 | if ($iTopicId === 0) 147 | return 8; 148 | else { 149 | self::$sVars['topicid'] = $iTopicId; 150 | $oTopic = bp_forums_get_topic_details(self::$sVars['topicid']); 151 | } 152 | } 153 | else 154 | self::$sVars['topicid'] = $oTopic->id; 155 | if (is_null($oTopic)) 156 | return false; 157 | return true; 158 | } 159 | 160 | protected static function sitewideforum_check_topic_existence() { 161 | if (self::$sVars['topicid'] === 0 && self::$sVars['topicslug'] === false) 162 | return 6; 163 | global $wpdb; 164 | if (self::$sVars['topicid'] !== 0) 165 | $oTopic = $wpdb->get_row($wpdb->prepare( 166 | "SELECT ID 167 | FROM $wpdb->posts 168 | WHERE post_type='topic' 169 | AND id='" . self::$sVars['topicid'] . "'" 170 | )); 171 | 172 | if (is_null($oTopic)) { 173 | global $wpdb; 174 | $aTopics = $wpdb->get_results($wpdb->prepare( 175 | "SELECT ID 176 | FROM $wpdb->posts 177 | WHERE post_type='topic' 178 | AND post_name='" . self::$sVars['topicslug'] . "'" 179 | )); 180 | if (empty($aTopics)) 181 | return 8; 182 | else { 183 | self::$sVars['topicid'] = array(); 184 | foreach ($aTopics as $aTopic) { 185 | self::$sVars['topicid'][] = $aTopic->ID; 186 | } 187 | } 188 | } else { 189 | self::$sVars['topicid'] = array(); 190 | self::$sVars['topicid'][] = $oTopic->ID; 191 | } 192 | return true; 193 | } 194 | 195 | /** 196 | * Returns a String containing an error message 197 | * @param String $sModule Modules name 198 | * @param type $iCode Errorcode 199 | */ 200 | protected static function error($sModule, $iCode = "") { 201 | $oReturn = new stdClass(); 202 | $oReturn->status = "error"; 203 | switch ($sModule) { 204 | case "activity": 205 | $oReturn->msg = __('No Activities found.', 'json-api-for-buddypress'); 206 | break; 207 | case "xprofile": 208 | switch ($iCode) { 209 | case 0: 210 | $oReturn->msg = __('No Profile found.', 'json-api-for-buddypress'); 211 | break; 212 | case 1: 213 | $oReturn->msg = __('Username not found.', 'json-api-for-buddypress'); 214 | break; 215 | } 216 | break; 217 | case "messages": 218 | $oReturn->msg = __('No messages found.', 'json-api-for-buddypress'); 219 | break; 220 | case "notifications": 221 | $oReturn->msg = __('No notifications found.', 'json-api-for-buddypress'); 222 | break; 223 | case "friends": 224 | switch ($iCode) { 225 | case 0: 226 | $oReturn->msg = __('Username not found.', 'json-api-for-buddypress'); 227 | break; 228 | case 1: 229 | $oReturn->msg = __('No friends found.', 'json-api-for-buddypress'); 230 | break; 231 | case 2: 232 | $oReturn->msg = __('No friendship requests found.', 'json-api-for-buddypress'); 233 | break; 234 | case 3: 235 | $oReturn->msg = __('Friendname not found.', 'json-api-for-buddypress'); 236 | break; 237 | } 238 | break; 239 | case "groups": 240 | switch ($iCode) { 241 | case 0: 242 | $oReturn->msg = __('No groups found.', 'json-api-for-buddypress'); 243 | break; 244 | case 1: 245 | $oReturn->msg = __('Username not found.', 'json-api-for-buddypress'); 246 | break; 247 | case 2: 248 | $oReturn->msg = __('Neither groupid nor groupslug are set.', 'json-api-for-buddypress'); 249 | break; 250 | case 3: 251 | $oReturn->msg = __('Group not found.', 'json-api-for-buddypress'); 252 | break; 253 | case 4: 254 | $oReturn->msg = __('No Members in Group', 'json-api-for-buddypress'); 255 | break; 256 | } 257 | break; 258 | case "forums": 259 | switch ($iCode) { 260 | case 0: 261 | $oReturn->msg = __('Forums are disabled for this group.', 'json-api-for-buddypress'); 262 | break; 263 | case 1: 264 | $oReturn->msg = __('No forum assigned to this group.', 'json-api-for-buddypress'); 265 | break; 266 | case 2: 267 | $oReturn->msg = __('Neither groupid nor groupslug are set.', 'json-api-for-buddypress'); 268 | break; 269 | case 3: 270 | $oReturn->msg = __('Group not found.', 'json-api-for-buddypress'); 271 | break; 272 | case 4: 273 | $oReturn->msg = __('Neither forumid nor forumslug are set.', 'json-api-for-buddypress'); 274 | break; 275 | case 5: 276 | $oReturn->msg = __('Forum not found.', 'json-api-for-buddypress'); 277 | break; 278 | case 6: 279 | $oReturn->msg = __('Neither topicid nor topicslug are set.', 'json-api-for-buddypress'); 280 | break; 281 | case 7: 282 | $oReturn->msg = __('No topics in this forum.', 'json-api-for-buddypress'); 283 | break; 284 | case 8: 285 | $oReturn->msg = __('No topics found.', 'json-api-for-buddypress'); 286 | break; 287 | case 9: 288 | $oReturn->msg = __('No forums found.', 'json-api-for-buddypress'); 289 | break; 290 | } 291 | break; 292 | case "settings": 293 | switch ($iCode) { 294 | case 0: 295 | $oReturn->msg = __('Username not found.', 'json-api-for-buddypress'); 296 | break; 297 | } 298 | break; 299 | case "base": 300 | switch ($iCode) { 301 | case 0: 302 | $oReturn->msg = __('You are not allowed to view this information.', 'json-api-for-buddypress'); 303 | break; 304 | } 305 | break; 306 | default: 307 | $oReturn->msg = __('An undefined error occured.', 'json-api-for-buddypress'); 308 | } 309 | return $oReturn; 310 | } 311 | 312 | } -------------------------------------------------------------------------------- /json-api-for-buddypress/library/parameters.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'string' => array( 6 | 'sort' => 'DESC', 7 | 'comments' => false, 8 | 'component' => false, 9 | 'type' => false 10 | ), 11 | 'int' => array( 12 | 'pages' => 1, 13 | 'offset' => 10, 14 | 'limit' => false, 15 | 'userid' => false, 16 | 'itemid' => false, 17 | 'secondaryitemid' => false 18 | ) 19 | ), 20 | 'xprofile' => array( 21 | 'string' => array( 22 | 'username' => false 23 | ) 24 | ), 25 | 'messages' => array( 26 | 'string' => array( 27 | 'box' => 'inbox' 28 | ), 29 | 'int' => array( 30 | 'per_page' => 10 31 | ), 32 | 'boolean' => array( 33 | 'limit' => false 34 | ) 35 | ), 36 | 'friends' => array( 37 | 'string' => array( 38 | 'username' => false, 39 | 'friendname' => false 40 | ) 41 | ), 42 | 'groups' => array( 43 | 'string' => array( 44 | 'username' => false, 45 | 'type' => false, 46 | 'groupname' => false, 47 | 'groupslug' => false 48 | ), 49 | 'boolean' => array( 50 | 'show_hidden' => false 51 | ), 52 | 'int' => array( 53 | 'per_page' => '', 54 | 'page' => 1, 55 | 'groupid' => false, 56 | 'limit' => false 57 | ) 58 | ), 59 | 'forums' => array( 60 | 'string' => array( 61 | 'groupslug' => false, 62 | 'forumslug' => false, 63 | 'type' => 'newest', 64 | 'tagname' => false, 65 | 'topicslug' => false, 66 | 'order' => 'asc' 67 | ), 68 | 'int' => array( 69 | 'groupid' => false, 70 | 'forumid' => false, 71 | 'page' => 1, 72 | 'per_page' => 15, 73 | 'topicid' => 0, 74 | 'parentid' => false 75 | ), 76 | 'boolean' => array( 77 | 'display_content' => false, 78 | 'detailed' => false 79 | ) 80 | ), 81 | 'settings' => array( 82 | 'string' => array( 83 | 'username' => false 84 | ) 85 | ), 86 | 'notifications' => array() 87 | ); --------------------------------------------------------------------------------