Avatar billede rune-boege Nybegynder
28. juni 2006 - 18:57 Der er 2 kommentarer

php/tpl problemer -

Jeg har en index.tpl fra den originale fil, som jeg skal have proppet mit design i fra den jeg selv har lavet.

Her kommer den originale som skal ændres:

Index.tpl
---------
<html>
<head>
<title>FlashChat v{$data.version}</title>
<meta http-equiv=Content-Type content="text/html;  charset=UTF-8">
{literal}
<style type=text/css>
<!--
td {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
}
.small {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: normal;
}
.title {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: bold;
}
input {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
}
select {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
}
A {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #0000FF;
}
A:hover {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #FF0000;
}

.error_border {
    border: 1px solid #FF0000;
    background-color: #FFFFFF;
    font-size: 12px;
    font-weight: normal;
}
-->
</style>
<script language='Javascript'>
<!--
function formIsValid() {
    // check to make sure a valid username has been entered
    if ( document.login.username.value == '' ) {
        alert('Please input a username.');
        return false;
    }

    return true;
}

// a small poupup window to show who's in the chat at the current time
function showInfo() {
    // the size of the popup window
    var width = 400;
    var height = 300;

    // the x,y position of the popup window
    // NOTE: this formula will auto-center the popup on the screen
    var y = (screen.height - height) / 2;
    var x = (screen.width - width) / 2;

    var url = 'info.php';
    var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';

    // open the info window as a popup, instead of embedded in webpage
    window.open( url, 'info', options );
}

function basicLogin() {
    if (formIsValid()) document.login.submit();
}

function popupLogin() {
    // check to make sure a valid username has been entered
    if (!formIsValid()) return;

    var username = document.login.username.value;
    var password = document.login.password.value;
    var lang = document.login.lang.value;

    // the size of the popup window
    var width = 800;
    var height = 600;

    // the x,y position of the popup window
    // NOTE: this formula will auto-center the popup on the screen
    var y = (screen.height - height) / 2;
    var x = (screen.width - width) / 2;

    var url = 'flashchat.php?username=' + username + '&password=' + password + '&lang=' + lang;
    var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';

    // open the chat window as a popup, instead of embedded in webpage
    window.open( url, 'chat', options );
}
//-->
</script>
{/literal}
</head>
<body>

<table border="0" align="center" width=500 cellpadding="4">
  <tr>
    <td nowrap width="34%"> <span class=title>Welcome to FlashChat v {$data.version}</span> </td>
    <td width="66%" align=right> <a href="java script:showInfo();">Who's in the chat?</a></a> </td>
  </tr>
  {if $data.file_exists}
      <tr>
        <td colspan=2 class="error_border" align="center">
        <font color="red"><b>Security alert!</b><br>install.php, or the install_files folder, are still present on your server. Please remove these files before continuing.
        </font>
        </td>
    </tr>
  {/if}
  <form action="flashchat.php" method="post">
    <tr>
      <td width="34%" nowrap>Start FlashChat using built-in login</td>
      <td width="66%"><input name="submit" type="submit" id="submit" value="Login &gt;&gt;"></td>
    </tr>
  </form>
  <tr>
    <td colspan="2"><hr></td>
  </tr>
  <form action="flashchat.php" method="post" name="login">
    <tr>
      <td colspan="2">Start FlashChat using HTML-based login</td>
    </tr>
    <tr>
      <td colspan="2" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td><div align="right">Username:</div></td>
            <td><input type="text" name="username">
            {if $data.is_cms}
                &nbsp;<a href="profile.php?register=true"  target="_blank">register</a>
            {/if}
            </td>
          </tr>
          <tr>
            <td><div align="right">Password:</div></td>
            <td><input type="password" name="password">
                {if $data.is_cms}
                    &nbsp;<a href="profile.php?newpassword=true"  target="_blank">new password</a>
                    &nbsp;&nbsp;<a href="profile.php?oldpassword=true"  target="_blank">current password</a>
                {/if}
                </td>
          </tr>
          <tr>
            <td><div align="right">Language:</div></td>
            <td><select name="lang">
                {assign var=selected value=$data.defaultLanguage}
                {foreach from=$data.languages key=key item=ordersel}
                    <option value="{$key}"{if $key==$selected}selected{/if}>{$ordersel.name}</option>
                {/foreach}
              </select></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input name="button" type="button" onClick="java script:basicLogin();" value="Login &gt;&gt;"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input name="button" type="button" onClick="java script:popupLogin();" value="Popup Login &gt;&gt;"></td>
          </tr>
          <tr>
            <td colspan="2">
            {if $data.is_statelesscms}
                <!--
                  To login as a moderator, use <b>{$data.adminPassword}</b> as the password.
                To login as a spy, use <b>{$data.spyPassword}</b> as the password. These passwords can be set in the FlashChat configuration file.
                -->
                <font color="Red"><b> To login as an administrator, moderator or spy, please use the passwords found in FlashChat's
                configuration file, with any username.
                </b></font>
            {else}   
                To login as a moderator or spy, you must use a registered login with the moderator
                or spy "role" assigned to it. This can be done at registration, or using FlashChat's
                <a href="admin.php">admin.php</a> file (to access this you must have a valid admin login).
            {/if}
            </td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td colspan="2" class=small><hr></td>
    </tr>
    <tr>
      <td width="30%" valign=top nowrap>Start FlashChat using a direct link</td>
      <td width="70%"><a target=login href="flashchat.php?username=__random__&lang=en">Standard
        Auto-Login</a><br><a target=login href="flashchat.php?username=__random__&password={$data.adminPassword}&lang=en">Administrator
        Auto-Login</a><br><a target=login href="flashchat.php?username=__random__&password={$data.moderatorPassword}&lang=en">Moderator
        Auto-Login</a><br><a target=login href="flashchat.php?username=__random__&password={$data.spyPassword}&lang=en">Spy
        Auto-Login</a><br><a target=login href="flashchat.php?username=__random__&lang=en&room=3">Auto-Login to Room #3</td>
    </tr>
    <tr>
      <td colspan="2" class=small><hr></td>
    </tr>
    <tr>
      <td colspan=2><a target=demo href="sample.php">ACME Widgets Demo</a>.
          This demo shows how you can integrate FlashChat into your website's template. ACME Widgets is a ficticous company.
        </td>
    </tr>
    <tr>
      <td colspan=2 class=small><hr></td>
    </tr>
    <tr>
      <td colspan=2><a href=http://www.tufat.com/chat.php target="purchase">Purchase
        FlashChat for your website for $5!</a></td>
    </tr>
    <tr>
      <td class=small colspan=2>What you get: All PHP source code, All Flash source code (.FLA file), MySQL
        table structures, installation instructions, free technical support at
        the <a href=http://www.tufat.com/phpBB2/ target="support">TUFaT.com support
        forum</a>.</td>
    </tr>
    <tr>
      <td class=small colspan=2>Minimum requirements: PHP 4.1.2, MySQL 3.23, Flash
        7. You do NOT need Flash Communication Server or any other server components.</td>
    </tr>
    <tr>
      <td class=small colspan=2>FlashChat is the copyright of Darren Gates and
        TUFaT.com. Re-sale of FlashChat is strictly prohibited. The purpose of
        FlashChat is to give companies, organizations, and individuals a simple
        way to add live chat capabilities to any PHP/MySQL-enabled website. Technical
        support is available on the TUFaT.com support forum, and upgrades are
        free.</td>
    </tr>
  </form>
</table>

</body>
</html>
----------

Denne fil vil jeg have til at se således ud:

---------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Speeks - Chat alt du vil helt gratis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="img/123lh.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #005FA9}
.style4 {color: #005FA9; font-weight: bold; }
-->
</style></head>

<body background="img/bg_blue.jpg">
<br>
<table width="500" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td bgcolor="#FFFFFF"><h1 align="right"><a href="http://www.123livehelp.com" target="_blank"></a></h1>
      <table width="100%" height="1" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
        <tr>
          <td bgcolor="#CCCCCC"></td>
        </tr>
      </table>      <h1 align="left">&nbsp;</h1>
    <h1 align="left">Velkommen til Chatten p&aring; speeks.dk - Bruger Login </h1>     
    <p>Dette login er kun for Brugere, kun Brugere kan logge ind her, med brugernavn og password. Indtaster en admin sit password forkert flere end 3 gange i strej, sp&aelig;rres kontoen i 20 min. </p>
    </td>
  </tr>
</table>
<table width="500" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="150" align="right" valign="top">      <img src="img/admin-icon.gif" width="100" height="100" border="0" alt="admin panel">    </td>
    <td>
        <h1>Bruger Login </h1>
        <p><br>
        Brugernavn: 
          <input type="text" name="username">
        </p>
        <p>Kodeord: 
          <input type="password" name="password">
        </p>
        <p><input name="button" type="button" onClick="java script:basicLogin();" value="Login &gt;&gt;">&nbsp; </p>
        <p>&nbsp; </p></td>
  </tr>
</table>
<table width="500" height="1" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td bgcolor="#CCCCCC"></td>
  </tr>
</table>
<table width="500" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td><p>Hvis du som Bruger har et problem med at logge p&aring;, bedes du kontakte Rune hurtigst muligt, bliv ikke ved med at intaste dit password hvis det ikke hj&aelig;lper. Det er vigtigt du beskriver hvad der g&aring;r galt i dit login pass. <a href="http://gigahost.dk"></a></p>
      <div align="center"><a href="http://www.speeks.dk/" target="_parent">Hjem </a> &nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="http://www.speeks.dk/support" target="_parent">Support</a> &nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="http://www.speeks.dk/faq" target="_parent">FAQ</a> &nbsp;&nbsp;|&nbsp;&nbsp;
      <a href="http://www.speeks.dk/kontakt" target="_parent">Kontakt</a>
      &nbsp;&nbsp;|&nbsp;&nbsp;<a href="http://www.speeks.dk/brugerlogin">Brugerlogin</a>  &nbsp;&nbsp;|&nbsp;&nbsp; <a href="http://www.speeks.dk/adminlogin">Adminlogin</a>  &nbsp;&nbsp;|&nbsp;&nbsp; <a href="http://www.speeks.dk/modlogin">Modlogin</a> <br>
      <br>
      </div>
     
  </td>
  </tr>
</table>


 
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
      <td align="center">
    <div id="footer">
    &copy;2006-2007 Speeks.dk<a href="http://www.speeks.dk" target="_blank">.</a> All rights reserved    </div>
    </td>
  </tr>
</table>
</body>
</html>

----

jeg har glemt en boks som hedder language, men det er ikke mit problem, problemet er at lave min index.html om til index.tpl og så få den til at virke som tpl i min chat, håber der er nogen der er friske.
Avatar billede cybermike Nybegynder
04. juli 2006 - 14:25 #1
Hvorfor er det altid at folk spammer eksperten med ligegyldig kildekode?

går sådan her:

a: Oprids problemet, spørg efter kompetente folk.

1: Folk melder sig.

b: Udvælg en du giver opgaven, aftal pris, forudbetalt 10-25% afh af opgavens størelse udlever ftp/scp/ssh adgang til serveren

2: Udvikleren løser problemet.

c: Du betaler slutbetalingen.

Resultat: Alle er glade og du har ikke slidt mit mussehjul ved at scrolle igennem al de ligegyldige kode :P

Jeg er desuden kompetent til at løse den opgave, kontakt mig på mc@mcs.bz hvis jeg skal hjælpe med at løse opgaven.

  Mvh
Mikkel Christensen
Avatar billede rune-boege Nybegynder
04. januar 2007 - 13:39 #2
Og du burde bannes for at dumhed eller hvad?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester