Changeset 3429727
- Timestamp:
- 12/30/2025 04:18:10 PM (11 days ago)
- Location:
- question-answer/trunk
- Files:
-
- 2 added
- 17 deleted
- 11 edited
-
assets/front/css/add-question.css (modified) (8 diffs)
-
assets/front/css/breadcrumb.css (deleted)
-
assets/front/css/single-question.css (modified) (52 diffs)
-
assets/front/js/question-submit.js (modified) (2 diffs)
-
assets/global/js (added)
-
includes/classes/class-dynamic-css.php (deleted)
-
includes/classes/class-emails.php (modified) (1 diff)
-
includes/classes/class-question-category.php (added)
-
includes/functions.php (modified) (2 diffs)
-
includes/functions/functions-notification-email.php (modified) (74 diffs)
-
question-answer.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
templates/add-question/add-question-hook.php (modified) (3 diffs)
-
templates/add-question/add-question-new.php (modified) (4 diffs)
-
templates/question-archive - Copy (deleted)
-
templates/single-question/admin-actions.php (deleted)
-
templates/single-question/answer-content.php (deleted)
-
templates/single-question/answer-pagination.php (deleted)
-
templates/single-question/answer-posting.php (deleted)
-
templates/single-question/answer-reply.php (deleted)
-
templates/single-question/answer-section.php (deleted)
-
templates/single-question/answer-vote.php (deleted)
-
templates/single-question/comment.php (deleted)
-
templates/single-question/content.php (deleted)
-
templates/single-question/meta.php (deleted)
-
templates/single-question/single-question-hook.php (modified) (2 diffs)
-
templates/single-question/subscriber.php (deleted)
-
templates/single-question/title.php (deleted)
-
templates/single-question/top-nav.php (deleted)
-
templates/single-question/view-count.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
question-answer/trunk/assets/front/css/add-question.css
r2267336 r3429727 2 2 /* CSS Document */ 3 3 4 .qa_add_question {}4 .qa_add_question {} 5 5 6 6 7 .submit-question{} 8 .submit-question .errors{ 7 .submit-question {} 8 9 .submit-question .errors { 9 10 margin-bottom: 30px; 10 11 } 12 11 13 .submit-question .errors .error { 12 14 color: #f0611a; … … 28 30 29 31 30 .submit-question .qa-suggestions {}32 .submit-question .qa-suggestions {} 31 33 32 .submit-question .qa-suggestions .suggestion-title {34 .submit-question .qa-suggestions .suggestion-title { 33 35 font-weight: bold; 34 36 display: none; … … 39 41 } 40 42 41 .submit-question .qa-suggestions li{} 43 .submit-question .qa-suggestions li {} 44 42 45 .submit-question .qa-suggestions li a { 43 46 display: block; … … 50 53 51 54 52 .submit-question .qa-form-field-wrap{} 53 54 .submit-question .qa-form-field-wrap input[type="text"], .submit-question .qa-form-field-wrap input[type="email"],.submit-question .qa-form-field-wrap textarea, .submit-question .qa-form-field-wrap select{ 55 width: 90%; 55 .submit-question .qa-form-field-wrap { 56 display: flex; 56 57 } 57 58 58 .submit-question .qa-form-field-wrap select, .submit-question .qa-form-field-wrap .wp-editor-wrap, .submit-question .qa-form-field-wrap input[type="submit"]{ 59 width: 93%; 59 .submit-question .qa-form-field-wrap input[type="text"], 60 .submit-question .qa-form-field-wrap input[type="email"], 61 .submit-question .qa-form-field-wrap textarea, 62 .submit-question .qa-form-field-wrap select, 63 .submit-question .qa-form-field-wrap input[type="submit"] { 64 width: 100%; 65 border: 1px solid #ddd; 60 66 } 61 67 62 .submit-question .qa-form-field-wrap .field-title{ 63 width: 250px; 64 float: left; 65 } 66 67 .submit-question .qa-form-field-wrap .field-input{ 68 margin-left: 250px; 69 } 70 .submit-question .qa-form-field-wrap .field-details{ 71 font-style: italic; 72 font-size: 13px; 73 margin-top: 10px; 68 .submit-question .qa-form-field-wrap .wp-editor-wrap { 69 width: 100%; 74 70 } 75 71 76 72 77 .qa-q-submitted{ 73 .submit-question .qa-form-field-wrap .field-title { 74 width: 300px; 75 } 76 77 .submit-question .qa-form-field-wrap .field-input { 78 width: 100%; 79 } 80 81 .submit-question .qa-form-field-wrap .field-details { 82 font-style: italic; 83 font-size: 16px; 84 margin-top: 10px; 85 86 } 87 88 89 .qa-q-submitted { 78 90 background: #5f6caf none repeat scroll 0 0; 79 91 padding: 10px; … … 83 95 } 84 96 85 .qa-q-submitted a {97 .qa-q-submitted a { 86 98 color: #fff; 87 99 } 88 100 89 101 90 .poll-field-wrap {}102 .poll-field-wrap {} 91 103 92 104 93 .poll-field-wrap .add-poll {105 .poll-field-wrap .add-poll { 94 106 margin-bottom: 10px; 95 107 } 96 .poll-field-wrap .poll-items{} 97 .poll-field-wrap .poll-items .item{ 108 109 .poll-field-wrap .poll-items {} 110 111 .poll-field-wrap .poll-items .item { 98 112 margin-bottom: 10px; 99 113 } 100 .poll-field-wrap .poll-items input[type="text"]{ 114 115 .poll-field-wrap .poll-items input[type="text"] { 101 116 width: 80% !important; 102 117 } 103 118 104 .poll-field-wrap .poll-items .sort-hndle {119 .poll-field-wrap .poll-items .sort-hndle { 105 120 cursor: move; 106 121 width: 20px; … … 110 125 } 111 126 112 .poll-field-wrap .poll-items .remove {}127 .poll-field-wrap .poll-items .remove {} 113 128 114 129 … … 116 131 117 132 118 @media only screen and (max-width: 992px ) { 119 .submit-question .qa-form-field-wrap .field-title{ 133 @media only screen and (max-width: 992px) { 134 .submit-question .qa-form-field-wrap { 135 display: block; 136 margin-bottom: 3em; 137 } 138 139 .submit-question .qa-form-field-wrap .field-title { 120 140 width: 100%; 121 float: none; 122 margin-bottom: 20px; 123 font-weight: bold; 141 margin-bottom: 10px; 142 font-size: 20px; 124 143 } 125 144 … … 129 148 130 149 } 131 132 133 134 135 136 137 138 -
question-answer/trunk/assets/front/css/single-question.css
r2453640 r3429727 2 2 /* CSS Document */ 3 3 4 .single-question{ 5 6 } 7 .single-question a { text-decoration:none; } 4 .single-question {} 5 6 .single-question a { 7 text-decoration: none; 8 } 8 9 9 10 … … 13 14 display: inline-block; 14 15 font-size: 12px; 15 margin-right: 10px;16 margin-right: 10px; 16 17 padding: 0 0 5px 0; 17 18 text-decoration: none; … … 19 20 20 21 21 .single-question .qa_question_status { 22 float:right;22 .single-question .qa_question_status { 23 float: right; 23 24 } 24 25 … … 44 45 45 46 } 46 .single-question .question-content .content-header .meta{ 47 48 .single-question .question-content .content-header .meta { 47 49 display: inline-block; 48 50 vertical-align: top; … … 53 55 margin-top: 10px; 54 56 } 57 55 58 .single-question .question-content .content-body { 56 padding: 10px;59 padding: 10px; 57 60 clear: both; 58 61 } … … 63 66 64 67 .single-question .question-content .qa-content-tags .tag { 65 font-size: 13px;66 line-height: normal;67 68 } 69 70 .single-question .bad-word {}68 font-size: 13px; 69 line-height: normal; 70 71 } 72 73 .single-question .bad-word {} 71 74 72 75 .single-question .qa-comments li { … … 80 83 81 84 .single-question .qa-avatar img { 82 border-radius: 0;83 box-shadow: none;85 border-radius: 0; 86 box-shadow: none; 84 87 } 85 88 … … 111 114 112 115 113 .single-question .comment-vote .comment-thumb-up, .single-question .comment-vote .comment-thumb-down { 116 .single-question .comment-vote .comment-thumb-up, 117 .single-question .comment-vote .comment-thumb-down { 114 118 background: #5f6caf none repeat scroll 0 0; 115 119 border-radius: 3px; … … 124 128 125 129 126 .single-question .comment-vote .comment-thumb-down { 127 128 } 130 .single-question .comment-vote .comment-thumb-down {} 129 131 130 132 .single-question .comment-vote .comment-vote-count { … … 134 136 } 135 137 136 .single-question .qa-single-comment:hover .qa-comment-flag, .single-question .qa-single-comment:hover .comment-vote { 138 .single-question .qa-single-comment:hover .qa-comment-flag, 139 .single-question .qa-single-comment:hover .comment-vote { 137 140 display: block; 138 141 } 139 142 140 .single-question .qa-comment-flag .waiting {143 .single-question .qa-comment-flag .waiting { 141 144 display: none; 142 145 } … … 155 158 156 159 .single-question .qa-cancel-comment { 157 background: #566e7d none repeat scroll 0 0; 158 border-color: #566e7d; 159 color: #ffffff; 160 cursor: pointer; 161 padding: 5px 15px; 162 text-align: center; 163 } 164 165 166 167 .single-question .question-content .qa-users-meta span { 168 169 } 160 background: #566e7d none repeat scroll 0 0; 161 border-color: #566e7d; 162 color: #ffffff; 163 cursor: pointer; 164 padding: 5px 15px; 165 text-align: center; 166 } 167 168 169 170 .single-question .question-content .qa-users-meta span {} 171 170 172 .single-question .question-content .qa-user { 171 173 font-size: 16px; … … 179 181 180 182 .single-question .question-content .qa-member-since { 181 color: #16a05c !important;182 display: none;183 font-size: 12px;183 color: #16a05c !important; 184 display: none; 185 font-size: 12px; 184 186 } 185 187 186 188 .single-question .qa-comments { 187 margin-top: 40px;188 padding: 0;189 margin-top: 40px; 190 padding: 0; 189 191 } 190 192 … … 204 206 } 205 207 206 .qa-is-solved.solved .unsolved, .qa-is-solved.solved .mark-solved, .qa-is-solved.solved .mark-unsolved { 207 208 display: none; 209 } 210 211 .qa-is-solved.solved:hover .mark-unsolved{ 208 .qa-is-solved.solved .unsolved, 209 .qa-is-solved.solved .mark-solved, 210 .qa-is-solved.solved .mark-unsolved { 211 212 display: none; 213 } 214 215 .qa-is-solved.solved:hover .mark-unsolved { 212 216 display: inline; 213 217 } 214 218 215 .qa-is-solved.solved:hover .solved{ 216 display: none; 217 } 218 219 220 221 222 .qa-is-solved.unsolved .unsolved, .qa-is-solved.unsolved .mark-unsolved, .qa-is-solved.unsolved .solved { 219 .qa-is-solved.solved:hover .solved { 220 display: none; 221 } 222 223 224 225 226 .qa-is-solved.unsolved .unsolved, 227 .qa-is-solved.unsolved .mark-unsolved, 228 .qa-is-solved.unsolved .solved { 223 229 224 230 display: none; … … 228 234 229 235 .single-question .qa-is-solved.unsolved { 230 background: #fa877f none repeat scroll 0 0;236 background: #fa877f none repeat scroll 0 0; 231 237 } 232 238 … … 234 240 235 241 .answer-post { 236 margin-bottom: 30px;237 } 238 239 240 241 .qa-closed {242 margin-bottom: 30px; 243 } 244 245 246 247 .qa-closed { 242 248 background: #FF9800 none repeat scroll 0 0; 243 249 border-radius: 3px; … … 269 275 } 270 276 271 .qa-featured:hover {272 background: #5f6caf none repeat scroll 0 0; 273 274 } 275 276 277 .qa-featured.qa-featured-no .featured {278 display: none; 279 } 280 281 .qa-featured.qa-featured-no:hover .make-featured {277 .qa-featured:hover { 278 background: #5f6caf none repeat scroll 0 0; 279 280 } 281 282 283 .qa-featured.qa-featured-no .featured { 284 display: none; 285 } 286 287 .qa-featured.qa-featured-no:hover .make-featured { 282 288 display: inline; 283 289 } 284 290 285 .qa-featured.qa-featured-no:hover .not-featured {286 display: none; 287 } 288 289 290 291 .qa-featured.qa-featured-no .not-featured{292 293 } 294 .qa-featured.qa-featured-no .make-featured{ 295 display: none; 296 } 297 298 .qa-featured.qa-featured-no .cancel-featured{ 299 display: none; 300 } 301 302 .qa-featured.qa-featured-yes .not-featured{ 303 display: none; 304 } 305 .qa-featured.qa-featured-yes .make-featured {306 display: none; 307 } 308 309 .qa-featured.qa-featured-yes .cancel-featured {310 display: none; 311 } 312 313 .qa-featured.qa-featured-yes:hover .cancel-featured {291 .qa-featured.qa-featured-no:hover .not-featured { 292 display: none; 293 } 294 295 296 297 .qa-featured.qa-featured-no .not-featured {} 298 299 .qa-featured.qa-featured-no .make-featured { 300 display: none; 301 } 302 303 .qa-featured.qa-featured-no .cancel-featured { 304 display: none; 305 } 306 307 .qa-featured.qa-featured-yes .not-featured { 308 display: none; 309 } 310 311 .qa-featured.qa-featured-yes .make-featured { 312 display: none; 313 } 314 315 .qa-featured.qa-featured-yes .cancel-featured { 316 display: none; 317 } 318 319 .qa-featured.qa-featured-yes:hover .cancel-featured { 314 320 display: inline; 315 321 } 316 .qa-featured.qa-featured-yes:hover .featured{ 322 323 .qa-featured.qa-featured-yes:hover .featured { 317 324 display: none; 318 325 } … … 353 360 354 361 355 .qa-subscribe.subscribed .stop-subscribe{ 356 display: none; 357 } 358 359 360 .qa-subscribe.subscribed .start-subscribe, .qa-subscribe.subscribed .cancel-subscribe{ 361 display: none; 362 } 363 364 .qa-subscribe.subscribed:hover .cancel-subscribe{ 362 .qa-subscribe.subscribed .stop-subscribe { 363 display: none; 364 } 365 366 367 .qa-subscribe.subscribed .start-subscribe, 368 .qa-subscribe.subscribed .cancel-subscribe { 369 display: none; 370 } 371 372 .qa-subscribe.subscribed:hover .cancel-subscribe { 365 373 display: inline; 366 374 } 367 375 368 .qa-subscribe.subscribed:hover .subscribed-done{ 369 display: none; 370 } 371 372 373 .qa-subscribe.not-subscribed .start-subscribe{ 374 display: none; 375 } 376 .qa-subscribe.not-subscribed .subscribed-done{ 376 .qa-subscribe.subscribed:hover .subscribed-done { 377 display: none; 378 } 379 380 381 .qa-subscribe.not-subscribed .start-subscribe { 382 display: none; 383 } 384 385 .qa-subscribe.not-subscribed .subscribed-done { 377 386 display: none; 378 387 } … … 383 392 } 384 393 385 .qa-subscribe.not-subscribed .cancel-subscribe{display: none;} 386 387 388 .qa-subscribe.not-subscribed:hover .start-subscribe{ 394 .qa-subscribe.not-subscribed .cancel-subscribe { 395 display: none; 396 } 397 398 399 .qa-subscribe.not-subscribed:hover .start-subscribe { 389 400 display: inline; 390 401 } … … 398 409 padding: 10px; 399 410 background: #5f6caf26; 400 } 411 display: flex; 412 justify-content: space-between; 413 align-items: center; 414 } 415 401 416 .single-question .subscribers .title { 402 display: inline-block; 403 font-size: 16px; 404 vertical-align: top; 405 } 417 display: inline-block; 418 font-size: 16px; 419 vertical-align: top; 420 } 421 406 422 .single-question .subscribers .subscriber { 407 display: inline-block;408 height: 30px;409 margin: 0 5px;410 overflow: hidden;411 width: 30px;423 display: inline-block; 424 height: 30px; 425 margin: 0 5px; 426 overflow: hidden; 427 width: 30px; 412 428 } 413 429 414 430 .single-question .subscribers .subscriber img { 415 border-radius: 0; 416 height: auto; 417 width: 100%; 418 } 419 .single-question .assign-to{ 431 border-radius: 0; 432 height: auto; 433 width: 100%; 434 } 435 436 .single-question .assign-to { 420 437 padding: 10px; 421 438 } 422 .single-question .assign-to .assign-to-title{ 439 440 .single-question .assign-to .assign-to-title { 423 441 display: inline-block; 424 442 vertical-align: top; … … 426 444 margin-right: 15px; 427 445 } 428 .single-question .assign-to .item{ 446 447 .single-question .assign-to .item { 429 448 display: inline-block; 430 449 } … … 436 455 margin: 10px 0; 437 456 } 457 438 458 .single-question .answer-pagination .previous { 439 459 display: inline-block; 440 460 vertical-align: top; 441 461 } 462 442 463 .single-question .answer-pagination .next { 443 464 float: right; … … 445 466 446 467 447 .single-question .answer-pagination a, .single-question .answer-pagination a:visited { 468 .single-question .answer-pagination a, 469 .single-question .answer-pagination a:visited { 448 470 background: #5f6caf none repeat scroll 0 0; 449 471 border-radius: 3px; … … 458 480 459 481 460 .question-closed {482 .question-closed { 461 483 background: #b5242440; 462 484 padding: 10px; … … 464 486 } 465 487 466 .answer-post a { text-decoration:none; } 467 468 .answer-section-header, .question-comment-header, .answer-post-header { 488 .answer-post a { 489 text-decoration: none; 490 } 491 492 .answer-section-header, 493 .question-comment-header, 494 .answer-post-header { 469 495 border: 1px solid #f1f1f1; 470 496 cursor: pointer; 471 497 padding: 10px; 472 498 background: #5f6caf26; 473 } 474 #qa_sort_answer_form{} 475 #qa_sort_answer_form select{ 476 display: inline-block; 499 display: flex; 500 justify-content: space-between; 501 align-items: center; 502 } 503 504 #qa_sort_answer_form {} 505 506 #qa_sort_answer_form select { 507 display: inline-block; 508 width: 300px 477 509 } 478 510 … … 494 526 margin-bottom: 20px; 495 527 } 528 496 529 .quick-notes input[type="text"] { 497 border-left: 3px solid #ddd; 498 border-radius: 0; 499 display: block; 500 font-size: 12px; 501 margin: 2px 0; 502 padding: 2px 5px; 503 } 504 505 506 .answer-post form { 507 508 } 530 border-left: 3px solid #ddd; 531 border-radius: 0; 532 display: block; 533 font-size: 12px; 534 margin: 2px 0; 535 padding: 2px 5px; 536 } 537 538 539 .answer-post form {} 509 540 510 541 .form-answer-post { … … 514 545 515 546 .form-answer-post .validations .success { 516 color: #54c671;517 font-size: 12px;518 padding: 3px 1px;547 color: #54c671; 548 font-size: 12px; 549 padding: 3px 1px; 519 550 } 520 551 521 552 .form-answer-post .validations .failed { 522 color: #f0611a;523 font-size: 12px;524 padding: 3px 1px;553 color: #f0611a; 554 font-size: 12px; 555 padding: 3px 1px; 525 556 } 526 557 … … 531 562 } 532 563 533 .all-single-answer .list_best_answer { 534 535 } 564 .all-single-answer .list_best_answer {} 565 536 566 .all-single-answer .list_best_answer .qa-answer-details { 537 567 background: #5f6caf26; … … 539 569 540 570 .single-answer { 541 margin: 31px 0;542 padding: 15px 5px;571 margin: 31px 0; 572 padding: 15px 5px; 543 573 } 544 574 … … 547 577 margin: 0 50px 15px 70px; 548 578 } 549 .all-single-answer .list_best_answer .best-answer-ribbon{ 579 580 .all-single-answer .list_best_answer .best-answer-ribbon { 550 581 display: block; 551 582 552 583 } 584 553 585 .single-answer .best-answer-ribbon span { 554 586 background: #ffac41; … … 563 595 float: right; 564 596 text-align: center; 565 566 } 567 568 .votted { 569 background: linear-gradient(to bottom, #5f6caf 5%,#fff 60%) !important;597 598 } 599 600 .votted { 601 background: linear-gradient(to bottom, #5f6caf 5%, #fff 60%) !important; 570 602 color: #5f6caf !important; 571 603 } … … 573 605 .qa-single-vote .qa-thumb-up, 574 606 .qa-single-vote .qa-thumb-reply, 575 .qa-single-vote .qa-thumb-down {576 display: table;607 .qa-single-vote .qa-thumb-down { 608 display: table; 577 609 padding: 2px 8px; 578 background:#5f6caf; 579 border-radius:3px; 580 border:1px solid #5f6caf; 581 color:#fff; 582 cursor:pointer; 583 } 610 background: #5f6caf; 611 border-radius: 3px; 612 border: 1px solid #5f6caf; 613 color: #fff; 614 cursor: pointer; 615 } 616 584 617 .qa-single-vote .qa-thumb-up:hover, 585 618 .qa-single-vote .qa-thumb-reply:hover, 586 .qa-single-vote .qa-thumb-down:hover {587 background-color:#fff;588 color:#5f6caf;619 .qa-single-vote .qa-thumb-down:hover { 620 background-color: #fff; 621 color: #5f6caf; 589 622 } 590 623 591 624 .qa-thumb-reply { 592 margin-top:12px;625 margin-top: 12px; 593 626 } 594 627 … … 597 630 } 598 631 599 .single-question .qa-answer-left .qa-best-answer i {600 font-size:35px;601 color:#a2a1a1;632 .single-question .qa-answer-left .qa-best-answer i { 633 font-size: 35px; 634 color: #a2a1a1; 602 635 } 603 636 604 637 .single-question .qa-answer-left .best_answer i { 605 color: #16a05c;606 } 607 608 .single-question .qa-answer-left .qa-best-answer {609 text-align: center;638 color: #16a05c; 639 } 640 641 .single-question .qa-answer-left .qa-best-answer { 642 text-align: center; 610 643 cursor: pointer; 611 644 padding: 10px 0; … … 614 647 615 648 .single-question .qa-answer-avatar { 616 border-radius: 0;617 box-shadow: none;649 border-radius: 0; 650 box-shadow: none; 618 651 } 619 652 … … 624 657 border: 1px solid #f1f1f1; 625 658 } 659 626 660 .single-question .qa-answer-metas { 627 background-color: #f1f1f1;628 padding: 10px;661 background-color: #f1f1f1; 662 padding: 10px; 629 663 } 630 664 631 665 .qa-answer-metas span { 632 margin-right: 10px;666 margin-right: 10px; 633 667 } 634 668 … … 640 674 display: inline-block; 641 675 } 676 642 677 .single-question .qa-answer-date { 643 font-size: 13px;678 font-size: 13px; 644 679 } 645 680 646 681 .single-question .qa-answer-private { 647 background: #61a0ff none repeat scroll 0 0;648 border-radius: 3px;649 color: #fff;650 font-size: 13px;651 padding: 3px 11px;682 background: #61a0ff none repeat scroll 0 0; 683 border-radius: 3px; 684 color: #fff; 685 font-size: 13px; 686 padding: 3px 11px; 652 687 } 653 688 654 689 655 690 .qa-answer-content { 656 padding:10px;691 padding: 10px; 657 692 } 658 693 659 694 span.qa-lock { 660 background: none repeat scroll 0 0 #EEE;661 border: 1px solid rgba(0,0,0,0.1);662 border-radius: 2px;663 display: block;664 margin-top: 10px;665 padding: 4px 15px;666 width: 70%;695 background: none repeat scroll 0 0 #EEE; 696 border: 1px solid rgba(0, 0, 0, 0.1); 697 border-radius: 2px; 698 display: block; 699 margin-top: 10px; 700 padding: 4px 15px; 701 width: 70%; 667 702 } 668 703 669 704 .qa-single-comment.single-reply { 670 border-bottom: 1px solid #ddd;671 padding: 10px 15px 0;705 border-bottom: 1px solid #ddd; 706 padding: 10px 15px 0; 672 707 } 673 708 … … 698 733 outline: none; 699 734 } 700 .single-question .qa-load-comments .icon-loading{ 701 display: none; 702 } 703 704 .single-question .qa-load-comments.active .icon-loading{ 735 736 .single-question .qa-load-comments .icon-loading { 737 display: none; 738 } 739 740 .single-question .qa-load-comments.active .icon-loading { 705 741 display: inline; 706 742 } … … 715 751 } 716 752 717 .qa-comment-reply {753 .qa-comment-reply { 718 754 margin-left: 70px !important; 719 755 } … … 729 765 text-align: center; 730 766 } 731 .qa-answer-reply i{ 732 margin-right:5px; 767 768 .qa-answer-reply i { 769 margin-right: 5px; 733 770 } 734 771 … … 739 776 740 777 .comment-link { 741 font-size: 13px;742 } 743 744 .qa-reply-popup {745 height: 100%;746 left: 0;747 /*position: fixed;*/748 top: 0;749 width: 100%;750 display:none;751 z-index:999999;778 font-size: 13px; 779 } 780 781 .qa-reply-popup { 782 height: 100%; 783 left: 0; 784 /*position: fixed;*/ 785 top: 0; 786 width: 100%; 787 display: none; 788 z-index: 999999; 752 789 } 753 790 754 791 .qa-reply-popup .qa-reply-form { 755 background: #5f6caf26 none repeat scroll 0 0; 756 border-top: 1px solid #ddd; 757 height: auto; 758 margin: 0px; 759 padding: 10px 20px; 760 position: relative; 761 top: 20%; 762 } 792 background: #5f6caf26 none repeat scroll 0 0; 793 border-top: 1px solid #ddd; 794 height: auto; 795 margin: 0px; 796 padding: 10px 20px; 797 position: relative; 798 top: 20%; 799 } 800 763 801 .qa-reply-popup .qa-reply-header { 764 display: block;802 display: block; 765 803 } 766 804 767 805 .qa-reply-popup textarea { 768 display: block;769 margin-bottom: 5px;770 width: 97%;806 display: block; 807 margin-bottom: 5px; 808 width: 97%; 771 809 } 772 810 773 811 774 812 .qa-reply-popup .close { 775 background: #fa877f none repeat scroll 0 0;776 color: #fff;777 cursor: pointer;778 font-size: 20px;779 height: 30px;780 line-height: normal;781 position: absolute;782 right: 0;783 text-align: center;784 top: 0;785 width: 30px;786 z-index: 9999;813 background: #fa877f none repeat scroll 0 0; 814 color: #fff; 815 cursor: pointer; 816 font-size: 20px; 817 height: 30px; 818 line-height: normal; 819 position: absolute; 820 right: 0; 821 text-align: center; 822 top: 0; 823 width: 30px; 824 z-index: 9999; 787 825 } 788 826 … … 803 841 text-align: center; 804 842 cursor: pointer; 805 margin:0 auto;843 margin: 0 auto; 806 844 } 807 845 … … 825 863 826 864 .single-question .qa-social-share .qa-social-single { 827 background: #5f6caf none repeat scroll 0 0; 828 cursor: pointer; 829 display: inline-block; 830 font-size: 18px; 831 height: 30px; 832 margin-right: 8px; 833 text-align: center; 834 width: 30px; 835 } 836 837 .single-question .qa-social-share .qa-social-facebook:hover{ color: #3B5998; } 838 .single-question .qa-social-share .qa-social-twitter:hover{ color: #1DA1F2; } 839 .single-question .qa-social-share .qa-social-gplus:hover{ color: #C13C31; } 840 .single-question .qa-social-share .qa-social-pinterest:hover{ color: #D50C22; } 865 background: #5f6caf none repeat scroll 0 0; 866 cursor: pointer; 867 display: inline-block; 868 font-size: 18px; 869 height: 30px; 870 margin-right: 8px; 871 text-align: center; 872 width: 30px; 873 } 874 875 .single-question .qa-social-share .qa-social-facebook:hover { 876 color: #3B5998; 877 } 878 879 .single-question .qa-social-share .qa-social-twitter:hover { 880 color: #1DA1F2; 881 } 882 883 .single-question .qa-social-share .qa-social-gplus:hover { 884 color: #C13C31; 885 } 886 887 .single-question .qa-social-share .qa-social-pinterest:hover { 888 color: #D50C22; 889 } 841 890 842 891 843 892 .single-question .qa-polls { 844 margin: 20px 0;845 } 846 893 margin: 20px 0; 894 } 895 847 896 .single-question .qa-polls li { 848 cursor: pointer;849 list-style: outside none none;850 margin: 2px 15px;897 cursor: pointer; 898 list-style: outside none none; 899 margin: 2px 15px; 851 900 } 852 901 853 902 854 903 .single-question .qa-polls li .fa-dot-circle-o { 855 display: none;904 display: none; 856 905 } 857 906 858 907 859 908 .single-question .qa-polls li.active .fa-dot-circle-o { 860 display: inline-block;861 } 862 909 display: inline-block; 910 } 911 863 912 .single-question .qa-polls li.active .fa-circle-o { 864 display: none;865 } 913 display: none; 914 } 866 915 867 916 868 917 .single-question .poll-result { 869 display: none; 870 } 918 display: none; 919 } 920 871 921 .single-question .poll-result .poll-line { 872 background: #5f6caf none repeat scroll 0 0;873 border-radius: 3px;874 margin: 6px 0;875 overflow: hidden;922 background: #5f6caf none repeat scroll 0 0; 923 border-radius: 3px; 924 margin: 6px 0; 925 overflow: hidden; 876 926 } 877 927 878 928 .single-question .poll-result .poll-line .fill { 879 background: #64cdff none repeat scroll 0 0;880 color: #fff;881 font-size: 13px;882 padding: 1px 0;883 } 884 929 background: #64cdff none repeat scroll 0 0; 930 color: #fff; 931 font-size: 13px; 932 padding: 1px 0; 933 } 934 885 935 .single-question .poll-result .loading { 886 display: none;936 display: none; 887 937 } 888 938 … … 896 946 897 947 } 948 898 949 .single-question .qa-edit-answer:visited { 899 950 color: #fff; … … 920 971 */ 921 972 922 .single-question .qa-flag .waiting {973 .single-question .qa-flag .waiting { 923 974 display: none; 924 975 } … … 928 979 929 980 930 .qa-user-card-loader {981 .qa-user-card-loader { 931 982 cursor: pointer; 932 983 position: relative; … … 958 1009 } 959 1010 960 .qa-user-card:after, .single-question .qa-user-card:before { 1011 .qa-user-card:after, 1012 .single-question .qa-user-card:before { 961 1013 bottom: 100%; 962 1014 left: 10%; … … 975 1027 margin-left: -12px; 976 1028 } 1029 977 1030 .qa-user-card:before { 978 1031 border-color: rgba(221, 221, 221, 0); … … 990 1043 border-radius: 3px; 991 1044 } 1045 992 1046 .qa-user-card .card-cover img { 993 1047 width: 100%; 994 1048 height: auto; 995 1049 } 1050 996 1051 .qa-user-card .card-avatar { 997 1052 position: absolute; … … 1005 1060 border-radius: 5px; 1006 1061 } 1062 1007 1063 .qa-user-card .card-avatar img { 1008 1064 /* border-radius: 50%; */ … … 1061 1117 font-weight: normal; 1062 1118 } 1063 .qa-user-card .card-answer-count{ 1119 1120 .qa-user-card .card-answer-count { 1064 1121 font-size: 12px; 1065 1122 font-weight: normal; 1066 1123 } 1067 .qa-user-card .card-follower-count{ 1124 1125 .qa-user-card .card-follower-count { 1068 1126 font-size: 12px; 1069 1127 font-weight: normal; … … 1086 1144 1087 1145 1088 @media only screen and (min-width: 1024px ) { 1089 1090 1091 } 1092 1093 @media only screen and ( min-width: 768px ) and ( max-width: 1023px ) { 1094 1095 } 1096 1097 @media only screen and ( min-width: 0px ) and ( max-width: 576px ) { 1146 @media only screen and (min-width: 1024px) {} 1147 1148 @media only screen and (min-width: 768px) and (max-width: 1023px) {} 1149 1150 @media only screen and (min-width: 0px) and (max-width: 576px) { 1098 1151 1099 1152 … … 1103 1156 1104 1157 .single-question .qa-answer-left { 1105 display: inline-block;1106 float: none;1158 display: inline-block; 1159 float: none; 1107 1160 } 1108 1161 1109 1162 .single-question .qa-user-name { 1110 display: inline-block;1111 margin-bottom: 10px;1163 display: inline-block; 1164 margin-bottom: 10px; 1112 1165 } 1113 1166 1114 1167 1115 1168 .single-question .qa-single-vote { 1116 display: inline-block;1117 float: none;1118 margin-right: 20px;1119 text-align: center;1120 vertical-align: top;1121 width: 31px;1169 display: inline-block; 1170 float: none; 1171 margin-right: 20px; 1172 text-align: center; 1173 vertical-align: top; 1174 width: 31px; 1122 1175 } 1123 1176 1124 1177 .single-question .qa-answer-details { 1125 border: 1px solid #f1f1f1;1126 margin-left: 0;1127 margin-right: 0;1178 border: 1px solid #f1f1f1; 1179 margin-left: 0; 1180 margin-right: 0; 1128 1181 } 1129 1182 1130 1183 .single-question .qa-answer-reply { 1131 margin: 0;1184 margin: 0; 1132 1185 } 1133 1186 1134 1187 .single-question .qa-reply-popup { 1135 margin: 10px 0;1188 margin: 10px 0; 1136 1189 } 1137 1190 1138 1191 .qa-reply-popup .qa-reply-form { 1139 margin: 0;1192 margin: 0; 1140 1193 } 1141 1194 … … 1147 1200 1148 1201 } 1149 1150 1151 1152 -
question-answer/trunk/assets/front/js/question-submit.js
r3126665 r3429727 5 5 var qaPassword = document.querySelector("input[name=qa_password]"); 6 6 7 console.log(qaCreateAccount); 7 8 8 9 qaCreateAccount.addEventListener('change', function () { 10 if (this.checked) { 11 qaUsername.style.display = 'block'; 12 qaPassword.style.display = 'block'; 13 14 } else { 15 qaUsername.style.display = 'none'; 16 qaPassword.style.display = 'none'; 17 } 18 }); 19 20 }) 21 9 if (qaCreateAccount != null) { 10 qaCreateAccount.addEventListener('change', function () { 11 if (this.checked) { 12 qaUsername.style.display = 'block'; 13 qaPassword.style.display = 'block'; 14 } else { 15 qaUsername.style.display = 'none'; 16 qaPassword.style.display = 'none'; 17 } 18 }); 19 } 22 20 23 21 (function ($) { … … 86 84 }); 87 85 })(jQuery); 86 87 }) 88 89 -
question-answer/trunk/includes/classes/class-emails.php
r2933205 r3429727 35 35 $email_body = wp_specialchars_decode($email_body, ENT_QUOTES); 36 36 37 error_log($email_body); 37 38 38 39 $status = wp_mail($email_to, $subject, $email_body, $headers, $attachments); -
question-answer/trunk/includes/functions.php
r2933205 r3429727 140 140 $response['html'] = ""; 141 141 $answer_status = get_option('qa_submitted_answer_status', 'pending'); 142 $form_data_arr = isset($_POST['form_data']) ? qa_recursive_sanitize_ arr($_POST['form_data']) : array();142 $form_data_arr = isset($_POST['form_data']) ? qa_recursive_sanitize_post_data($_POST['form_data']) : array(); 143 143 144 144 //var_dump($form_data_arr); … … 808 808 809 809 810 function qa_recursive_sanitize_post_data($array) 811 { 812 813 foreach ($array as $key => &$value) { 814 if (is_array($value)) { 815 $value = qa_recursive_sanitize_post_data($value); 816 } else { 817 $value = wp_kses_post($value); 818 } 819 } 820 821 return $array; 822 } 823 824 810 825 811 826 -
question-answer/trunk/includes/functions/functions-notification-email.php
r2933205 r3429727 1 1 <?php 2 if ( !defined('ABSPATH')) exit; // if direct access2 if (!defined('ABSPATH')) exit; // if direct access 3 3 4 4 … … 7 7 add_action('qa_action_answer_comment', 'qa_action_answer_comment_send_email', 99); 8 8 9 function qa_action_answer_comment_send_email($comment_ID){ 9 function qa_action_answer_comment_send_email($comment_ID) 10 { 10 11 11 12 $admin_email = get_option('admin_email'); … … 20 21 $comment_content = $comment_data->comment_content; 21 22 $answer_id = $comment_data->comment_post_ID; 22 $answer_data = get_post( $answer_id);23 24 25 if ( $answer_data->post_type == 'answer' ):26 27 $qa_answer_question_id = get_post_meta( $answer_id, 'qa_answer_question_id', true);23 $answer_data = get_post($answer_id); 24 25 26 if ($answer_data->post_type == 'answer') : 27 28 $qa_answer_question_id = get_post_meta($answer_id, 'qa_answer_question_id', true); 28 29 29 30 $question_url = get_permalink($qa_answer_question_id); … … 40 41 $enable = isset($qa_email_templates_data['answer_comment']['enable']) ? $qa_email_templates_data['answer_comment']['enable'] : 'no'; 41 42 42 if ($enable == 'yes'):43 if ($enable == 'yes') : 43 44 44 45 $email_bcc = isset($qa_email_templates_data['answer_comment']['email_to']) ? $qa_email_templates_data['answer_comment']['email_to'] : ''; … … 49 50 50 51 $vars = array( 51 '{site_name}' => get_bloginfo('name'),52 '{site_name}' => get_bloginfo('name'), 52 53 '{site_description}' => get_bloginfo('description'), 53 54 '{site_url}' => get_bloginfo('url'), … … 55 56 56 57 '{user_name}' => $current_user->display_name, 57 '{user_avatar}' => get_avatar( $current_user->ID, 60),58 '{user_avatar}' => get_avatar($current_user->ID, 60), 58 59 '{user_email}' => '', 59 60 … … 62 63 '{answer_title}' => $answer_data->post_title, 63 64 '{answer_url}' => $answer_url, 64 '{answer_edit_url}' => get_admin_url() .'post.php?post='.$answer_id.'&action=edit',65 '{answer_edit_url}' => get_admin_url() . 'post.php?post=' . $answer_id . '&action=edit', 65 66 '{answer_id}' => $answer_id, 66 67 '{answer_content}' => $answer_data->post_content, 67 68 68 69 '{comment_content}' => $comment_content, 69 '{comment_url}' => $question_url .'#comment-'.$comment_ID,70 '{comment_url}' => $question_url . '#comment-' . $comment_ID, 70 71 ); 71 72 72 73 $a_subscriber = get_post_meta($answer_id, 'a_subscriber', true); 73 if (is_array($a_subscriber))74 foreach ($a_subscriber as $subscriber){74 if (is_array($a_subscriber)) 75 foreach ($a_subscriber as $subscriber) { 75 76 $subscriber_data = get_user_by('id', $subscriber); 76 77 77 78 $email_data['email_to'] = $subscriber_data->user_email; 78 79 $email_data['email_bcc'] = $email_bcc; 79 $email_data['email_from'] = $email_from ;80 $email_data['email_from'] = $email_from; 80 81 $email_data['email_from_name'] = $email_from_name; 81 82 $email_data['subject'] = strtr($email_subject, $vars); … … 87 88 endif; 88 89 endif; 89 90 91 90 } 92 91 93 92 94 add_action( 'qa_action_comment_flag', 'qa_email_action_comment_flag_function', 99 ); 95 96 if ( ! function_exists( 'qa_email_action_comment_flag_function' ) ) { 97 function qa_email_action_comment_flag_function( $comment_ID ){ 93 add_action('qa_action_comment_flag', 'qa_email_action_comment_flag_function', 99); 94 95 if (!function_exists('qa_email_action_comment_flag_function')) { 96 function qa_email_action_comment_flag_function($comment_ID) 97 { 98 98 99 99 $admin_email = get_option('admin_email'); … … 105 105 $qa_from_email = get_option('qa_from_email', $admin_email); 106 106 107 $comment = get_comment( $comment_ID);107 $comment = get_comment($comment_ID); 108 108 $comment_content = $comment->comment_content; 109 $question_ID = $comment->comment_post_ID ;110 $question_data = get_post( $question_ID);109 $question_ID = $comment->comment_post_ID; 110 $question_data = get_post($question_ID); 111 111 112 112 $question_url = get_permalink($question_ID); … … 122 122 $enable = isset($qa_email_templates_data['comment_flag']['enable']) ? $qa_email_templates_data['comment_flag']['enable'] : 'no'; 123 123 124 if ($enable == 'yes') :124 if ($enable == 'yes') : 125 125 126 126 $email_bcc = isset($qa_email_templates_data['comment_flag']['email_to']) ? $qa_email_templates_data['comment_flag']['email_to'] : ''; … … 142 142 '{question_title}' => $question_data->post_title, 143 143 '{question_url}' => $question_url, 144 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',144 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 145 145 '{question_id}' => $question_ID, 146 146 '{question_content}' => $question_data->post_content, … … 152 152 153 153 154 $email_data['email_to'] = $comment->comment_author_email;154 $email_data['email_to'] = $comment->comment_author_email; 155 155 $email_data['email_bcc'] = $email_bcc; 156 156 $email_data['email_from'] = $email_from; … … 163 163 164 164 endif; 165 166 167 165 } 168 166 } 169 167 170 add_action( 'qa_action_comment_unflag', 'qa_email_action_comment_unflag_function', 99 ); 171 172 if ( ! function_exists( 'qa_email_action_comment_unflag_function' ) ) { 173 function qa_email_action_comment_unflag_function( $comment_ID ) { 168 add_action('qa_action_comment_unflag', 'qa_email_action_comment_unflag_function', 99); 169 170 if (!function_exists('qa_email_action_comment_unflag_function')) { 171 function qa_email_action_comment_unflag_function($comment_ID) 172 { 174 173 175 174 $admin_email = get_option('admin_email'); … … 181 180 $qa_from_email = get_option('qa_from_email', $admin_email); 182 181 183 $comment = get_comment( $comment_ID);182 $comment = get_comment($comment_ID); 184 183 $comment_content = $comment->comment_content; 185 $question_ID = $comment->comment_post_ID ;186 $question_data = get_post( $question_ID);184 $question_ID = $comment->comment_post_ID; 185 $question_data = get_post($question_ID); 187 186 188 187 $question_url = get_permalink($question_ID); … … 198 197 $enable = isset($qa_email_templates_data['comment_unflag']['enable']) ? $qa_email_templates_data['comment_unflag']['enable'] : 'no'; 199 198 200 if ($enable == 'yes') :199 if ($enable == 'yes') : 201 200 202 201 $email_bcc = isset($qa_email_templates_data['comment_unflag']['email_to']) ? $qa_email_templates_data['comment_unflag']['email_to'] : ''; … … 218 217 '{question_title}' => $question_data->post_title, 219 218 '{question_url}' => $question_url, 220 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',219 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 221 220 '{question_id}' => $question_ID, 222 221 '{question_content}' => $question_data->post_content, … … 228 227 229 228 230 $email_data['email_to'] = $comment->comment_author_email;229 $email_data['email_to'] = $comment->comment_author_email; 231 230 $email_data['email_bcc'] = $email_bcc; 232 231 $email_data['email_from'] = $email_from; … … 239 238 240 239 endif; 241 242 243 240 } 244 241 } 245 242 246 243 247 add_action('publish_question', 'qa_email_action_question_published_function', 99 ); 248 249 if ( ! function_exists( 'qa_email_action_question_published_function' ) ) { 250 function qa_email_action_question_published_function( $question_ID ) { 244 add_action('publish_question', 'qa_email_action_question_published_function', 99); 245 246 if (!function_exists('qa_email_action_question_published_function')) { 247 function qa_email_action_question_published_function($question_ID) 248 { 251 249 252 250 $admin_email = get_option('admin_email'); … … 258 256 $qa_from_email = get_option('qa_from_email', $admin_email); 259 257 260 $question_data = get_post( $question_ID);261 262 $qa_answer_question_id = get_post_meta( $question_ID, 'qa_answer_question_id', true);258 $question_data = get_post($question_ID); 259 260 $qa_answer_question_id = get_post_meta($question_ID, 'qa_answer_question_id', true); 263 261 $question_title = get_the_title($qa_answer_question_id); 264 262 $answer_url = get_permalink($qa_answer_question_id); 265 $answer_data = get_post( $question_ID);263 $answer_data = get_post($question_ID); 266 264 267 265 … … 275 273 $enable = isset($qa_email_templates_data['new_question_published']['enable']) ? $qa_email_templates_data['new_question_published']['enable'] : 'no'; 276 274 277 if ($enable == 'yes') :275 if ($enable == 'yes') : 278 276 279 277 $email_bcc = isset($qa_email_templates_data['new_question_published']['email_to']) ? $qa_email_templates_data['new_question_published']['email_to'] : ''; … … 283 281 $email_html = isset($qa_email_templates_data['new_question_published']['html']) ? $qa_email_templates_data['new_question_published']['html'] : ''; 284 282 285 $user_name = !empty($current_user->display_name) ? $current_user->display_name : __('Anonymous', 'question-answer');283 $user_name = !empty($current_user->display_name) ? $current_user->display_name : __('Anonymous', 'question-answer'); 286 284 287 285 … … 298 296 '{question_title}' => $question_data->post_title, 299 297 '{question_url}' => get_permalink($question_ID), 300 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',298 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 301 299 '{question_id}' => $question_ID, 302 300 '{question_content}' => $question_data->post_content, … … 315 313 316 314 endif; 317 318 315 } 319 316 } … … 321 318 322 319 323 add_action( 'qa_question_submitted', 'qa_question_submitted_send_email', 90, 2 ); 324 325 if ( ! function_exists( 'qa_question_submitted_send_email' ) ) { 326 function qa_question_submitted_send_email( $question_ID, $post_data ) { 320 add_action('qa_question_submitted', 'qa_question_submitted_send_email', 90, 2); 321 322 if (!function_exists('qa_question_submitted_send_email')) { 323 function qa_question_submitted_send_email($question_ID, $post_data) 324 { 327 325 328 326 $admin_email = get_option('admin_email'); … … 334 332 $qa_from_email = get_option('qa_from_email', $admin_email); 335 333 336 $question_data = get_post( $question_ID);334 $question_data = get_post($question_ID); 337 335 $question_author = isset($question_data->post_author) ? $question_data->post_author : ''; 338 336 $question_author_data = get_user_by('ID', $question_author); … … 352 350 $enable = isset($qa_email_templates_data['new_question_submitted']['enable']) ? $qa_email_templates_data['new_question_submitted']['enable'] : 'no'; 353 351 354 if ($enable == 'yes') :352 if ($enable == 'yes') : 355 353 356 354 $email_bcc = isset($qa_email_templates_data['new_question_submitted']['email_to']) ? $qa_email_templates_data['new_question_submitted']['email_to'] : ''; … … 360 358 $email_html = isset($qa_email_templates_data['new_question_submitted']['html']) ? $qa_email_templates_data['new_question_submitted']['html'] : ''; 361 359 362 $user_name = !empty($current_user->display_name) ? $current_user->display_name : __('Anonymous', 'question-answer');363 $user_email = isset($current_user->user_email ) ? $current_user->user_email : $qa_contact_email;364 365 360 $user_name = !empty($current_user->display_name) ? $current_user->display_name : __('Anonymous', 'question-answer'); 361 $user_email = isset($current_user->user_email) ? $current_user->user_email : $qa_contact_email; 362 363 366 364 367 365 … … 378 376 '{question_title}' => $question_data->post_title, 379 377 '{question_url}' => get_permalink($question_ID), 380 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',378 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 381 379 '{question_id}' => $question_ID, 382 380 '{question_content}' => $question_data->post_content, … … 414 412 415 413 416 //var_dump($status);414 //var_dump($status); 417 415 endif; 418 419 420 416 } 421 417 } 422 418 423 419 424 add_action( 'qa_action_question_solved', 'qa_email_action_question_solved_function', 90 ); 425 426 if ( ! function_exists( 'qa_email_action_question_solved_function' ) ) { 427 function qa_email_action_question_solved_function($question_ID) { 420 add_action('qa_action_question_solved', 'qa_email_action_question_solved_function', 90); 421 422 if (!function_exists('qa_email_action_question_solved_function')) { 423 function qa_email_action_question_solved_function($question_ID) 424 { 428 425 429 426 $admin_email = get_option('admin_email'); … … 435 432 $qa_from_email = get_option('qa_from_email', $admin_email); 436 433 437 $question_data = get_post( $question_ID);434 $question_data = get_post($question_ID); 438 435 439 436 global $current_user; … … 446 443 $enable = isset($qa_email_templates_data['question_solved']['enable']) ? $qa_email_templates_data['question_solved']['enable'] : 'no'; 447 444 448 if ($enable == 'yes') :445 if ($enable == 'yes') : 449 446 450 447 $email_bcc = isset($qa_email_templates_data['question_solved']['email_to']) ? $qa_email_templates_data['question_solved']['email_to'] : ''; … … 466 463 '{question_title}' => $question_data->post_title, 467 464 '{question_url}' => get_permalink($question_ID), 468 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',465 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 469 466 '{question_id}' => $question_ID, 470 467 '{question_content}' => $question_data->post_content, … … 474 471 $q_subscriber = get_post_meta($question_ID, 'q_subscriber', true); 475 472 476 if (is_array($q_subscriber))477 foreach ($q_subscriber as $subscriber){473 if (is_array($q_subscriber)) 474 foreach ($q_subscriber as $subscriber) { 478 475 $subscriber_data = get_user_by('id', $subscriber); 479 476 … … 493 490 494 491 endif; 495 496 492 } 497 493 } 498 494 499 495 500 add_action( 'qa_action_question_not_solved', 'qa_email_action_question_unsolved_function', 99 ); 501 502 if ( ! function_exists( 'qa_email_action_question_unsolved_function' ) ) { 503 function qa_email_action_question_unsolved_function( $question_ID ) { 496 add_action('qa_action_question_not_solved', 'qa_email_action_question_unsolved_function', 99); 497 498 if (!function_exists('qa_email_action_question_unsolved_function')) { 499 function qa_email_action_question_unsolved_function($question_ID) 500 { 504 501 505 502 $admin_email = get_option('admin_email'); … … 511 508 $qa_from_email = get_option('qa_from_email', $admin_email); 512 509 513 $question_data = get_post( $question_ID);510 $question_data = get_post($question_ID); 514 511 515 512 global $current_user; … … 522 519 $enable = isset($qa_email_templates_data['question_unsolved']['enable']) ? $qa_email_templates_data['question_unsolved']['enable'] : 'no'; 523 520 524 if ($enable == 'yes') :521 if ($enable == 'yes') : 525 522 526 523 $email_bcc = isset($qa_email_templates_data['question_unsolved']['email_to']) ? $qa_email_templates_data['question_unsolved']['email_to'] : ''; … … 542 539 '{question_title}' => $question_data->post_title, 543 540 '{question_url}' => get_permalink($question_ID), 544 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_ID.'&action=edit',541 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_ID . '&action=edit', 545 542 '{question_id}' => $question_ID, 546 543 '{question_content}' => $question_data->post_content, … … 550 547 $q_subscriber = get_post_meta($question_ID, 'q_subscriber', true); 551 548 552 if (is_array($q_subscriber))553 foreach ($q_subscriber as $subscriber){549 if (is_array($q_subscriber)) 550 foreach ($q_subscriber as $subscriber) { 554 551 $subscriber_data = get_user_by('id', $subscriber); 555 552 … … 566 563 567 564 endif; 568 569 565 } 570 566 } … … 575 571 //add_action('publish_answer', 'qa_email_action_answer_published_function', 99 ); 576 572 577 if ( ! function_exists( 'qa_email_action_answer_published_function' ) ) { 578 function qa_email_action_answer_published_function( $answer_id ){ 573 if (!function_exists('qa_email_action_answer_published_function')) { 574 function qa_email_action_answer_published_function($answer_id) 575 { 579 576 580 577 $admin_email = get_option('admin_email'); … … 588 585 589 586 590 $question_id = get_post_meta( $answer_id, 'qa_answer_question_id', true);587 $question_id = get_post_meta($answer_id, 'qa_answer_question_id', true); 591 588 $question_title = get_the_title($question_id); 592 589 $answer_url = get_permalink($question_id); 593 $answer_data = get_post( $answer_id);594 595 $question_data = get_post( $question_id);590 $answer_data = get_post($answer_id); 591 592 $question_data = get_post($question_id); 596 593 $question_author = isset($question_data->post_author) ? $question_data->post_author : ''; 597 594 598 595 599 596 $question_url = get_permalink($question_id); 600 597 $answer_url = get_permalink($question_id); … … 610 607 $enable = isset($qa_email_templates_data['new_answer_published']['enable']) ? $qa_email_templates_data['new_answer_published']['enable'] : 'no'; 611 608 612 if ($enable == 'yes') :609 if ($enable == 'yes') : 613 610 614 611 $email_bcc = isset($qa_email_templates_data['new_answer_published']['email_to']) ? $qa_email_templates_data['new_answer_published']['email_to'] : ''; … … 632 629 633 630 '{answer_title}' => $answer_data->post_title, 634 '{answer_url}' => $answer_url .'#single-answer-'.$answer_id,635 '{answer_edit_url}' => get_admin_url() .'post.php?post='.$answer_id.'&action=edit',631 '{answer_url}' => $answer_url . '#single-answer-' . $answer_id, 632 '{answer_edit_url}' => get_admin_url() . 'post.php?post=' . $answer_id . '&action=edit', 636 633 '{answer_id}' => $answer_id, 637 634 '{answer_content}' => $answer_data->post_content, 638 635 ); 639 636 640 if (empty($question_author)){641 642 $qa_contact_email = get_post_meta($question_id, 'qa_contact_email', true);637 if (empty($question_author)) { 638 639 $qa_contact_email = get_post_meta($question_id, 'qa_contact_email', true); 643 640 644 641 … … 652 649 653 650 $status = $class_qa_emails->qa_send_email($email_data); 654 655 651 } 656 652 … … 678 674 679 675 endif; 680 681 682 676 } 683 677 } … … 686 680 687 681 688 add_action('qa_answer_submitted', 'qa_answer_submitted_email', 99, 2 ); 689 690 if ( ! function_exists( 'qa_answer_submitted_email' ) ) { 691 function qa_answer_submitted_email( $answer_id, $form_data_arr ) { 682 add_action('qa_answer_submitted', 'qa_answer_submitted_email', 99, 2); 683 684 if (!function_exists('qa_answer_submitted_email')) { 685 function qa_answer_submitted_email($answer_id, $form_data_arr) 686 { 692 687 693 688 $admin_email = get_option('admin_email'); … … 701 696 702 697 703 $question_id = get_post_meta( $answer_id, 'qa_answer_question_id', true);704 705 $question_data = get_post( $question_id);698 $question_id = get_post_meta($answer_id, 'qa_answer_question_id', true); 699 700 $question_data = get_post($question_id); 706 701 $question_author = isset($question_data->post_author) ? $question_data->post_author : ''; 707 702 … … 709 704 $question_title = get_the_title($question_id); 710 705 $answer_url = get_permalink($question_id); 711 $answer_data = get_post( $answer_id);712 713 706 $answer_data = get_post($answer_id); 707 708 714 709 $question_url = get_permalink($question_id); 715 710 $answer_url = get_permalink($question_id); … … 725 720 $enable = isset($qa_email_templates_data['new_answer_submitted']['enable']) ? $qa_email_templates_data['new_answer_submitted']['enable'] : 'no'; 726 721 727 if ($enable == 'yes') :722 if ($enable == 'yes') : 728 723 729 724 $email_bcc = isset($qa_email_templates_data['new_answer_submitted']['email_to']) ? $qa_email_templates_data['new_answer_submitted']['email_to'] : ''; … … 747 742 748 743 '{answer_title}' => $answer_data->post_title, 749 '{answer_url}' => $answer_url .'#single-answer-'.$answer_id,750 '{answer_edit_url}' => get_admin_url() .'post.php?post='.$answer_id.'&action=edit',744 '{answer_url}' => $answer_url . '#single-answer-' . $answer_id, 745 '{answer_edit_url}' => get_admin_url() . 'post.php?post=' . $answer_id . '&action=edit', 751 746 '{answer_id}' => $answer_id, 752 747 '{answer_content}' => $answer_data->post_content, … … 763 758 $status = $class_qa_emails->qa_send_email($email_data); 764 759 765 if (empty($question_author)){766 767 $qa_contact_email = get_post_meta($question_id, 'qa_contact_email', true);760 if (empty($question_author)) { 761 762 $qa_contact_email = get_post_meta($question_id, 'qa_contact_email', true); 768 763 769 764 … … 777 772 778 773 $status = $class_qa_emails->qa_send_email($email_data); 779 780 774 } 781 775 … … 799 793 800 794 endif; 801 802 795 } 803 796 } … … 808 801 809 802 810 add_action( 'qa_action_answer_vote_down', 'qa_email_action_answer_votedown_function', 99 ); 811 812 if ( ! function_exists( 'qa_email_action_answer_votedown_function' ) ) { 813 function qa_email_action_answer_votedown_function( $post_id ) { 803 add_action('qa_action_answer_vote_down', 'qa_email_action_answer_votedown_function', 99); 804 805 if (!function_exists('qa_email_action_answer_votedown_function')) { 806 function qa_email_action_answer_votedown_function($post_id) 807 { 814 808 815 809 $admin_email = get_option('admin_email'); … … 821 815 $qa_from_email = get_option('qa_from_email', $admin_email); 822 816 823 $post_data = get_post( $post_id);817 $post_data = get_post($post_id); 824 818 $post_type = isset($post_data->post_type) ? $post_data->post_type : ''; 825 819 … … 827 821 828 822 829 if ($post_type == 'answer') :830 831 $question_id = get_post_meta( $post_id, 'qa_answer_question_id', true);832 833 $question_data = get_post( $question_id);823 if ($post_type == 'answer') : 824 825 $question_id = get_post_meta($post_id, 'qa_answer_question_id', true); 826 827 $question_data = get_post($question_id); 834 828 $question_title = get_the_title($question_id); 835 829 $question_url = get_permalink($question_id); 836 830 837 $answer_data = get_post( $post_id);831 $answer_data = get_post($post_id); 838 832 $answer_url = get_permalink($post_id); 839 833 $answer_url = get_permalink($post_id); … … 849 843 $enable = isset($qa_email_templates_data['answer_votedown']['enable']) ? $qa_email_templates_data['answer_votedown']['enable'] : 'no'; 850 844 851 if ($enable == 'yes') :845 if ($enable == 'yes') : 852 846 853 847 $email_bcc = isset($qa_email_templates_data['answer_votedown']['email_to']) ? $qa_email_templates_data['answer_votedown']['email_to'] : ''; … … 869 863 '{question_title}' => $question_data->post_title, 870 864 '{question_url}' => $question_url, 871 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_id.'&action=edit',865 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_id . '&action=edit', 872 866 '{question_id}' => $question_id, 873 867 '{question_content}' => $question_data->post_content, 874 868 875 869 '{answer_title}' => $answer_data->post_title, 876 '{answer_url}' => $answer_url .'#single-answer-'.$post_id,877 '{answer_edit_url}' => get_admin_url() .'post.php?post='.$post_id.'&action=edit',870 '{answer_url}' => $answer_url . '#single-answer-' . $post_id, 871 '{answer_edit_url}' => get_admin_url() . 'post.php?post=' . $post_id . '&action=edit', 878 872 '{answer_id}' => $post_id, 879 873 '{answer_content}' => $answer_data->post_content, … … 895 889 896 890 endif; 897 elseif ($post_type == 'question'): 898 899 $question_id = $post_id; 900 901 902 903 $question_data = get_post( $question_id ); 904 $question_title = get_the_title($question_id); 905 $question_url = get_permalink($question_id); 906 $question_author = $question_data->post_author; 907 908 $email_data = array(); 909 $class_qa_emails = new class_qa_emails(); 910 $qa_email_templates_data_default = $class_qa_emails->qa_email_templates_data(); 911 $qa_email_templates_data = get_option('qa_email_templates_data', $qa_email_templates_data_default); 912 913 $enable = isset($qa_email_templates_data['question_votedown']['enable']) ? $qa_email_templates_data['question_votedown']['enable'] : 'no'; 914 915 916 if ($enable == 'yes'): 917 918 $email_bcc = isset($qa_email_templates_data['question_votedown']['email_to']) ? $qa_email_templates_data['question_votedown']['email_to'] : ''; 919 $email_from_name = isset($qa_email_templates_data['question_votedown']['email_from_name']) ? $qa_email_templates_data['question_votedown']['email_from_name'] : $site_name; 920 $email_from = isset($qa_email_templates_data['question_votedown']['email_from']) ? $qa_email_templates_data['question_votedown']['email_from'] : $qa_from_email; 921 $email_subject = isset($qa_email_templates_data['question_votedown']['subject']) ? $qa_email_templates_data['question_votedown']['subject'] : ''; 922 $email_html = isset($qa_email_templates_data['question_votedown']['html']) ? $qa_email_templates_data['question_votedown']['html'] : ''; 923 924 $vars = array( 925 '{site_name}' => get_bloginfo('name'), 926 '{site_description}' => get_bloginfo('description'), 927 '{site_url}' => get_bloginfo('url'), 928 '{site_logo_url}' => get_option('question_bm_logo_url'), 929 930 '{user_name}' => $current_user->display_name, 931 '{user_avatar}' => get_avatar($current_user->ID, 60), 932 '{user_email}' => '', 933 934 '{question_title}' => $question_data->post_title, 935 '{question_url}' => $question_url, 936 '{question_edit_url}' => get_admin_url().'post.php?post='.$question_id.'&action=edit', 937 '{question_id}' => $question_id, 938 '{question_content}' => $question_data->post_content, 939 940 ); 941 942 943 944 945 $question_author_data = get_user_by('ID', $question_author); 946 $question_author_email = $question_author_data->user_email; 947 948 949 $email_data['email_to'] = $question_author_email; 950 $email_data['email_bcc'] = $email_bcc; 951 $email_data['email_from'] = $email_from; 952 $email_data['email_from_name'] = $email_from_name; 953 $email_data['subject'] = strtr($email_subject, $vars); 954 $email_data['html'] = strtr($email_html, $vars); 955 $email_data['attachments'] = array(); 956 957 $status = $class_qa_emails->qa_send_email($email_data); 958 959 960 961 endif; 891 elseif ($post_type == 'question') : 892 893 $question_id = $post_id; 894 895 896 897 $question_data = get_post($question_id); 898 $question_title = get_the_title($question_id); 899 $question_url = get_permalink($question_id); 900 $question_author = $question_data->post_author; 901 902 $email_data = array(); 903 $class_qa_emails = new class_qa_emails(); 904 $qa_email_templates_data_default = $class_qa_emails->qa_email_templates_data(); 905 $qa_email_templates_data = get_option('qa_email_templates_data', $qa_email_templates_data_default); 906 907 $enable = isset($qa_email_templates_data['question_votedown']['enable']) ? $qa_email_templates_data['question_votedown']['enable'] : 'no'; 908 909 910 if ($enable == 'yes') : 911 912 $email_bcc = isset($qa_email_templates_data['question_votedown']['email_to']) ? $qa_email_templates_data['question_votedown']['email_to'] : ''; 913 $email_from_name = isset($qa_email_templates_data['question_votedown']['email_from_name']) ? $qa_email_templates_data['question_votedown']['email_from_name'] : $site_name; 914 $email_from = isset($qa_email_templates_data['question_votedown']['email_from']) ? $qa_email_templates_data['question_votedown']['email_from'] : $qa_from_email; 915 $email_subject = isset($qa_email_templates_data['question_votedown']['subject']) ? $qa_email_templates_data['question_votedown']['subject'] : ''; 916 $email_html = isset($qa_email_templates_data['question_votedown']['html']) ? $qa_email_templates_data['question_votedown']['html'] : ''; 917 918 $vars = array( 919 '{site_name}' => get_bloginfo('name'), 920 '{site_description}' => get_bloginfo('description'), 921 '{site_url}' => get_bloginfo('url'), 922 '{site_logo_url}' => get_option('question_bm_logo_url'), 923 924 '{user_name}' => $current_user->display_name, 925 '{user_avatar}' => get_avatar($current_user->ID, 60), 926 '{user_email}' => '', 927 928 '{question_title}' => $question_data->post_title, 929 '{question_url}' => $question_url, 930 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_id . '&action=edit', 931 '{question_id}' => $question_id, 932 '{question_content}' => $question_data->post_content, 933 934 ); 935 936 937 938 939 $question_author_data = get_user_by('ID', $question_author); 940 $question_author_email = $question_author_data->user_email; 941 942 943 $email_data['email_to'] = $question_author_email; 944 $email_data['email_bcc'] = $email_bcc; 945 $email_data['email_from'] = $email_from; 946 $email_data['email_from_name'] = $email_from_name; 947 $email_data['subject'] = strtr($email_subject, $vars); 948 $email_data['html'] = strtr($email_html, $vars); 949 $email_data['attachments'] = array(); 950 951 $status = $class_qa_emails->qa_send_email($email_data); 952 962 953 963 954 964 955 endif; 965 956 957 958 endif; 966 959 } 967 960 } … … 971 964 972 965 973 add_action( 'qa_action_answer_vote_up', 'qa_action_answer_vote_up_email', 99 ); 974 975 if ( ! function_exists( 'qa_action_answer_vote_up_email' ) ) { 976 function qa_action_answer_vote_up_email( $post_id ) { 966 add_action('qa_action_answer_vote_up', 'qa_action_answer_vote_up_email', 99); 967 968 if (!function_exists('qa_action_answer_vote_up_email')) { 969 function qa_action_answer_vote_up_email($post_id) 970 { 977 971 978 972 $admin_email = get_option('admin_email'); … … 984 978 $qa_from_email = get_option('qa_from_email', $admin_email); 985 979 986 $post_data = get_post( $post_id);980 $post_data = get_post($post_id); 987 981 $post_type = isset($post_data->post_type) ? $post_data->post_type : ''; 988 982 … … 990 984 991 985 992 if ($post_type == 'answer') :993 994 $question_id = get_post_meta( $post_id, 'qa_answer_question_id', true);995 996 $question_data = get_post( $question_id);986 if ($post_type == 'answer') : 987 988 $question_id = get_post_meta($post_id, 'qa_answer_question_id', true); 989 990 $question_data = get_post($question_id); 997 991 $question_title = get_the_title($question_id); 998 992 $question_url = get_permalink($question_id); 999 993 1000 $answer_data = get_post( $post_id);994 $answer_data = get_post($post_id); 1001 995 $answer_url = get_permalink($post_id); 1002 996 $answer_url = get_permalink($post_id); … … 1012 1006 $enable = isset($qa_email_templates_data['answer_voteup']['enable']) ? $qa_email_templates_data['answer_voteup']['enable'] : 'no'; 1013 1007 1014 if ($enable == 'yes') :1008 if ($enable == 'yes') : 1015 1009 1016 1010 $email_bcc = isset($qa_email_templates_data['answer_voteup']['email_to']) ? $qa_email_templates_data['answer_voteup']['email_to'] : ''; … … 1032 1026 '{question_title}' => $question_data->post_title, 1033 1027 '{question_url}' => $question_url, 1034 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_id.'&action=edit',1028 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_id . '&action=edit', 1035 1029 '{question_id}' => $question_id, 1036 1030 '{question_content}' => $question_data->post_content, 1037 1031 1038 1032 '{answer_title}' => $answer_data->post_title, 1039 '{answer_url}' => $answer_url .'#single-answer-'.$post_id,1040 '{answer_edit_url}' => get_admin_url() .'post.php?post='.$post_id.'&action=edit',1033 '{answer_url}' => $answer_url . '#single-answer-' . $post_id, 1034 '{answer_edit_url}' => get_admin_url() . 'post.php?post=' . $post_id . '&action=edit', 1041 1035 '{answer_id}' => $post_id, 1042 1036 '{answer_content}' => $answer_data->post_content, … … 1058 1052 1059 1053 endif; 1060 elseif ($post_type == 'question') :1054 elseif ($post_type == 'question') : 1061 1055 1062 1056 $question_id = $post_id; … … 1064 1058 1065 1059 1066 $question_data = get_post( $question_id);1060 $question_data = get_post($question_id); 1067 1061 $question_title = get_the_title($question_id); 1068 1062 $question_url = get_permalink($question_id); … … 1077 1071 1078 1072 1079 if ($enable == 'yes') :1073 if ($enable == 'yes') : 1080 1074 1081 1075 $email_bcc = isset($qa_email_templates_data['question_voteup']['email_to']) ? $qa_email_templates_data['question_voteup']['email_to'] : ''; … … 1097 1091 '{question_title}' => $question_data->post_title, 1098 1092 '{question_url}' => $question_url, 1099 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_id.'&action=edit',1093 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_id . '&action=edit', 1100 1094 '{question_id}' => $question_id, 1101 1095 '{question_content}' => $question_data->post_content, … … 1126 1120 1127 1121 endif; 1128 1129 1122 } 1130 1123 } … … 1132 1125 1133 1126 1134 add_action( 'question_answer_assign_to_mail', 'question_answer_assign_to_mail', 99, 2 ); 1135 1136 if ( ! function_exists( 'question_answer_assign_to_mail' ) ) { 1137 function question_answer_assign_to_mail( $user_id, $post_id ) { 1127 add_action('question_answer_assign_to_mail', 'question_answer_assign_to_mail', 99, 2); 1128 1129 if (!function_exists('question_answer_assign_to_mail')) { 1130 function question_answer_assign_to_mail($user_id, $post_id) 1131 { 1138 1132 1139 1133 $admin_email = get_option('admin_email'); … … 1145 1139 $qa_from_email = get_option('qa_from_email', $admin_email); 1146 1140 1147 $post_data = get_post( $post_id);1141 $post_data = get_post($post_id); 1148 1142 $post_type = isset($post_data->post_type) ? $post_data->post_type : ''; 1149 1143 1150 1144 global $current_user; 1151 1145 1152 $question_id = get_post_meta( $post_id, 'qa_answer_question_id', true);1153 1154 $question_data = get_post( $question_id);1146 $question_id = get_post_meta($post_id, 'qa_answer_question_id', true); 1147 1148 $question_data = get_post($question_id); 1155 1149 $question_title = get_the_title($question_id); 1156 1150 $question_url = get_permalink($question_id); … … 1165 1159 $enable = isset($qa_email_templates_data['assign_to']['enable']) ? $qa_email_templates_data['assign_to']['enable'] : 'no'; 1166 1160 1167 if ($enable == 'yes') :1161 if ($enable == 'yes') : 1168 1162 1169 1163 $email_bcc = isset($qa_email_templates_data['assign_to']['email_to']) ? $qa_email_templates_data['assign_to']['email_to'] : ''; … … 1185 1179 '{question_title}' => $question_data->post_title, 1186 1180 '{question_url}' => $question_url, 1187 '{question_edit_url}' => get_admin_url() .'post.php?post='.$question_id.'&action=edit',1181 '{question_edit_url}' => get_admin_url() . 'post.php?post=' . $question_id . '&action=edit', 1188 1182 '{question_id}' => $question_id, 1189 1183 '{question_content}' => $question_data->post_content, … … 1201 1195 $email_data['attachments'] = array(); 1202 1196 1197 1198 1203 1199 $status = $class_qa_emails->qa_send_email($email_data); 1204 1200 1205 1201 endif; 1206 1207 1208 1202 } 1209 1203 } 1210 1211 1212 -
question-answer/trunk/question-answer.php
r2933205 r3429727 107 107 108 108 109 109 110 add_role( 110 111 'qa_manager', … … 113 114 'read' => true, 114 115 'create_question' => true, 115 'create_others_question' => true, 116 116 'create_reply' => true, 117 117 'delete_question' => true, 118 118 'upload_files' => true, … … 152 152 require_once(QA_PLUGIN_DIR . 'includes/classes/class-widget-website-stats.php'); 153 153 require_once(QA_PLUGIN_DIR . 'includes/classes/class-widget-latest-questions.php'); 154 require_once(QA_PLUGIN_DIR . 'includes/classes/class-question-category.php'); 154 155 155 156 -
question-answer/trunk/readme.txt
r3126665 r3429727 4 4 Tags: Question Answer, Question, Answer 5 5 Requires at least: 4.1 6 Tested up to: 6. 66 Tested up to: 6.2 7 7 Stable tag: 1.2.70 8 8 License: GPLv2 or later -
question-answer/trunk/templates/add-question/add-question-hook.php
r2933205 r3429727 604 604 605 605 606 607 606 608 wp_set_post_terms($question_ID, $question_tags, 'question_tags', true); 607 609 wp_set_post_terms($question_ID, $question_cat, 'question_cat'); … … 611 613 update_post_meta($question_ID, 'qa_visiblity', $qa_visiblity); 612 614 615 $qa_assign_to = get_term_meta($question_cat, 'qa_assign_to', true); 616 $qa_assign_to = is_serialized($qa_assign_to) ? unserialize($qa_assign_to) : $qa_assign_to; 617 618 if (!empty($qa_assign_to)) { 619 620 update_post_meta($question_ID, 'qa_assign_to', $qa_assign_to); 621 622 623 foreach ($qa_assign_to as $userId) { 624 625 do_action('question_answer_assign_to_mail', $userId, $question_ID); 626 } 627 } 628 629 613 630 614 631 … … 635 652 <?php echo apply_filters('qa_q_submitted_thank_you', sprintf(__('%s Thanks for submit question. see your question here <a href="%s">%s</a>', 'question-answer'), '<i class="far fa-check-circle"></i>', $question_url, '#' . $question_ID)); ?> 636 653 </div> 654 655 <script> 656 document.addEventListener("DOMContentLoaded", function(event) { 657 658 var form = document.querySelector('#qa-question-submit'); 659 660 console.log(form); 661 662 setTimeout(() => { 663 form.reset(); 664 }, 3000) 665 666 667 }) 668 </script> 637 669 <?php 638 670 -
question-answer/trunk/templates/add-question/add-question-new.php
r2720988 r3429727 2 2 3 3 4 if ( !defined('ABSPATH')) exit; // if direct access4 if (!defined('ABSPATH')) exit; // if direct access 5 5 6 6 … … 9 9 10 10 11 $class_qa_functions = new class_qa_functions();12 13 $qa_reCAPTCHA_enable_question = get_option('qa_reCAPTCHA_enable_question'); 14 $qa_question_login_page_id= get_option('qa_question_login_page_id');15 $login_page_url= get_permalink($qa_question_login_page_id);16 $qa_page_question_post_redirect= get_option('qa_page_question_post_redirect');17 $redirect_page_url= get_permalink($qa_page_question_post_redirect);18 $qa_account_required_post_question= get_option('qa_account_required_post_question', 'yes');19 $qa_submitted_post_status = get_option('qa_submitted_question_status', 'pending');20 $qa_page_myaccount = get_option('qa_page_myaccount', '');21 $qa_page_myaccount_url = !empty($qa_page_myaccount) ? get_permalink($qa_page_myaccount) : wp_login_url($_SERVER['REQUEST_URI']);11 $class_qa_functions = new class_qa_functions(); 12 13 $qa_reCAPTCHA_enable_question = get_option('qa_reCAPTCHA_enable_question'); 14 $qa_question_login_page_id = get_option('qa_question_login_page_id'); 15 $login_page_url = get_permalink($qa_question_login_page_id); 16 $qa_page_question_post_redirect = get_option('qa_page_question_post_redirect'); 17 $redirect_page_url = get_permalink($qa_page_question_post_redirect); 18 $qa_account_required_post_question = get_option('qa_account_required_post_question', 'yes'); 19 $qa_submitted_post_status = get_option('qa_submitted_question_status', 'pending'); 20 $qa_page_myaccount = get_option('qa_page_myaccount', ''); 21 $qa_page_myaccount_url = !empty($qa_page_myaccount) ? get_permalink($qa_page_myaccount) : wp_login_url($_SERVER['REQUEST_URI']); 22 22 23 23 … … 29 29 30 30 <?php 31 if (!empty($_POST)){31 if (!empty($_POST)) { 32 32 do_action('qa_question_submit_data', $_POST); 33 33 } … … 36 36 <?php do_action('question_answer_submit_question_before'); ?> 37 37 38 <form enctype="multipart/form-data" method="post" action="<?php echo str_replace('%7E', '~', esc_url_raw($_SERVER['REQUEST_URI'])); ?>">38 <form enctype="multipart/form-data" id="qa-question-submit" method="post" action="<?php echo str_replace('%7E', '~', esc_url_raw($_SERVER['REQUEST_URI'])); ?>"> 39 39 <?php 40 do_action('question_answer_submit_question');41 ?>40 do_action('question_answer_submit_question'); 41 ?> 42 42 </form> 43 43 44 44 <?php do_action('question_answer_submit_question_after'); ?> 45 45 46 46 </div> 47 47 48 48 <?php 49 50 -
question-answer/trunk/templates/single-question/single-question-hook.php
r2933205 r3429727 57 57 ?> 58 58 <div class="qa-wrapper"> 59 <div class="top-nav"> 60 <div class="nav-left"> 61 62 63 <?php 64 65 $qa_page_question_archive = get_option('qa_page_question_archive'); 66 $qa_page_question_archive_url = get_permalink($qa_page_question_archive); 67 68 ?> 69 70 <div class="item"><a href="<?php echo $qa_page_question_archive_url; ?>"> <i class="fas fa-reply-all"></i> <?php echo __('Back to Archive', 'question-answer'); ?></a></div> 71 72 73 <div class="item search"><i class="fa fa-search" aria-hidden="true"></i> 74 75 <div class="question-search"> 76 <form action="<?php echo $qa_page_question_archive_url; ?>" method="get"> 77 <div class="form-field"> 78 <div class="input-title"><?php echo __('Keyword', 'question-answer'); ?></div> 79 <div class="input-field"> 80 <input autocomplete="off" placeholder="Write..." type="text" value="" name="qaKeyword"> 81 </div> 82 </div> 83 84 <div class="form-field"> 85 <div class="input-title"><?php echo __('Select Category', 'question-answer'); ?></div> 86 <div class="input-field"> 87 <select name="qa_category"> 88 <option value=""><?php echo __('All categories', 'question-answer'); ?></option> 89 <?php 90 91 foreach (qa_get_categories() as $cat_id => $cat_info) { 92 ksort($cat_info); 93 94 $this_category = get_term($cat_id); 95 96 //if(!empty($this_category)) 97 foreach ($cat_info as $key => $value) { 98 99 100 if ($key == 0) { 101 ?><option <?php selected($this_category->slug, $category); ?> value="<?php echo esc_attr($this_category->slug); ?>"><?php echo esc_html($value); ?></option><?php 102 } else { 103 $this_category = get_category($key); 104 105 ?><option <?php selected($this_category->slug, $category); ?> value="<?php echo esc_attr($this_category->slug); ?>"> - <?php echo esc_html($value); ?></option> <?php 106 } 107 } 108 } ?> 109 110 </select> 111 </div> 112 </div> 113 114 115 116 117 118 119 <div class="form-field"> 120 <div class="input-title"><?php echo __('Question Status', 'question-answer'); ?></div> 121 <div class="input-field"> 122 <select id="filter_by" name="question_status"> <?php 123 $status = $class_qa_functions->qa_question_status(); 124 foreach ($status as $key => $value) { 125 ?><option <?php selected($key, $filter_by); ?> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value); ?></option><?php 126 } ?> 127 </select> 128 </div> 129 </div> 130 131 132 <div class="form-field"> 133 <div class="input-title"></div> 134 <div class="input-field"> 135 <input type="submit" value="Submit"> 136 </div> 137 </div> 138 139 </form> 140 </div> 141 142 143 </div> 144 </div> 145 146 147 148 149 150 <div class="nav-right"> 151 152 <?php 153 154 $qa_page_question_post = get_option('qa_page_question_post'); 155 $qa_page_question_post_url = get_permalink($qa_page_question_post); 156 157 ?> 158 159 <div class="item ask-question"><a href="<?php echo $qa_page_question_post_url; ?>"><?php echo __('Ask Question', 'question-answer'); ?></a></div> 160 161 <?php 162 if (is_user_logged_in()) : 163 164 $userid = get_current_user_id(); 165 $paged = 1; 166 global $wpdb; 167 $PER_PAGE = 10; 168 169 $total_entries = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}qa_notification WHERE subscriber_id='$userid' ORDER BY id DESC"); 170 171 172 $OFFSET = ($paged - 1) * $PER_PAGE; 173 $entries = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}qa_notification WHERE subscriber_id='$userid' ORDER BY id DESC LIMIT $PER_PAGE OFFSET $OFFSET"); 174 //$wdm_downloads = $wpdb->get_results( $entries, OBJECT ); 175 176 $entries_unread = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}qa_notification WHERE subscriber_id='$userid' AND status='unread' ORDER BY id DESC LIMIT $PER_PAGE OFFSET $OFFSET"); 177 178 $total_unread_count = count($entries_unread); 179 180 181 ?> 182 183 184 <div class="item notifications"><i class="fas fa-bell"></i> 185 <span class="count"><?php if ($total_unread_count >= 20) echo __('20+', 'question-answer'); 186 else echo $total_unread_count; ?></span> 187 188 <div class="notification-wrapper"> 189 <div class="notification-list-top"> 190 <span class="mark-all-read"><?php echo sprintf(__('%s Mark all as read', 'question-answer'), '<i class="far fa-check-circle"></i>'); ?></span> 191 192 </div> 193 <div class="notification-list"> 194 195 <div class="list-items"> 196 <?php 197 198 if (!empty($entries)) : 199 foreach ($entries as $entry) { 200 201 202 $id = $entry->id; 203 $q_id = $entry->q_id; 204 $a_id = $entry->a_id; 205 $c_id = $entry->c_id; 206 $user_id = $entry->user_id; 207 $subscriber_id = $entry->subscriber_id; 208 $action = $entry->action; 209 $datetime = $entry->datetime; 210 $status = $entry->status; 211 212 $entry_date = new DateTime($datetime); 213 $datetime = $entry_date->format('M d, Y h:i A'); 214 215 $user = get_user_by('ID', $user_id); 216 217 if (!empty($user->display_name)) { 218 $user_display_name = $user->display_name; 219 } else { 220 221 $qa_contact_name = get_post_meta($id, 'qa_contact_name', true); 222 223 $user_display_name = !empty($qa_contact_name) ? $qa_contact_name : __('Anonymous', 'question-answer'); 224 } 225 226 227 if ($status == 'unread') { 228 $notify_mark_html = '<span class="notify-mark" notify_id="' . $id . '" ><i class="far fa-bell"></i></span>'; 229 } else { 230 $notify_mark_html = '<span class="notify-mark" notify_id="' . $id . '" ><i class="far fa-bell-slash"></i></span>'; 231 } 232 233 234 ?> 235 236 <div class="item item-<?php echo $id; ?> <?php if ($status == 'unread') echo $status; ?>"> 237 <?php 238 239 240 echo '<img src="' . get_avatar_url($user_id, array('size' => 40)) . '" class="thumb">'; 241 242 if ($action == 'new_question') { 243 244 echo '<span class="name">' . $user_display_name . '</span> ' . __('posted', 'question-answer') . ' <span class="action">' . __('New Question', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '" class="link">' . get_the_title($q_id) . '</a> '; 245 246 ?> 247 <div class="meta"> 248 249 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 250 <?php echo $notify_mark_html; ?> 251 </div> 252 <?php 253 254 } elseif ($action == 'new_answer') { 255 256 257 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Answered', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#single-answer-' . $a_id . '" class="link">' . get_the_title($q_id) . '</a> '; 258 259 ?> 260 <div class="meta"> 261 262 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 263 <?php echo $notify_mark_html; ?> 264 </div> 265 <?php 266 267 } elseif ($action == 'best_answer') { 268 269 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Choosed best answer', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#single-answer-' . $a_id . '" class="link">' . get_the_title($a_id) . '</a>'; 270 271 ?> 272 <div class="meta"> 273 274 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 275 <?php echo $notify_mark_html; ?> 276 </div> 277 <?php 278 279 280 } elseif ($action == 'best_answer_removed') { 281 282 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Removed best answer', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#single-answer-' . $a_id . '" class="link">' . get_the_title($a_id) . '</a>'; 283 284 ?> 285 <div class="meta"> 286 287 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 288 <?php echo $notify_mark_html; ?> 289 </div> 290 <?php 291 292 293 } elseif ($action == 'new_comment') { 294 295 $comment_post_data = get_comment($c_id); 296 297 if (!empty($comment_post_data->comment_post_ID)) : 298 299 $comment_post_id = $comment_post_data->comment_post_ID; 300 301 $comment_post_type = get_post_type($comment_post_id); 302 303 if ($comment_post_type == 'answer') { 304 305 $flag_post_type = 'answer'; 306 307 $q_id = get_post_meta($comment_post_id, 'qa_answer_question_id', true); 308 } else { 309 $flag_post_type = 'question'; 310 } 311 312 $q_id = get_post_meta($a_id, 'qa_answer_question_id', true); 313 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Commented', 'question-answer') . '</span> on ' . $flag_post_type . ' <a href="' . get_permalink($q_id) . '#comment-' . $c_id . '" class="link">' . get_the_title($a_id) . '</a>'; 314 315 ?> 316 <div class="meta"> 317 318 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 319 <?php echo $notify_mark_html; ?> 320 </div> 321 <?php 322 323 324 endif; 325 } elseif ($action == 'comment_flag') { 326 327 $comment_post_data = get_comment($c_id); 328 329 330 331 $comment_post_id = $comment_post_data->comment_post_ID; 332 333 $comment_post_type = get_post_type($comment_post_id); 334 335 if ($comment_post_type == 'answer') { 336 337 $flag_post_type = 'answer'; 338 $link_extra = '#comment-' . $c_id; 339 $q_id = get_post_meta($comment_post_id, 'qa_answer_question_id', true); 340 } else { 341 $flag_post_type = 'question'; 342 $link_extra = '#comment-' . $c_id; 343 $q_id = $comment_post_id; 344 } 345 346 347 348 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Flagged comment', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#comment-' . $c_id . '" class="link">' . get_the_title($q_id) . '</a>'; 349 350 ?> 351 <div class="meta"> 352 353 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 354 <?php echo $notify_mark_html; ?> 355 </div> 356 <?php 357 358 359 360 } elseif ($action == 'comment_vote_up') { 361 362 $comment_post_data = get_comment($c_id); 363 $comment_post_id = $comment_post_data->comment_post_ID; 364 365 $comment_post_type = get_post_type($comment_post_id); 366 367 if ($comment_post_type == 'answer') { 368 369 $flag_post_type = 'answer'; 370 $link_extra = '#comment-' . $c_id; 371 $q_id = get_post_meta($comment_post_id, 'qa_answer_question_id', true); 372 } else { 373 $flag_post_type = 'question'; 374 $link_extra = '#comment-' . $c_id; 375 $q_id = $comment_post_id; 376 } 377 378 379 380 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('comment vote up', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#comment-' . $c_id . '" class="link">' . get_the_title($q_id) . '</a>'; 381 382 ?> 383 <div class="meta"> 384 385 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 386 <?php echo $notify_mark_html; ?> 387 </div> 388 <?php 389 390 391 392 } elseif ($action == 'comment_vote_down') { 393 394 $comment_post_data = get_comment($c_id); 395 $comment_post_id = $comment_post_data->comment_post_ID; 396 397 $comment_post_type = get_post_type($comment_post_id); 398 399 if ($comment_post_type == 'answer') { 400 401 $flag_post_type = 'answer'; 402 $link_extra = '#comment-' . $c_id; 403 $q_id = get_post_meta($comment_post_id, 'qa_answer_question_id', true); 404 } else { 405 $flag_post_type = 'question'; 406 $link_extra = '#comment-' . $c_id; 407 $q_id = $comment_post_id; 408 } 409 410 411 412 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('comment vote down', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#comment-' . $c_id . '" class="link">' . get_the_title($q_id) . '</a>'; 413 414 ?> 415 <div class="meta"> 416 417 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 418 <?php echo $notify_mark_html; ?> 419 </div> 420 <?php 421 422 423 } elseif ($action == 'vote_up') { 424 425 $q_id = get_post_meta($a_id, 'qa_answer_question_id', true); 426 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Vote Up', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#single-answer-' . $a_id . '" class="link">' . get_the_title($a_id) . '</a>'; 427 428 ?> 429 <div class="meta"> 430 431 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 432 <?php echo $notify_mark_html; ?> 433 </div> 434 <?php 435 436 437 438 } elseif ($action == 'vote_down') { 439 440 $q_id = get_post_meta($a_id, 'qa_answer_question_id', true); 441 echo ' <span class="name">' . $user_display_name . '</span> <span class="action">' . __('Vote Down', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '#single-answer-' . $a_id . '" class="link">' . get_the_title($a_id) . '</a>'; 442 443 ?> 444 <div class="meta"> 445 446 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 447 <?php echo $notify_mark_html; ?> 448 </div> 449 <?php 450 451 452 453 } elseif ($action == 'q_solved') { 454 455 echo ' <span class="name">' . $user_display_name . '</span> ' . __('marked', 'question-answer') . ' <span class="action">' . __('Solved', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '" class="link">' . get_the_title($q_id) . '</a>'; 456 457 ?> 458 <div class="meta"> 459 460 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 461 <?php echo $notify_mark_html; ?> 462 </div> 463 <?php 464 465 466 } elseif ($action == 'q_not_solved') { 467 468 echo ' <span class="name">' . $user_display_name . '</span> ' . __('marked', 'question-answer') . ' <span class="action">' . __('Not Solved', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . '" class="link">' . get_the_title($q_id) . '</a>'; 469 470 ?> 471 <div class="meta"> 472 473 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 474 <?php echo $notify_mark_html; ?> 475 </div> 476 <?php 477 478 479 } elseif ($action == 'flag') { 480 481 if (!empty($a_id)) { 482 483 $flag_post_type = 'answer'; 484 $link_extra = '#single-answer-' . $a_id; 485 $q_id = get_post_meta($a_id, 'qa_answer_question_id', true); 486 $post_id = $a_id; 487 } 488 if (!empty($q_id)) { 489 490 $flag_post_type = 'question'; 491 $link_extra = ''; 492 $post_id = $q_id; 493 } 494 495 496 497 498 echo ' <span class="name">' . $user_display_name . '</span> ' . sprintf(__('flagged your %s', 'question-answer'), $flag_post_type) . ' <span class="name"></span> <a href="' . get_permalink($q_id) . $link_extra . '" class="link">' . get_the_title($post_id) . '</a>'; 499 500 ?> 501 <div class="meta"> 502 503 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 504 <?php echo $notify_mark_html; ?> 505 </div> 506 <?php 507 508 509 } elseif ($action == 'unflag') { 510 511 if (!empty($a_id)) { 512 513 $flag_post_type = 'answer'; 514 $link_extra = '#single-answer-' . $a_id; 515 } else { 516 517 $flag_post_type = 'question'; 518 $link_extra = ''; 519 } 520 521 522 $q_id = get_post_meta($a_id, 'qa_answer_question_id', true); 523 echo ' <span class="name">' . $user_display_name . '</span> ' . $flag_post_type . ' <span class="action">' . __('unflagged ', 'question-answer') . '</span> <a href="' . get_permalink($q_id) . $link_extra . '" class="link">' . get_the_title($q_id) . '</a>'; 524 525 ?> 526 <div class="meta"> 527 528 <span class="notify-time"><i class="far fa-clock"></i> <?php echo $datetime; ?></span> 529 <?php echo $notify_mark_html; ?> 530 </div> 531 <?php 532 533 534 535 } 536 537 ?> 538 </div> 539 <?php 540 541 542 } 543 else : 544 545 ?> 546 <div class="empty-notify item"><i class="fa fa-bell-slash-o" aria-hidden="true"></i> <?php echo __('No notification right now.', 'question-answer'); ?></div> 547 <?php 548 endif; 549 550 ?> 551 </div> 552 553 </div> 554 <div class="notification-list-bottom"> 555 <div class="load-notifications" pagenum="2"><span class="spinner"><i class="fas fa-spinner fa-spin"></i></span><?php echo __('Load more', 'question-answer'); ?></div> 556 </div> 557 </div> 558 559 560 </div> 561 562 <?php 563 564 endif; 565 566 ?> 567 568 569 570 </div> 571 572 573 </div> 59 574 60 </div> 575 61 … … 1051 537 <div class="subscribers"> 1052 538 1053 <div class="title"><?php echo sprintf(__('%s %s Subscribers', 'question-answer'), '<i class="far fa-bell"></i>', $q_subscriber_count); ?></div> 1054 <?php 1055 $max_subscriber = 10; 1056 1057 $i = 1; 1058 if (is_array($q_subscriber)) 1059 foreach ($q_subscriber as $subscriber) { 1060 1061 $user = get_user_by('ID', $subscriber); 1062 1063 if (!empty($user->display_name)) 1064 echo '<div title="' . $user->display_name . '" class="subscriber">' . get_avatar($subscriber, "45") . '</div>'; 1065 1066 if ($i >= $max_subscriber) { 1067 return; 1068 } 1069 } 1070 ?> 1071 1072 </div> 1073 1074 <?php if (!empty($qa_assign_to)) : ?> 1075 1076 <div class="assign-to"> 1077 <span class="assign-to-title">Assign to: </span> 1078 539 <div> 540 <div class="title"><?php echo sprintf(__('%s %s Subscribers', 'question-answer'), '<i class="far fa-bell"></i>', $q_subscriber_count); ?></div> 1079 541 <?php 1080 1081 if (!empty($qa_assign_to)) 1082 foreach ($qa_assign_to as $userId) { 1083 $user = get_user_by('id', $userId); 1084 $avatar_url = get_avatar_url($userId); 1085 1086 1087 1088 ?> 1089 <div class="item" title="<?php echo isset($user->display_name) ? $user->display_name : 'hhhhhhhhhhhhh'; ?>"> 1090 <img width="30" src="<?php echo $avatar_url; ?>"> 1091 </div> 1092 <?php 542 $max_subscriber = 10; 543 544 $i = 1; 545 if (is_array($q_subscriber)) 546 foreach ($q_subscriber as $subscriber) { 547 548 $user = get_user_by('ID', $subscriber); 549 550 if (!empty($user->display_name)) 551 echo '<div title="' . $user->display_name . '" class="subscriber">' . get_avatar($subscriber, "45") . '</div>'; 552 553 if ($i >= $max_subscriber) { 554 return; 555 } 1093 556 } 1094 557 ?> 1095 558 1096 559 </div> 1097 <?php endif; 560 561 <?php if (!empty($qa_assign_to)) : ?> 562 563 <div class="assign-to"> 564 <span class="assign-to-title">Assign to: </span> 565 566 <?php 567 568 if (!empty($qa_assign_to)) 569 foreach ($qa_assign_to as $userId) { 570 $user = get_user_by('id', $userId); 571 $avatar_url = get_avatar_url($userId); 572 573 574 575 ?> 576 <div class="item" title="<?php echo isset($user->display_name) ? $user->display_name : 'hhhhhhhhhhhhh'; ?>"> 577 <img width="30" src="<?php echo $avatar_url; ?>"> 578 </div> 579 <?php 580 } 581 ?> 582 583 </div> 584 <?php endif; ?> 585 </div> 586 587 588 589 <?php 1098 590 } 1099 591 }
Note: See TracChangeset
for help on using the changeset viewer.