当前位置: 首页>>代码示例>>PHP>>正文


PHP comment::get_e_comment方法代码示例

本文整理汇总了PHP中comment::get_e_comment方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::get_e_comment方法的具体用法?PHP comment::get_e_comment怎么用?PHP comment::get_e_comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comment的用法示例。


在下文中一共展示了comment::get_e_comment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

        case "poll":
            echo "<script type='text/javascript'>document.location.href='" . e_HTTP . "comment.php?comment.{$table}.{$redirectFlag}'</script>\n";
            exit;
        case "download":
            echo "<script type='text/javascript'>document.location.href='" . e_HTTP . "download.php?view.{$redirectFlag}'</script>\n";
            exit;
        case "page":
            echo "<script type='text/javascript'>document.location.href='" . e_HTTP . "page.php?{$redirectFlag}'</script>\n";
            exit;
        case 'user':
            echo "<script type='text/javascript'>document.location.href='" . e107::getUrl()->create('user/profile/view', 'id=' . $redirectFlag) . "'</script>\n";
            exit;
    }
    // Check plugin e_comment.php files
    $plugin_redir = false;
    $e_comment = $cobj->get_e_comment();
    if ($table == $e_comment[$table]['eplug_comment_ids']) {
        $plugin_redir = TRUE;
        $reply_location = str_replace('{NID}', $redirectFlag, $e_comment[$table]['reply_location']);
    }
    if ($plugin_redir) {
        echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
        exit;
    }
    // No redirect found if we get here.
}
$comment_ob_start = FALSE;
if ($action == "reply") {
    if (!$pref['nested_comments']) {
        header('Location: ' . e_BASE . 'comment.php?comment.{$table}.{$nid}');
        exit;
开发者ID:gitter-badger,项目名称:e107,代码行数:31,代码来源:comment.php

示例2: verify_sql_record


//.........这里部分代码省略.........
                    //else if the rate_table is not an existing table, this is an invalid reference
                    //FIXME Steve: table is never found without MPREFIX; Multi-language tables?
                    if (in_array(MPREFIX . $ctable, $dbtables)) {
                        $sql3->db_Select_gen("SHOW COLUMNS FROM " . MPREFIX . $ctable);
                        while ($row3 = $sql3->db_Fetch()) {
                            //find the auto_increment field, since that's the most likely key used
                            if ($row3['Extra'] == 'auto_increment') {
                                $aif = $row3['Field'];
                                break;
                            }
                        }
                        //we need to check if the itemid (still) exists in this table
                        //if the record is not found, this could well be an obsolete record
                        //if the record is found, we need to keep this record since it's a valid reference
                        if (!$sql2->db_Select("{$ctable}", "*", "{$aif}='{$citemid}' ORDER BY {$aif} ")) {
                            $err[] = array('type' => $ctable, 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                        }
                    } else {
                        $err[] = array('type' => $ctable, 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => FALSE);
                    }
                }
                $text .= verify_sql_record_displayresult($err ? $err : DBLAN_54, $ctype);
            }
        }
        //validate comments table records
        if (isset($_POST['table_comments'])) {
            $query = "\n\t\t\tSELECT c.*\n\t\t\tFROM #comments AS c\n\t\t\tWHERE c.comment_id!=''\n\t\t\tORDER BY c.comment_type, c.comment_item_id";
            $data = array('type' => 'comments', 'table' => 'comment_type', 'itemid' => 'comment_item_id', 'id' => 'comment_id');
            if (!$sql->db_Select_gen($query)) {
                $text .= verify_sql_record_displayresult(DBLAN_49, $data['type']);
            } else {
                //the master error array
                $err = array();
                //array which will hold all db tables
                $dbtables = verify_sql_record_gettables();
                //get all e_comment files and variables
                require_once e_HANDLER . "comment_class.php";
                $cobj = new comment();
                $e_comment = $cobj->get_e_comment();
                while ($row = $sql->db_Fetch()) {
                    $ctype = $data['type'];
                    $cid = $row[$data['id']];
                    $citemid = $row[$data['itemid']];
                    $ctable = $row[$data['table']];
                    //for each comment we need to validate the referencing record exists
                    //we need to check if the itemid (still) exists in this table
                    //if the record is not found, this could well be an obsolete record
                    //if the record is found, we need to keep this record since it's a valid reference
                    // news
                    if ($ctable == "0") {
                        if (!$sql2->db_Select("news", "*", "news_id='{$citemid}' ")) {
                            $err[] = array('type' => 'news', 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                        }
                        //	article, review or content page
                    } elseif ($ctable == "1") {
                        //	downloads
                    } elseif ($ctable == "2") {
                        if (!$sql2->db_Select("download", "*", "download_id='{$citemid}' ")) {
                            $err[] = array('type' => 'download', 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                        }
                        //	poll
                    } elseif ($ctable == "4") {
                        if (!$sql2->db_Select("polls", "*", "poll_id='{$citemid}' ")) {
                            $err[] = array('type' => 'polls', 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                        }
                        //	userprofile
                    } elseif ($ctable == "profile") {
                        if (!$sql2->db_Select("user", "*", "user_id='{$citemid}' ")) {
                            $err[] = array('type' => 'user', 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                        }
                        //else if this is a plugin comment
                    } elseif (isset($e_comment[$ctable]) && is_array($e_comment[$ctable])) {
                        $var = $e_comment[$ctable];
                        $qryp = '';
                        //new method must use the 'qry' variable
                        if (isset($var) && $var['qry'] != '') {
                            if ($installed = $sql2->db_Select("plugin", "*", "plugin_path = '" . $var['plugin_path'] . "' AND plugin_installflag = '1' ")) {
                                $qryp = str_replace("{NID}", $citemid, $var['qry']);
                                if (!$sql2->db_Select_gen($qryp)) {
                                    $err[] = array('type' => $ctable, 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                                }
                            }
                            //old method
                        } else {
                            if (!$sql2->db_Select($var['db_table'], $var['db_title'], $var['db_id'] . " = '{$citemid}' ")) {
                                $err[] = array('type' => $ctable, 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => TRUE);
                            }
                        }
                        //in all other cases
                    } else {
                        $err[] = array('type' => $ctable, 'sqlid' => $cid, 'table' => $ctable, 'itemid' => $citemid, 'table_exist' => FALSE);
                    }
                }
                $text .= verify_sql_record_displayresult($err ? $err : DBLAN_54, $ctype);
            }
        }
        $text .= "\n\t\t\t\t<div class='buttons-bar center'>\n\t\t\t\t\t" . $frm->admin_button('delete_verify_sql_record', LAN_DELCHECKED, 'delete') . "\n\t\t\t\t\t" . $frm->admin_button('verify_sql_record', LAN_BACK, 'back') . "\n\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t";
        $e107->ns->tablerender(DBLAN_10 . ' - ' . DBLAN_50, $emessage->render() . $text);
    }
}
开发者ID:notzen,项目名称:e107,代码行数:101,代码来源:db.php


注:本文中的comment::get_e_comment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。