Plugin Directory

Changeset 3429727


Ignore:
Timestamp:
12/30/2025 04:18:10 PM (11 days ago)
Author:
pickplugins
Message:

version update

Location:
question-answer/trunk
Files:
2 added
17 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • question-answer/trunk/assets/front/css/add-question.css

    r2267336 r3429727  
    22/* CSS Document */
    33
    4 .qa_add_question{}
     4.qa_add_question {}
    55
    66
    7 .submit-question{}
    8 .submit-question .errors{
     7.submit-question {}
     8
     9.submit-question .errors {
    910  margin-bottom: 30px;
    1011}
     12
    1113.submit-question .errors .error {
    1214  color: #f0611a;
     
    2830
    2931
    30 .submit-question .qa-suggestions{}
     32.submit-question .qa-suggestions {}
    3133
    32 .submit-question  .qa-suggestions .suggestion-title {
     34.submit-question .qa-suggestions .suggestion-title {
    3335  font-weight: bold;
    3436  display: none;
     
    3941}
    4042
    41 .submit-question .qa-suggestions li{}
     43.submit-question .qa-suggestions li {}
     44
    4245.submit-question .qa-suggestions li a {
    4346  display: block;
     
    5053
    5154
    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;
    5657}
    5758
    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;
    6066}
    6167
    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%;
    7470}
    7571
    7672
    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 {
    7890  background: #5f6caf none repeat scroll 0 0;
    7991  padding: 10px;
     
    8395}
    8496
    85 .qa-q-submitted a{
     97.qa-q-submitted a {
    8698  color: #fff;
    8799}
    88100
    89101
    90 .poll-field-wrap{}
     102.poll-field-wrap {}
    91103
    92104
    93 .poll-field-wrap .add-poll{
     105.poll-field-wrap .add-poll {
    94106  margin-bottom: 10px;
    95107}
    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 {
    98112  margin-bottom: 10px;
    99113}
    100 .poll-field-wrap .poll-items input[type="text"]{
     114
     115.poll-field-wrap .poll-items input[type="text"] {
    101116  width: 80% !important;
    102117}
    103118
    104 .poll-field-wrap .poll-items .sort-hndle{
     119.poll-field-wrap .poll-items .sort-hndle {
    105120  cursor: move;
    106121  width: 20px;
     
    110125}
    111126
    112 .poll-field-wrap .poll-items .remove{}
     127.poll-field-wrap .poll-items .remove {}
    113128
    114129
     
    116131
    117132
    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 {
    120140    width: 100%;
    121     float: none;
    122     margin-bottom: 20px;
    123     font-weight: bold;
     141    margin-bottom: 10px;
     142    font-size: 20px;
    124143  }
    125144
     
    129148
    130149}
    131 
    132 
    133 
    134 
    135 
    136 
    137 
    138 
  • question-answer/trunk/assets/front/css/single-question.css

    r2453640 r3429727  
    22/* CSS Document */
    33
    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}
    89
    910
     
    1314    display: inline-block;
    1415    font-size: 12px;
    15      margin-right: 10px;
     16    margin-right: 10px;
    1617    padding: 0 0 5px 0;
    1718    text-decoration: none;
     
    1920
    2021
    21 .single-question .qa_question_status { 
    22     float:right;
     22.single-question .qa_question_status {
     23    float: right;
    2324}
    2425
     
    4445
    4546}
    46 .single-question .question-content .content-header .meta{
     47
     48.single-question .question-content .content-header .meta {
    4749    display: inline-block;
    4850    vertical-align: top;
     
    5355    margin-top: 10px;
    5456}
     57
    5558.single-question .question-content .content-body {
    56      padding: 10px;
     59    padding: 10px;
    5760    clear: both;
    5861}
     
    6366
    6467.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 {}
    7174
    7275.single-question .qa-comments li {
     
    8083
    8184.single-question .qa-avatar img {
    82   border-radius: 0;
    83   box-shadow: none;
     85    border-radius: 0;
     86    box-shadow: none;
    8487}
    8588
     
    111114
    112115
    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 {
    114118    background: #5f6caf none repeat scroll 0 0;
    115119    border-radius: 3px;
     
    124128
    125129
    126 .single-question .comment-vote .comment-thumb-down {
    127 
    128 }
     130.single-question .comment-vote .comment-thumb-down {}
    129131
    130132.single-question .comment-vote .comment-vote-count {
     
    134136}
    135137
    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 {
    137140    display: block;
    138141}
    139142
    140 .single-question .qa-comment-flag .waiting{
     143.single-question .qa-comment-flag .waiting {
    141144    display: none;
    142145}
     
    155158
    156159.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
    170172.single-question .question-content .qa-user {
    171173    font-size: 16px;
     
    179181
    180182.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;
    184186}
    185187
    186188.single-question .qa-comments {
    187   margin-top: 40px;
    188   padding: 0;
     189    margin-top: 40px;
     190    padding: 0;
    189191}
    190192
     
    204206}
    205207
    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 {
    212216    display: inline;
    213217}
    214218
    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 {
    223229
    224230    display: none;
     
    228234
    229235.single-question .qa-is-solved.unsolved {
    230   background: #fa877f none repeat scroll 0 0;
     236    background: #fa877f none repeat scroll 0 0;
    231237}
    232238
     
    234240
    235241.answer-post {
    236   margin-bottom: 30px;
    237 }
    238 
    239 
    240 
    241 .qa-closed{
     242    margin-bottom: 30px;
     243}
     244
     245
     246
     247.qa-closed {
    242248    background: #FF9800 none repeat scroll 0 0;
    243249    border-radius: 3px;
     
    269275}
    270276
    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 {
    282288    display: inline;
    283289}
    284290
    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 {
    314320    display: inline;
    315321}
    316 .qa-featured.qa-featured-yes:hover .featured{
     322
     323.qa-featured.qa-featured-yes:hover .featured {
    317324    display: none;
    318325}
     
    353360
    354361
    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 {
    365373    display: inline;
    366374}
    367375
    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 {
    377386    display: none;
    378387}
     
    383392}
    384393
    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 {
    389400    display: inline;
    390401}
     
    398409    padding: 10px;
    399410    background: #5f6caf26;
    400 }
     411    display: flex;
     412    justify-content: space-between;
     413    align-items: center;
     414}
     415
    401416.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
    406422.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;
    412428}
    413429
    414430.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 {
    420437    padding: 10px;
    421438}
    422 .single-question .assign-to .assign-to-title{
     439
     440.single-question .assign-to .assign-to-title {
    423441    display: inline-block;
    424442    vertical-align: top;
     
    426444    margin-right: 15px;
    427445}
    428 .single-question  .assign-to .item{
     446
     447.single-question .assign-to .item {
    429448    display: inline-block;
    430449}
     
    436455    margin: 10px 0;
    437456}
     457
    438458.single-question .answer-pagination .previous {
    439459    display: inline-block;
    440460    vertical-align: top;
    441461}
     462
    442463.single-question .answer-pagination .next {
    443464    float: right;
     
    445466
    446467
    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 {
    448470    background: #5f6caf none repeat scroll 0 0;
    449471    border-radius: 3px;
     
    458480
    459481
    460 .question-closed{
     482.question-closed {
    461483    background: #b5242440;
    462484    padding: 10px;
     
    464486}
    465487
    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 {
    469495    border: 1px solid #f1f1f1;
    470496    cursor: pointer;
    471497    padding: 10px;
    472498    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
    477509}
    478510
     
    494526    margin-bottom: 20px;
    495527}
     528
    496529.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 {}
    509540
    510541.form-answer-post {
     
    514545
    515546.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;
    519550}
    520551
    521552.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;
    525556}
    526557
     
    531562}
    532563
    533 .all-single-answer .list_best_answer {
    534 
    535 }
     564.all-single-answer .list_best_answer {}
     565
    536566.all-single-answer .list_best_answer .qa-answer-details {
    537567    background: #5f6caf26;
     
    539569
    540570.single-answer {
    541   margin: 31px 0;
    542   padding: 15px 5px;
     571    margin: 31px 0;
     572    padding: 15px 5px;
    543573}
    544574
     
    547577    margin: 0 50px 15px 70px;
    548578}
    549 .all-single-answer .list_best_answer .best-answer-ribbon{
     579
     580.all-single-answer .list_best_answer .best-answer-ribbon {
    550581    display: block;
    551582
    552583}
     584
    553585.single-answer .best-answer-ribbon span {
    554586    background: #ffac41;
     
    563595    float: right;
    564596    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;
    570602    color: #5f6caf !important;
    571603}
     
    573605.qa-single-vote .qa-thumb-up,
    574606.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;
    577609    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
    584617.qa-single-vote .qa-thumb-up:hover,
    585618.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;
    589622}
    590623
    591624.qa-thumb-reply {
    592     margin-top:12px;
     625    margin-top: 12px;
    593626}
    594627
     
    597630}
    598631
    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;
    602635}
    603636
    604637.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;
    610643    cursor: pointer;
    611644    padding: 10px 0;
     
    614647
    615648.single-question .qa-answer-avatar {
    616   border-radius: 0;
    617   box-shadow: none;
     649    border-radius: 0;
     650    box-shadow: none;
    618651}
    619652
     
    624657    border: 1px solid #f1f1f1;
    625658}
     659
    626660.single-question .qa-answer-metas {
    627   background-color: #f1f1f1;
    628   padding: 10px;
     661    background-color: #f1f1f1;
     662    padding: 10px;
    629663}
    630664
    631665.qa-answer-metas span {
    632   margin-right: 10px;
     666    margin-right: 10px;
    633667}
    634668
     
    640674    display: inline-block;
    641675}
     676
    642677.single-question .qa-answer-date {
    643   font-size: 13px;
     678    font-size: 13px;
    644679}
    645680
    646681.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;
    652687}
    653688
    654689
    655690.qa-answer-content {
    656     padding:10px;
     691    padding: 10px;
    657692}
    658693
    659694span.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%;
    667702}
    668703
    669704.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;
    672707}
    673708
     
    698733    outline: none;
    699734}
    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 {
    705741    display: inline;
    706742}
     
    715751}
    716752
    717 .qa-comment-reply{
     753.qa-comment-reply {
    718754    margin-left: 70px !important;
    719755}
     
    729765    text-align: center;
    730766}
    731 .qa-answer-reply i{
    732     margin-right:5px;
     767
     768.qa-answer-reply i {
     769    margin-right: 5px;
    733770}
    734771
     
    739776
    740777.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;
    752789}
    753790
    754791.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
    763801.qa-reply-popup .qa-reply-header {
    764   display: block;
     802    display: block;
    765803}
    766804
    767805.qa-reply-popup textarea {
    768   display: block;
    769   margin-bottom: 5px;
    770   width: 97%;
     806    display: block;
     807    margin-bottom: 5px;
     808    width: 97%;
    771809}
    772810
    773811
    774812.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;
    787825}
    788826
     
    803841    text-align: center;
    804842    cursor: pointer;
    805     margin:0 auto;
     843    margin: 0 auto;
    806844}
    807845
     
    825863
    826864.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}
    841890
    842891
    843892.single-question .qa-polls {
    844   margin: 20px 0;
    845 }
    846    
     893    margin: 20px 0;
     894}
     895
    847896.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;
    851900}
    852901
    853902
    854903.single-question .qa-polls li .fa-dot-circle-o {
    855   display: none;
     904    display: none;
    856905}
    857906
    858907
    859908.single-question .qa-polls li.active .fa-dot-circle-o {
    860   display: inline-block;
    861 }
    862    
     909    display: inline-block;
     910}
     911
    863912.single-question .qa-polls li.active .fa-circle-o {
    864   display: none;
    865 }   
     913    display: none;
     914}
    866915
    867916
    868917.single-question .poll-result {
    869   display: none;
    870 }
     918    display: none;
     919}
     920
    871921.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;
    876926}
    877927
    878928.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
    885935.single-question .poll-result .loading {
    886   display: none;
     936    display: none;
    887937}
    888938
     
    896946
    897947}
     948
    898949.single-question .qa-edit-answer:visited {
    899950    color: #fff;
     
    920971*/
    921972
    922 .single-question .qa-flag .waiting{
     973.single-question .qa-flag .waiting {
    923974    display: none;
    924975}
     
    928979
    929980
    930 .qa-user-card-loader{
     981.qa-user-card-loader {
    931982    cursor: pointer;
    932983    position: relative;
     
    9581009}
    9591010
    960 .qa-user-card:after, .single-question .qa-user-card:before {
     1011.qa-user-card:after,
     1012.single-question .qa-user-card:before {
    9611013    bottom: 100%;
    9621014    left: 10%;
     
    9751027    margin-left: -12px;
    9761028}
     1029
    9771030.qa-user-card:before {
    9781031    border-color: rgba(221, 221, 221, 0);
     
    9901043    border-radius: 3px;
    9911044}
     1045
    9921046.qa-user-card .card-cover img {
    9931047    width: 100%;
    9941048    height: auto;
    9951049}
     1050
    9961051.qa-user-card .card-avatar {
    9971052    position: absolute;
     
    10051060    border-radius: 5px;
    10061061}
     1062
    10071063.qa-user-card .card-avatar img {
    10081064    /* border-radius: 50%; */
     
    10611117    font-weight: normal;
    10621118}
    1063 .qa-user-card .card-answer-count{
     1119
     1120.qa-user-card .card-answer-count {
    10641121    font-size: 12px;
    10651122    font-weight: normal;
    10661123}
    1067 .qa-user-card .card-follower-count{
     1124
     1125.qa-user-card .card-follower-count {
    10681126    font-size: 12px;
    10691127    font-weight: normal;
     
    10861144
    10871145
    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) {
    10981151
    10991152
     
    11031156
    11041157    .single-question .qa-answer-left {
    1105       display: inline-block;
    1106       float: none;
     1158        display: inline-block;
     1159        float: none;
    11071160    }
    11081161
    11091162    .single-question .qa-user-name {
    1110       display: inline-block;
    1111       margin-bottom: 10px;
     1163        display: inline-block;
     1164        margin-bottom: 10px;
    11121165    }
    11131166
    11141167
    11151168    .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;
    11221175    }
    11231176
    11241177    .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;
    11281181    }
    11291182
    11301183    .single-question .qa-answer-reply {
    1131       margin: 0;
     1184        margin: 0;
    11321185    }
    11331186
    11341187    .single-question .qa-reply-popup {
    1135       margin: 10px 0;
     1188        margin: 10px 0;
    11361189    }
    11371190
    11381191    .qa-reply-popup .qa-reply-form {
    1139       margin: 0;
     1192        margin: 0;
    11401193    }
    11411194
     
    11471200
    11481201}
    1149 
    1150    
    1151    
    1152    
  • question-answer/trunk/assets/front/js/question-submit.js

    r3126665 r3429727  
    55    var qaPassword = document.querySelector("input[name=qa_password]");
    66
     7    console.log(qaCreateAccount);
    78
    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    }
    2220
    2321    (function ($) {
     
    8684        });
    8785    })(jQuery);
     86
     87})
     88
     89
  • question-answer/trunk/includes/classes/class-emails.php

    r2933205 r3429727  
    3535        $email_body = wp_specialchars_decode($email_body, ENT_QUOTES);
    3636
     37        error_log($email_body);
    3738
    3839        $status = wp_mail($email_to, $subject, $email_body, $headers, $attachments);
  • question-answer/trunk/includes/functions.php

    r2933205 r3429727  
    140140    $response['html']   = "";
    141141    $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();
    143143
    144144    //var_dump($form_data_arr);
     
    808808
    809809
     810function 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
    810825
    811826
  • question-answer/trunk/includes/functions/functions-notification-email.php

    r2933205 r3429727  
    11<?php
    2 if ( ! defined('ABSPATH')) exit;  // if direct access
     2if (!defined('ABSPATH')) exit;  // if direct access
    33
    44
     
    77add_action('qa_action_answer_comment', 'qa_action_answer_comment_send_email', 99);
    88
    9 function qa_action_answer_comment_send_email($comment_ID){
     9function qa_action_answer_comment_send_email($comment_ID)
     10{
    1011
    1112    $admin_email = get_option('admin_email');
     
    2021    $comment_content = $comment_data->comment_content;
    2122    $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);
    2829
    2930        $question_url = get_permalink($qa_answer_question_id);
     
    4041        $enable = isset($qa_email_templates_data['answer_comment']['enable']) ? $qa_email_templates_data['answer_comment']['enable'] : 'no';
    4142
    42         if($enable == 'yes'):
     43        if ($enable == 'yes') :
    4344
    4445            $email_bcc = isset($qa_email_templates_data['answer_comment']['email_to']) ? $qa_email_templates_data['answer_comment']['email_to'] : '';
     
    4950
    5051            $vars = array(
    51                 '{site_name}'=> get_bloginfo('name'),
     52                '{site_name}' => get_bloginfo('name'),
    5253                '{site_description}' => get_bloginfo('description'),
    5354                '{site_url}' => get_bloginfo('url'),
     
    5556
    5657                '{user_name}' => $current_user->display_name,
    57                 '{user_avatar}' => get_avatar( $current_user->ID, 60 ),
     58                '{user_avatar}' => get_avatar($current_user->ID, 60),
    5859                '{user_email}' => '',
    5960
     
    6263                '{answer_title}'  => $answer_data->post_title,
    6364                '{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',
    6566                '{answer_id}'  => $answer_id,
    6667                '{answer_content}'  => $answer_data->post_content,
    6768
    6869                '{comment_content}'  => $comment_content,
    69                 '{comment_url}'  => $question_url.'#comment-'.$comment_ID,
     70                '{comment_url}'  => $question_url . '#comment-' . $comment_ID,
    7071            );
    7172
    7273            $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) {
    7576                    $subscriber_data = get_user_by('id', $subscriber);
    7677
    7778                    $email_data['email_to'] =  $subscriber_data->user_email;
    7879                    $email_data['email_bcc'] =  $email_bcc;
    79                     $email_data['email_from'] = $email_from ;
     80                    $email_data['email_from'] = $email_from;
    8081                    $email_data['email_from_name'] = $email_from_name;
    8182                    $email_data['subject'] = strtr($email_subject, $vars);
     
    8788        endif;
    8889    endif;
    89 
    90 
    9190}
    9291
    9392
    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 ){
     93add_action('qa_action_comment_flag', 'qa_email_action_comment_flag_function', 99);
     94
     95if (!function_exists('qa_email_action_comment_flag_function')) {
     96    function qa_email_action_comment_flag_function($comment_ID)
     97    {
    9898
    9999        $admin_email = get_option('admin_email');
     
    105105        $qa_from_email = get_option('qa_from_email', $admin_email);
    106106
    107         $comment = get_comment( $comment_ID );
     107        $comment = get_comment($comment_ID);
    108108        $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);
    111111
    112112        $question_url = get_permalink($question_ID);
     
    122122        $enable = isset($qa_email_templates_data['comment_flag']['enable']) ? $qa_email_templates_data['comment_flag']['enable'] : 'no';
    123123
    124         if ($enable == 'yes'):
     124        if ($enable == 'yes') :
    125125
    126126            $email_bcc = isset($qa_email_templates_data['comment_flag']['email_to']) ? $qa_email_templates_data['comment_flag']['email_to'] : '';
     
    142142                '{question_title}'  => $question_data->post_title,
    143143                '{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',
    145145                '{question_id}'  => $question_ID,
    146146                '{question_content}'  => $question_data->post_content,
     
    152152
    153153
    154             $email_data['email_to'] =$comment->comment_author_email;
     154            $email_data['email_to'] = $comment->comment_author_email;
    155155            $email_data['email_bcc'] = $email_bcc;
    156156            $email_data['email_from'] = $email_from;
     
    163163
    164164        endif;
    165 
    166 
    167165    }
    168166}
    169167
    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 ) {
     168add_action('qa_action_comment_unflag', 'qa_email_action_comment_unflag_function', 99);
     169
     170if (!function_exists('qa_email_action_comment_unflag_function')) {
     171    function qa_email_action_comment_unflag_function($comment_ID)
     172    {
    174173
    175174        $admin_email = get_option('admin_email');
     
    181180        $qa_from_email = get_option('qa_from_email', $admin_email);
    182181
    183         $comment = get_comment( $comment_ID );
     182        $comment = get_comment($comment_ID);
    184183        $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);
    187186
    188187        $question_url = get_permalink($question_ID);
     
    198197        $enable = isset($qa_email_templates_data['comment_unflag']['enable']) ? $qa_email_templates_data['comment_unflag']['enable'] : 'no';
    199198
    200         if ($enable == 'yes'):
     199        if ($enable == 'yes') :
    201200
    202201            $email_bcc = isset($qa_email_templates_data['comment_unflag']['email_to']) ? $qa_email_templates_data['comment_unflag']['email_to'] : '';
     
    218217                '{question_title}'  => $question_data->post_title,
    219218                '{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',
    221220                '{question_id}'  => $question_ID,
    222221                '{question_content}'  => $question_data->post_content,
     
    228227
    229228
    230             $email_data['email_to'] =$comment->comment_author_email;
     229            $email_data['email_to'] = $comment->comment_author_email;
    231230            $email_data['email_bcc'] = $email_bcc;
    232231            $email_data['email_from'] = $email_from;
     
    239238
    240239        endif;
    241 
    242 
    243240    }
    244241}
    245242
    246243
    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 ) {
     244add_action('publish_question', 'qa_email_action_question_published_function', 99);
     245
     246if (!function_exists('qa_email_action_question_published_function')) {
     247    function qa_email_action_question_published_function($question_ID)
     248    {
    251249
    252250        $admin_email = get_option('admin_email');
     
    258256        $qa_from_email = get_option('qa_from_email', $admin_email);
    259257
    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);
    263261        $question_title = get_the_title($qa_answer_question_id);
    264262        $answer_url = get_permalink($qa_answer_question_id);
    265         $answer_data = get_post( $question_ID );
     263        $answer_data = get_post($question_ID);
    266264
    267265
     
    275273        $enable = isset($qa_email_templates_data['new_question_published']['enable']) ? $qa_email_templates_data['new_question_published']['enable'] : 'no';
    276274
    277         if ($enable == 'yes'):
     275        if ($enable == 'yes') :
    278276
    279277            $email_bcc = isset($qa_email_templates_data['new_question_published']['email_to']) ? $qa_email_templates_data['new_question_published']['email_to'] : '';
     
    283281            $email_html = isset($qa_email_templates_data['new_question_published']['html']) ? $qa_email_templates_data['new_question_published']['html'] : '';
    284282
    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');
    286284
    287285
     
    298296                '{question_title}'  => $question_data->post_title,
    299297                '{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',
    301299                '{question_id}'  => $question_ID,
    302300                '{question_content}'  => $question_data->post_content,
     
    315313
    316314        endif;
    317 
    318315    }
    319316}
     
    321318
    322319
    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 ) {
     320add_action('qa_question_submitted', 'qa_question_submitted_send_email', 90, 2);
     321
     322if (!function_exists('qa_question_submitted_send_email')) {
     323    function qa_question_submitted_send_email($question_ID, $post_data)
     324    {
    327325
    328326        $admin_email = get_option('admin_email');
     
    334332        $qa_from_email = get_option('qa_from_email', $admin_email);
    335333
    336         $question_data = get_post( $question_ID );
     334        $question_data = get_post($question_ID);
    337335        $question_author = isset($question_data->post_author) ? $question_data->post_author : '';
    338336        $question_author_data = get_user_by('ID', $question_author);
     
    352350        $enable = isset($qa_email_templates_data['new_question_submitted']['enable']) ? $qa_email_templates_data['new_question_submitted']['enable'] : 'no';
    353351
    354         if ($enable == 'yes'):
     352        if ($enable == 'yes') :
    355353
    356354            $email_bcc = isset($qa_email_templates_data['new_question_submitted']['email_to']) ? $qa_email_templates_data['new_question_submitted']['email_to'] : '';
     
    360358            $email_html = isset($qa_email_templates_data['new_question_submitted']['html']) ? $qa_email_templates_data['new_question_submitted']['html'] : '';
    361359
    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
    366364
    367365
     
    378376                '{question_title}'  => $question_data->post_title,
    379377                '{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',
    381379                '{question_id}'  => $question_ID,
    382380                '{question_content}'  => $question_data->post_content,
     
    414412
    415413
    416             //var_dump($status);
     414        //var_dump($status);
    417415        endif;
    418 
    419 
    420416    }
    421417}
    422418
    423419
    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) {
     420add_action('qa_action_question_solved', 'qa_email_action_question_solved_function', 90);
     421
     422if (!function_exists('qa_email_action_question_solved_function')) {
     423    function qa_email_action_question_solved_function($question_ID)
     424    {
    428425
    429426        $admin_email = get_option('admin_email');
     
    435432        $qa_from_email = get_option('qa_from_email', $admin_email);
    436433
    437         $question_data = get_post( $question_ID );
     434        $question_data = get_post($question_ID);
    438435
    439436        global $current_user;
     
    446443        $enable = isset($qa_email_templates_data['question_solved']['enable']) ? $qa_email_templates_data['question_solved']['enable'] : 'no';
    447444
    448         if ($enable == 'yes'):
     445        if ($enable == 'yes') :
    449446
    450447            $email_bcc = isset($qa_email_templates_data['question_solved']['email_to']) ? $qa_email_templates_data['question_solved']['email_to'] : '';
     
    466463                '{question_title}'  => $question_data->post_title,
    467464                '{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',
    469466                '{question_id}'  => $question_ID,
    470467                '{question_content}'  => $question_data->post_content,
     
    474471            $q_subscriber = get_post_meta($question_ID, 'q_subscriber', true);
    475472
    476             if(is_array($q_subscriber))
    477                 foreach($q_subscriber as $subscriber){
     473            if (is_array($q_subscriber))
     474                foreach ($q_subscriber as $subscriber) {
    478475                    $subscriber_data = get_user_by('id', $subscriber);
    479476
     
    493490
    494491        endif;
    495 
    496492    }
    497493}
    498494
    499495
    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 ) {
     496add_action('qa_action_question_not_solved', 'qa_email_action_question_unsolved_function', 99);
     497
     498if (!function_exists('qa_email_action_question_unsolved_function')) {
     499    function qa_email_action_question_unsolved_function($question_ID)
     500    {
    504501
    505502        $admin_email = get_option('admin_email');
     
    511508        $qa_from_email = get_option('qa_from_email', $admin_email);
    512509
    513         $question_data = get_post( $question_ID );
     510        $question_data = get_post($question_ID);
    514511
    515512        global $current_user;
     
    522519        $enable = isset($qa_email_templates_data['question_unsolved']['enable']) ? $qa_email_templates_data['question_unsolved']['enable'] : 'no';
    523520
    524         if ($enable == 'yes'):
     521        if ($enable == 'yes') :
    525522
    526523            $email_bcc = isset($qa_email_templates_data['question_unsolved']['email_to']) ? $qa_email_templates_data['question_unsolved']['email_to'] : '';
     
    542539                '{question_title}'  => $question_data->post_title,
    543540                '{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',
    545542                '{question_id}'  => $question_ID,
    546543                '{question_content}'  => $question_data->post_content,
     
    550547            $q_subscriber = get_post_meta($question_ID, 'q_subscriber', true);
    551548
    552             if(is_array($q_subscriber))
    553                 foreach($q_subscriber as $subscriber){
     549            if (is_array($q_subscriber))
     550                foreach ($q_subscriber as $subscriber) {
    554551                    $subscriber_data = get_user_by('id', $subscriber);
    555552
     
    566563
    567564        endif;
    568 
    569565    }
    570566}
     
    575571//add_action('publish_answer', 'qa_email_action_answer_published_function', 99 );
    576572
    577 if ( ! function_exists( 'qa_email_action_answer_published_function' ) ) {
    578     function qa_email_action_answer_published_function( $answer_id ){
     573if (!function_exists('qa_email_action_answer_published_function')) {
     574    function qa_email_action_answer_published_function($answer_id)
     575    {
    579576
    580577        $admin_email = get_option('admin_email');
     
    588585
    589586
    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);
    591588        $question_title = get_the_title($question_id);
    592589        $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);
    596593        $question_author = isset($question_data->post_author) ? $question_data->post_author : '';
    597594
    598  
     595
    599596        $question_url = get_permalink($question_id);
    600597        $answer_url = get_permalink($question_id);
     
    610607        $enable = isset($qa_email_templates_data['new_answer_published']['enable']) ? $qa_email_templates_data['new_answer_published']['enable'] : 'no';
    611608
    612         if ($enable == 'yes'):
     609        if ($enable == 'yes') :
    613610
    614611            $email_bcc = isset($qa_email_templates_data['new_answer_published']['email_to']) ? $qa_email_templates_data['new_answer_published']['email_to'] : '';
     
    632629
    633630                '{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',
    636633                '{answer_id}'  => $answer_id,
    637634                '{answer_content}'  => $answer_data->post_content,
    638635            );
    639636
    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);
    643640
    644641
     
    652649
    653650                $status = $class_qa_emails->qa_send_email($email_data);
    654 
    655651            }
    656652
     
    678674
    679675        endif;
    680 
    681 
    682676    }
    683677}
     
    686680
    687681
    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 ) {
     682add_action('qa_answer_submitted', 'qa_answer_submitted_email', 99, 2);
     683
     684if (!function_exists('qa_answer_submitted_email')) {
     685    function qa_answer_submitted_email($answer_id, $form_data_arr)
     686    {
    692687
    693688        $admin_email = get_option('admin_email');
     
    701696
    702697
    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);
    706701        $question_author = isset($question_data->post_author) ? $question_data->post_author : '';
    707702
     
    709704        $question_title = get_the_title($question_id);
    710705        $answer_url = get_permalink($question_id);
    711         $answer_data = get_post( $answer_id );
    712 
    713    
     706        $answer_data = get_post($answer_id);
     707
     708
    714709        $question_url = get_permalink($question_id);
    715710        $answer_url = get_permalink($question_id);
     
    725720        $enable = isset($qa_email_templates_data['new_answer_submitted']['enable']) ? $qa_email_templates_data['new_answer_submitted']['enable'] : 'no';
    726721
    727         if ($enable == 'yes'):
     722        if ($enable == 'yes') :
    728723
    729724            $email_bcc = isset($qa_email_templates_data['new_answer_submitted']['email_to']) ? $qa_email_templates_data['new_answer_submitted']['email_to'] : '';
     
    747742
    748743                '{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',
    751746                '{answer_id}'  => $answer_id,
    752747                '{answer_content}'  => $answer_data->post_content,
     
    763758            $status = $class_qa_emails->qa_send_email($email_data);
    764759
    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);
    768763
    769764
     
    777772
    778773                $status = $class_qa_emails->qa_send_email($email_data);
    779 
    780774            }
    781775
     
    799793
    800794        endif;
    801 
    802795    }
    803796}
     
    808801
    809802
    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 ) {
     803add_action('qa_action_answer_vote_down', 'qa_email_action_answer_votedown_function', 99);
     804
     805if (!function_exists('qa_email_action_answer_votedown_function')) {
     806    function qa_email_action_answer_votedown_function($post_id)
     807    {
    814808
    815809        $admin_email = get_option('admin_email');
     
    821815        $qa_from_email = get_option('qa_from_email', $admin_email);
    822816
    823         $post_data = get_post( $post_id );
     817        $post_data = get_post($post_id);
    824818        $post_type = isset($post_data->post_type) ? $post_data->post_type : '';
    825819
     
    827821
    828822
    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);
    834828            $question_title = get_the_title($question_id);
    835829            $question_url = get_permalink($question_id);
    836830
    837             $answer_data    = get_post( $post_id );
     831            $answer_data     = get_post($post_id);
    838832            $answer_url = get_permalink($post_id);
    839833            $answer_url = get_permalink($post_id);
     
    849843            $enable = isset($qa_email_templates_data['answer_votedown']['enable']) ? $qa_email_templates_data['answer_votedown']['enable'] : 'no';
    850844
    851             if ($enable == 'yes'):
     845            if ($enable == 'yes') :
    852846
    853847                $email_bcc = isset($qa_email_templates_data['answer_votedown']['email_to']) ? $qa_email_templates_data['answer_votedown']['email_to'] : '';
     
    869863                    '{question_title}'  => $question_data->post_title,
    870864                    '{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',
    872866                    '{question_id}'  => $question_id,
    873867                    '{question_content}'  => $question_data->post_content,
    874868
    875869                    '{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',
    878872                    '{answer_id}'  => $post_id,
    879873                    '{answer_content}'  => $answer_data->post_content,
     
    895889
    896890            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
    962953
    963954
    964955            endif;
    965956
     957
     958        endif;
    966959    }
    967960}
     
    971964
    972965
    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 ) {
     966add_action('qa_action_answer_vote_up', 'qa_action_answer_vote_up_email', 99);
     967
     968if (!function_exists('qa_action_answer_vote_up_email')) {
     969    function qa_action_answer_vote_up_email($post_id)
     970    {
    977971
    978972        $admin_email = get_option('admin_email');
     
    984978        $qa_from_email = get_option('qa_from_email', $admin_email);
    985979
    986         $post_data = get_post( $post_id );
     980        $post_data = get_post($post_id);
    987981        $post_type = isset($post_data->post_type) ? $post_data->post_type : '';
    988982
     
    990984
    991985
    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);
    997991            $question_title = get_the_title($question_id);
    998992            $question_url = get_permalink($question_id);
    999993
    1000             $answer_data    = get_post( $post_id );
     994            $answer_data     = get_post($post_id);
    1001995            $answer_url = get_permalink($post_id);
    1002996            $answer_url = get_permalink($post_id);
     
    10121006            $enable = isset($qa_email_templates_data['answer_voteup']['enable']) ? $qa_email_templates_data['answer_voteup']['enable'] : 'no';
    10131007
    1014             if ($enable == 'yes'):
     1008            if ($enable == 'yes') :
    10151009
    10161010                $email_bcc = isset($qa_email_templates_data['answer_voteup']['email_to']) ? $qa_email_templates_data['answer_voteup']['email_to'] : '';
     
    10321026                    '{question_title}'  => $question_data->post_title,
    10331027                    '{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',
    10351029                    '{question_id}'  => $question_id,
    10361030                    '{question_content}'  => $question_data->post_content,
    10371031
    10381032                    '{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',
    10411035                    '{answer_id}'  => $post_id,
    10421036                    '{answer_content}'  => $answer_data->post_content,
     
    10581052
    10591053            endif;
    1060         elseif ($post_type == 'question'):
     1054        elseif ($post_type == 'question') :
    10611055
    10621056            $question_id = $post_id;
     
    10641058
    10651059
    1066             $question_data  = get_post( $question_id );
     1060            $question_data     = get_post($question_id);
    10671061            $question_title = get_the_title($question_id);
    10681062            $question_url = get_permalink($question_id);
     
    10771071
    10781072
    1079             if ($enable == 'yes'):
     1073            if ($enable == 'yes') :
    10801074
    10811075                $email_bcc = isset($qa_email_templates_data['question_voteup']['email_to']) ? $qa_email_templates_data['question_voteup']['email_to'] : '';
     
    10971091                    '{question_title}'  => $question_data->post_title,
    10981092                    '{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',
    11001094                    '{question_id}'  => $question_id,
    11011095                    '{question_content}'  => $question_data->post_content,
     
    11261120
    11271121        endif;
    1128 
    11291122    }
    11301123}
     
    11321125
    11331126
    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 ) {
     1127add_action('question_answer_assign_to_mail', 'question_answer_assign_to_mail', 99, 2);
     1128
     1129if (!function_exists('question_answer_assign_to_mail')) {
     1130    function question_answer_assign_to_mail($user_id, $post_id)
     1131    {
    11381132
    11391133        $admin_email = get_option('admin_email');
     
    11451139        $qa_from_email = get_option('qa_from_email', $admin_email);
    11461140
    1147         $post_data = get_post( $post_id );
     1141        $post_data = get_post($post_id);
    11481142        $post_type = isset($post_data->post_type) ? $post_data->post_type : '';
    11491143
    11501144        global $current_user;
    11511145
    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);
    11551149        $question_title = get_the_title($question_id);
    11561150        $question_url = get_permalink($question_id);
     
    11651159        $enable = isset($qa_email_templates_data['assign_to']['enable']) ? $qa_email_templates_data['assign_to']['enable'] : 'no';
    11661160
    1167         if ($enable == 'yes'):
     1161        if ($enable == 'yes') :
    11681162
    11691163            $email_bcc = isset($qa_email_templates_data['assign_to']['email_to']) ? $qa_email_templates_data['assign_to']['email_to'] : '';
     
    11851179                '{question_title}'  => $question_data->post_title,
    11861180                '{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',
    11881182                '{question_id}'  => $question_id,
    11891183                '{question_content}'  => $question_data->post_content,
     
    12011195            $email_data['attachments'] = array();
    12021196
     1197
     1198
    12031199            $status = $class_qa_emails->qa_send_email($email_data);
    12041200
    12051201        endif;
    1206 
    1207 
    12081202    }
    12091203}
    1210 
    1211 
    1212 
  • question-answer/trunk/question-answer.php

    r2933205 r3429727  
    107107
    108108
     109
    109110        add_role(
    110111            'qa_manager',
     
    113114                'read' => true,
    114115                'create_question' => true,
    115                 'create_others_question' => true,
    116 
     116                'create_reply' => true,
    117117                'delete_question' => true,
    118118                'upload_files' => true,
     
    152152        require_once(QA_PLUGIN_DIR . 'includes/classes/class-widget-website-stats.php');
    153153        require_once(QA_PLUGIN_DIR . 'includes/classes/class-widget-latest-questions.php');
     154        require_once(QA_PLUGIN_DIR . 'includes/classes/class-question-category.php');
    154155
    155156
  • question-answer/trunk/readme.txt

    r3126665 r3429727  
    44    Tags:  Question Answer, Question, Answer
    55    Requires at least: 4.1
    6     Tested up to: 6.6
     6    Tested up to: 6.2
    77    Stable tag: 1.2.70
    88    License: GPLv2 or later
  • question-answer/trunk/templates/add-question/add-question-hook.php

    r2933205 r3429727  
    604604
    605605
     606
     607
    606608    wp_set_post_terms($question_ID, $question_tags, 'question_tags', true);
    607609    wp_set_post_terms($question_ID, $question_cat, 'question_cat');
     
    611613    update_post_meta($question_ID, 'qa_visiblity', $qa_visiblity);
    612614
     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
    613630
    614631
     
    635652        <?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)); ?>
    636653    </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>
    637669<?php
    638670
  • question-answer/trunk/templates/add-question/add-question-new.php

    r2720988 r3429727  
    22
    33
    4 if ( ! defined('ABSPATH')) exit;  // if direct access
     4if (!defined('ABSPATH')) exit;  // if direct access
    55
    66
     
    99
    1010
    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']);
    2222
    2323
     
    2929
    3030    <?php
    31     if(!empty($_POST)){
     31    if (!empty($_POST)) {
    3232        do_action('qa_question_submit_data', $_POST);
    3333    }
     
    3636    <?php do_action('question_answer_submit_question_before'); ?>
    3737
    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'])); ?>">
    3939        <?php
    40         do_action('question_answer_submit_question');
    41         ?>
     40        do_action('question_answer_submit_question');
     41        ?>
    4242    </form>
    4343
    4444    <?php do_action('question_answer_submit_question_after'); ?>
    45        
     45
    4646</div>
    4747
    4848<?php
    49 
    50 
  • question-answer/trunk/templates/single-question/single-question-hook.php

    r2933205 r3429727  
    5757?>
    5858        <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
    57460        </div>
    57561
     
    1051537        <div class="subscribers">
    1052538
    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>
    1079541                <?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                        }
    1093556                    }
    1094557                ?>
    1095558
    1096559            </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
    1098590    }
    1099591}
Note: See TracChangeset for help on using the changeset viewer.