一些数据库致命错误

时间:2014-07-17 06:25:59

标签: php mysql database smarty

我想用XAMPP安装php代码。我创建了新的数据库并将其命名为s13。之后,我将所有代码粘贴到文件夹s13。

这是我实际收到的错误

Fatal error: Call to a member function __() on a non-object in C:\xampp\htdocs\s13\content\themes\default\templates_c\90f81337a2395d597b1b2483c3c3bf40f723241a.file.header.tpl.php on line 199

我的配置php代码

<?php 

define('DB_NAME', 's13')
;

define('DB_USER', 'root');

define('DB_PASSWORD', '');

define('DB_HOST', 'localhost');

define('DEBUGGING', true);

?>

这就是我实际收到的错误代码

<body page="{$page}" ub="{$userArray.Blocked}">

    <!-- Common JS -->
    <script>var SITE_URL = '{$SITE_URL}/';</script>
    <script type="text/javascript" src="{$SITE_URL}/js/core.common.js"></script>
    <!-- Common JS -->

    {if $userExist}

        <!-- Common [User Exist] JS -->
        <script type="text/javascript" src="{$SITE_URL}/js/core.common.signedin.js"></script>
        <script type="text/javascript" src="{$SITE_URL}/js/core.chat.js"></script>
        <!-- Common [User Exist] JS -->

        {if $userArray.Verified == "N"}
            <!-- Verify Bar -->
            <div class="verifyBarHolder">
                <div class="verifyBar">
                    <div class="verifyBarContent">
                        <div class="right">
                            <span class="uiButtonText black resendEmail">{$translate->__("Resend Confirmation Email")}</span> · <span class="uiButtonText black changeEmail">{$translate->__("Change Email Address")}</span>
                        </div>
                        {$userArray.UserFirstName}, {$translate->__("go to")} <strong>{$userArray.UserEmail}</strong> {$translate->__("to complete the sign-up process")}.
                    </div>
                </div>
            </div>
            <!-- Verify Bar -->
        {/if}

        <!-- Header -->
        <div class="headerBarHolder">
            <div class="headerBar {if $userArray.Verified == "N"}afterVerify{/if}">
                <div class="header">

                    <!-- Logo -->
                    <div class="logo"><a href="{$SITE_URL}/home.php"><span>{$translate->__("Home")}</span></a></div>
                    <!-- Logo -->

                    <!-- Search -->
                    <div class="search">
                        <form id="searchForm" class="relative" action="{$SITE_URL}/search.php" method="get">
                            <span class="glass"><i></i></span>
                            <input class="uiInput searchInput" type="text" name="q" value="{$translate->__("Search")}" />
                        </form>
                    </div>
                    <!-- Search -->

                    <!-- Navigation -->
                    <div class="navigation">
                        <ul class="list">

                            <li class="item" title="{$translate->__("Home")}">
                                <a class="navApp homeIcon" href="{$SITE_URL}/home.php"></a>
                            </li>

                            <li class="item">
                                <div class="icon relative">
                                    <div class="navApp profileIcon" id="profileIcon"></div>
                                    <!-- Profile Menu -->
                                    <div class="subMenu toRight navigationMenu">
                                        <ul>
                                            <li><a class="menuItem" href="{$SITE_URL}/{$userArray.UserName}">{$translate->__("Profile")}</a></li>
                                            <li><a class="menuItem" href="{$SITE_URL}/settings/">{$translate->__("Settings")}</a></li>
                                        </ul>
                                    </div>
                                    <!-- Profile Menu -->
                                </div>
                            </li>

                            <li class="item">
                                <div class="icon relative">
                                    <div class="navApp messagesIcon" id="messagesIcon"><span class="counter hidden" id="msgCounter"></span></div>
                                    <!-- Messages Menu -->
                                    <div class="subMenu toRight navigationMenu">
                                        <ul class="navMenu" id="liveMessages">
                                            <li>
                                                <div class="navMenuTitle">
                                                    <div class="right">
                                                        <a href="{$SITE_URL}/messages/">{$translate->__("See All")}</a>
                                                    </div>
                                                    <strong>{$translate->__("Messages")}</strong>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- Messages Menu -->
                                </div>
                            </li>

                            <li class="item">
                                <div class="icon relative">
                                    <div class="navApp notificationsIcon" id="notificationsIcon"><span class="counter hidden" id="notifiCounter"></span></div>
                                    <!-- Notifications Menu -->
                                    <div class="subMenu toRight navigationMenu">
                                        <ul class="navMenu" id="liveNotifications">
                                            <li>
                                                <div class="navMenuTitle">
                                                    <div class="right">
                                                        <a href="{$SITE_URL}/notifications/">{$translate->__("See All")}</a>
                                                    </div>
                                                    <strong>{$translate->__("Notifications")}</strong>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- Notifications Menu -->
                                </div>
                            </li>

                        </ul>
                    </div>
                    <!-- Navigation -->

                    <!-- Sign Out -->
                    <div class="signOut">
                        <a class="navApp signoutIcon right" href="{$SITE_URL}/signout/" title="{$translate->__("Log Out")}"></a>
                    </div>
                    <!-- Sign Out -->

                </div>
            </div>
        </div>
        <!-- Header -->

    {else}

        <!-- Common [User Non-Exist] JS -->
        <script type="text/javascript" src="{$SITE_URL}/js/core.common.unsignedin.js"></script>
        <!-- Common [User Non-Exist] JS -->

        <!-- Header -->
        <div class="headerBarHolder userNonExist">
            <div class="headerBar userNonExist">
                <div class="header">

                    <!-- Logo -->
                    <div class="logo userNonExist"><a href="{$SITE_URL}"><span>{$translate->__("Home")}</span></a></div>
                    <!-- Logo -->

                    <!-- Search -->
                    <div class="search userNonExist">
                        <form id="searchForm" class="relative" action="{$SITE_URL}/search.php" method="get">
                            <span class="glass"><i></i></span>
                            <input class="uiInput searchInput" type="text" name="q" value="{$translate->__("Search")}" />
                        </form>
                    </div>
                    <!-- Search -->

                    {if $page != "signin"}
                        <!-- Sign In -->
                        <div class="signIn">
                            <div class="relative">
                                <span>{$translate->__("Have an account?")}<a class="signInBox ml5" href="{$SITE_URL}/signin/"><span>{$translate->__("Sign in")}</span></a></span>
                                <div id="signInMenu" class="signInMenu">
                                    <form action="{$SITE_URL}/signin/" method="post">
                                        <div class="inline mb10 pt10 pb10" style="width: 210px; border-bottom: 1px solid #333333;">
                                            <div class="left pt5 mr10">
                                                <span>{$translate->__("Sign in with")}</span>
                                            </div>
                                            <div class="left">
                                                <a class="connect-facebook-vsmall" title="{$translate->__("Sign in with")} Facebook" href="{$SITE_URL}/connect/facebook/"></a> <a class="connect-twitter-vsmall" title="{$translate->__("Sign in with")} Twitter" href="{$SITE_URL}/connect/twitter/"></a>
                                            </div>
                                        </div>
                                        <p class="mb10">
                                            <label class="inputLabel" for="username_email">{$translate->__("Username or email")}:</label>
                                            <input type="text" name="username_email" tabindex="1" />
                                        </p>
                                        <p class="mb10">
                                            <label class="inputLabel" for="email">{$translate->__("Password")}:</label>
                                            <input type="password" name="password" tabindex="2" />
                                        </p>
                                        <p class="mb10 pb10" style="border-bottom: 1px solid #333333;">
                                            <input type="submit" name="submit" value="{$translate->__("Sign in")}" class="uiButton pr10 pl10" tabindex="4" />
                                            <input type="checkbox" id="remember" name="remember" value="yes" tabindex="3"/>
                                            <label for="remember">{$translate->__("Remember me")}</label>
                                        </p>
                                        <p class="mb5"><a href="{$SITE_URL}/recover/">{$translate->__("Forgot your password?")}</a></p>
                                        <p><a href="{$SITE_URL}/signup/">{$translate->__("Create a new account")}</a></p>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <!-- Sign In -->
                    {/if}

                </div>
            </div>
        </div>
        <!-- Header -->

    {/if}

1 个答案:

答案 0 :(得分:1)

错误意味着,分配给Smarty的至少一个变量不是对象,例如,$translate可能不是对象。它没有直接连接到数据库

当然数据库与文件夹没什么共同之处,所以我不知道为什么你写了你创建数据库s13并将所有数据放到s13文件夹中。您服务器上有文件的数据库和foldername可能不同。