dongmiyi8220 2018-05-06 06:27
浏览 42

加载更多不起作用,但使用原始代码

So I just made this page but now the load more isn't working but works with the original code I think it has something to do with the <div class="confession confHide"> code because if I remove it in the original code it brakes the load more but everytime I add it to the new code it doesn't display anything but makes anything on that page invisible but still displays the header.

NEW CODE:

<div class="confession confHide">

                                    </div>

        <div class="container">
            <div class="row">
                <div class="col-sm-4 col-md-4">
                    <div class="post" style="margin: 5px">
                        <div class="content">
                            <div class="author">
                                <b><?php if ($row['firstName'] != '') { ?>
                                    <span class="label label-confess">By <?php echo clean($row['firstName']); ?></span>
                            <?php } else { ?>
                                    <span class="label label-confess"><?php echo $postedByAnon; ?></span>
                            <?php } ?></span></b>
                                    <span class="label label-confess last"><time datetime="2014-01-20"><?php echo timeago($row['postDate']); ?></time></span>
                            </div>
    <div>       
    <p>
    <a href="/page.php?page=view&confession=<?php echo $row['confessId']; ?>" title="View Confession #<?php echo $row['confessId'] ?>">
    <?php
        if ($filterProfanity == '1') {
        echo nl2br(substr(filterwords($row['confessText'], 0, 70) .((strlen($row['confessText']) > 70) ? '...' : '')));
        } else {
        echo nl2br(substr($row['confessText'], 0, 70) .((strlen($row['confessText']) > 70) ? ' ...' : ''));
        }
    ?>
    </p>
    </a>
    </div>

    <div class="author">
        <b>
         <input type="hidden" id="confessId" name="confessId_<?php echo $count; ?>" value="<?php echo $row['confessId']; ?>" />
          <span class="label label-confess"><?php echo $row['totalViews'] . ' ' . $viewText; ?></span>
          <span class="likes">
    <span class="label label-confess first liked">
                 <a href="" id="likeIt<?php echo $row['confessId']; ?>" class="likeIt_<?php echo $count; ?> text-success">
                    <i class="fa fa-smile-o"></i> <span id="likesVal_<?php echo $count; ?>"><?php echo $row['totalLikes']; ?></span>
                  </a>
    </span>
    </span>
     <span class="dislikes">
    <span class="label label-confess">
         <a href="" id="dislikeIt<?php echo $row['confessId']; ?>" class="dislike_<?php echo $count; ?> text-danger">
            <span id="dislikesVal_<?php echo $count; ?>"><?php echo $row['totalDislikes']; ?></span> <i class="fa fa-frown-o"></i>
         </a>
    </span>
    </span>

    <span class="label label-confess last hasVoted text-danger"><strong><?php echo $onlyVoteOnceText; ?></strong></span>
    <?php if ($row['hasImage'] != '0') { ?>
        <span class="label label-confess"><i class="fa fa-picture-o img"></i></span>
    <?php } ?>
        <span class="label label-confess last" title="<?php echo $totComments.' '.$comText; ?>">
                <?php echo $totComments.' '.$comText; ?>
        </span>
    </b>
          </div>
    <div>
        <center>
            <a href="/page.php?page=view&confession=<?php echo $row['confessId']; ?>" title="View Confession #<?php echo $row['confessId'] ?>" class="btn btn-warning btn-sm">Read More</a>
        </center>
    <br />
                                        </div>
                                    </div>
                                </div>
                            <div class="clearfix"></div>
                        </div>
                        <?php
                            $count++;
                            }
                        ?>
                    </div>
                    <a href="" class="btn btn-fessup btn-block" id="loadMore"><?php echo $loadMoreText; ?></a>
                    <?php
                        if(mysqli_num_rows($adres) > 0) {
                            while ($ad = mysqli_fetch_assoc($adres)) {
                    ?>
                                <div class="adText">
                                    <h3><a href="<?php echo clean($ad['adUrl']); ?>"><?php echo clean($ad['adTitle']); ?> <i class="fa fa-external-link pull-right"></i></a></h3>
                                    <p><a href="<?php echo clean($ad['adUrl']); ?>"><?php echo nl2br(clean($ad['adText'])); ?></a></p>
                                    <span class="label label-default"><?php echo $advertisementText; ?></span>
                                    <div class="clearfix"></div>
                                </div>
                    <?php
                            }
                        }
                    ?>

                </div>
            </div>
    <?php
            include('includes/footer.php');
        }
    ?>

OLD CODE:

<div class="confession confHide">
                                    <p>
                                        <i class="fa fa-quote-left"></i>
                                        <?php
                                            if ($filterProfanity == '1') {
                                                echo nl2br(htmlspecialchars(filterwords($row['confessText'])));
                                            } else {
                                                echo nl2br(htmlspecialchars($row['confessText']));
                                            }
                                        ?>
                                        <i class="fa fa-quote-right"></i>
                                    </p>
                                    <input type="hidden" id="confessId" name="confessId_<?php echo $count; ?>" value="<?php echo $row['confessId']; ?>" />
                                    <div class="confession-footer">
                                        <div class="likes">
                                            <span class="label label-confess first liked">
                                                <a href="" id="likeIt<?php echo $row['confessId']; ?>" class="likeIt_<?php echo $count; ?> text-success">
                                                    <i class="fa fa-smile-o"></i> <span id="likesVal_<?php echo $count; ?>"><?php echo $row['totalLikes']; ?></span>
                                                </a>
                                            </span>
                                        </div>
                                        <div class="dislikes">
                                            <span class="label label-confess disliked">
                                                <a href="" id="dislikeIt<?php echo $row['confessId']; ?>" class="dislike_<?php echo $count; ?> text-danger">
                                                    <span id="dislikesVal_<?php echo $count; ?>"><?php echo $row['totalDislikes']; ?></span> <i class="fa fa-frown-o"></i>
                                                </a>
                                            </span>
                                        </div>
                                        <span class="label label-confess"><?php echo timeago($row['postDate']); ?></span>
                                        <?php if ($row['hasImage'] != '0') { ?>
                                            <span class="label label-confess"><i class="fa fa-picture-o img"></i></span>
                                        <?php } ?>
                                        <span class="label label-confess last"><?php echo $row['totalViews'].' '.$viewText; ?></span>
                                        <span class="label label-confess last hasVoted text-danger"><strong><?php echo $onlyVoteOnceText; ?></strong></span>
                                        <div class="comments">
                                            <a href="https://twitter.com/intent/tweet?text=<?php echo $set['siteName']; ?>%20Confession:%20<?php echo ellipsis($row['confessText'],65); ?>%20&url=<?php echo $shareURL; ?>" class="btn btn-tw btn-sm" target="_blank" data-toggle="tooltip" data-placement="top" title="<?php echo $twitterShareTooltip; ?>">
                                                <i class="fa fa-twitter"></i>
                                            </a>
                                            <a href="https://plus.google.com/share?url=<?php echo $pageURL; ?>" class="btn btn-gp btn-sm" target="_blank" data-toggle="tooltip" data-placement="top" title="<?php echo $googleShareTooltip; ?>">
                                                <i class="fa fa-google-plus"></i>
                                            </a>
                                            <a href="page.php?page=view&confession=<?php echo $row['confessId']; ?>" class="btn btn-comment btn-sm btn-icon">
                                                <i class="fa fa-comments"></i> <?php echo $totComments.' '.$comText; ?>
                                            </a>
                                        </div>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                        <?php
                            $count++;
                            }
                        ?>
                    </div>
                    <a href="#" class="btn btn-fessup btn-block" id="loadMore"><?php echo $loadMoreText; ?></a>
                    <?php
                        if(mysqli_num_rows($adres) > 0) {
                            while ($ad = mysqli_fetch_assoc($adres)) {
                    ?>
                                <div class="adText">
                                    <h3><a href="<?php echo clean($ad['adUrl']); ?>"><?php echo clean($ad['adTitle']); ?> <i class="fa fa-external-link pull-right"></i></a></h3>
                                    <p><a href="<?php echo clean($ad['adUrl']); ?>"><?php echo nl2br(clean($ad['adText'])); ?></a></p>
                                    <span class="label label-default"><?php echo $advertisementText; ?></span>
                                    <div class="clearfix"></div>
                                </div>
                    <?php
                            }
                        }
                    ?>

                </div>
            </div>
    <?php
            include('includes/footer.php');
        }
    ?>

Any help would be nice but I don't know if I explain that right but can anybody help me out? That would be nice thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog
    • ¥15 Excel发现不可读取的内容