News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Imam problem sa trakom za login

Started by Lanmi, March 08, 2013, 12:13:31 PM

Previous topic - Next topic

Lanmi

Pozdrav.
Radio sam po jednom tutorialu traku za login i sada zelim da je stavim iznad headera , kao da bude traka na samom vrhu foruma.
Imam sledeci kod :
echo'
<div id="usergreets">';
     
      // Show user avatar
     if (!empty($context['user']['avatar']))
            echo ' <br>
            <div id="avatar"> ', $context['user']['avatar']['image'], '</div>';
      // Show welcome bar.
   if ($context['user']['is_logged'])
                echo ' <div id="memberinfo">';
  //Say hello to member
   if ($context['user']['is_logged'])
      echo '', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b>,';
     
    // Only tell them about their messages if they can read their messages!
      if ($context['allow_pm'])
         echo ' <b>Imaš Poruka:</b><a href="', $scripturl, '?action=pm"> ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

      // Show unread replies to members.
        if ($context['user']['is_logged'])
      echo '
         <a href="', $scripturl, '?action=unread"><b>', $txt['unread_since_visit'] ,'</a></b><br />
         <a href="', $scripturl, '?action=unreadreplies"><b>', $txt['show_unread_replies'] ,'</b></a>';

// Show the total time logged in?
  if ($context['user']['is_logged'])
   echo ' <br />
         ', $txt['totalTimeLogged1'];

   // If days is just zero, don't bother to show it.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

   // Same with hours - only show it if it's above zero.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

    // But, let's always show minutes - Time wasted here: 0 minutes ;).
      if ($context['user']['is_logged'])
   echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '';
   // If the user is a guest, show [login].
         if ($context['user']['is_guest']) {
echo '
<div id="host"><b>Dobrodosli gost!</b></div>
<div id="host2"><b>Molim da se <a href="index.php?action=register">registrujete</a> ili <a href="index.php?action=login">prijavite</a>da biste videli citav sadržaj foruma</b></div>
<div id="floatright">
         <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
            <table border="0" cellpadding="2" cellspacing="0" align="left"><tr>
               <td valign="middle" align="left">
                  <div id="usersbg"><label for="user"><input type="text" onfocus="if(this.value==\'', $txt[35], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[35], '\';" value="', $txt[35], '" name="user" class="usercss" id="user" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <div id="passwordsbg"><label for="passwrd"><input type="password" onfocus="if(this.value==\'', $txt[36], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[36], '\';" value="', $txt[36], '" name="passwrd" class="passwrdcss" id="passwrd" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <input type="image" src="http://img831.imageshack.us/img831/9112/loginbutton.png"border="0" />
               </td>
               <td valign="middle" align="left">
                  <a href="?action=register"><img src="http://img8.imageshack.us/img8/2318/registerbuttonk.png" border="0" /></a>
               </td>
            </tr></table>
         </form>
</div>';


Taj kod sam stavio iznad <divid = header> , i izbacuje mi erore.
Evo kod od tog dela , pa pogledajte:
function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
   <div id="bodybg">
      <div id="wrapper">
echo'
<div id="usergreets">';
     
      // Show user avatar
     if (!empty($context['user']['avatar']))
            echo ' <br>
            <div id="avatar"> ', $context['user']['avatar']['image'], '</div>';
      // Show welcome bar.
   if ($context['user']['is_logged'])
                echo ' <div id="memberinfo">';
  //Say hello to member
   if ($context['user']['is_logged'])
      echo '', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b>,';
     
    // Only tell them about their messages if they can read their messages!
      if ($context['allow_pm'])
         echo ' <b>Imaš Poruka:</b><a href="', $scripturl, '?action=pm"> ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

      // Show unread replies to members.
        if ($context['user']['is_logged'])
      echo '
         <a href="', $scripturl, '?action=unread"><b>', $txt['unread_since_visit'] ,'</a></b><br />
         <a href="', $scripturl, '?action=unreadreplies"><b>', $txt['show_unread_replies'] ,'</b></a>';

// Show the total time logged in?
  if ($context['user']['is_logged'])
   echo ' <br />
         ', $txt['totalTimeLogged1'];

   // If days is just zero, don't bother to show it.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

   // Same with hours - only show it if it's above zero.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

    // But, let's always show minutes - Time wasted here: 0 minutes ;).
      if ($context['user']['is_logged'])
   echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '';
   // If the user is a guest, show [login].
         if ($context['user']['is_guest']) {
echo '
<div id="host"><b>Dobrodosli gost!</b></div>
<div id="host2"><b>Molim da se <a href="index.php?action=register">registrujete</a> ili <a href="index.php?action=login">prijavite</a>da biste videli citav sadržaj foruma</b></div>
<div id="floatright">
         <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
            <table border="0" cellpadding="2" cellspacing="0" align="left"><tr>
               <td valign="middle" align="left">
                  <div id="usersbg"><label for="user"><input type="text" onfocus="if(this.value==\'', $txt[35], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[35], '\';" value="', $txt[35], '" name="user" class="usercss" id="user" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <div id="passwordsbg"><label for="passwrd"><input type="password" onfocus="if(this.value==\'', $txt[36], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[36], '\';" value="', $txt[36], '" name="passwrd" class="passwrdcss" id="passwrd" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <input type="image" src="http://img831.imageshack.us/img831/9112/loginbutton.png"border="0" />
               </td>
               <td valign="middle" align="left">
                  <a href="?action=register"><img src="http://img8.imageshack.us/img8/2318/registerbuttonk.png" border="0" /></a>
               </td>
            </tr></table>
         </form>
</div>';

         <div id="header">
            <div id="logo">
               <a href="'.$scripturl.'" title=""></a>
            </div>';
            if (!empty($settings['enable_news'])){
            echo '
            <div id="news">
               <p>', $context['random_news_line'], '</p>
            </div>';
            }
      echo '
         </div>
         <div id="toolbar">
            <div id="nav">
               ',template_menu(),'
            </div>
         </div>
        <div id="mainarea">';


         // Show the navigation tree.
         theme_linktree();
         
}


A ovo su erori : Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in index.template.php on line 167

Unapred hvala.
Ili ako neko ima vec uradjen kod i radim mu , bio bih mu zahvalan da mi da.

Chupko

Imao si jednu "echo" funkciju visak. Pokusaj sada :)


function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo'
   <div id="bodybg">
      <div id="wrapper">
<div id="usergreets">';
     
      // Show user avatar
     if (!empty($context['user']['avatar']))
            echo ' <br>
            <div id="avatar"> ', $context['user']['avatar']['image'], '</div>';
      // Show welcome bar.
   if ($context['user']['is_logged'])
                echo ' <div id="memberinfo">';
  //Say hello to member
   if ($context['user']['is_logged'])
      echo '', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b>,';
     
    // Only tell them about their messages if they can read their messages!
      if ($context['allow_pm'])
         echo ' <b>Imaš Poruka:</b><a href="', $scripturl, '?action=pm"> ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

      // Show unread replies to members.
        if ($context['user']['is_logged'])
      echo '
         <a href="', $scripturl, '?action=unread"><b>', $txt['unread_since_visit'] ,'</a></b><br />
         <a href="', $scripturl, '?action=unreadreplies"><b>', $txt['show_unread_replies'] ,'</b></a>';

// Show the total time logged in?
  if ($context['user']['is_logged'])
   echo ' <br />
         ', $txt['totalTimeLogged1'];

   // If days is just zero, don't bother to show it.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

   // Same with hours - only show it if it's above zero.
    if ($context['user']['is_logged'])
    echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

    // But, let's always show minutes - Time wasted here: 0 minutes ;).
      if ($context['user']['is_logged'])
   echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '';
   // If the user is a guest, show [login].
         if ($context['user']['is_guest']) {
echo '
<div id="host"><b>Dobrodosli gost!</b></div>
<div id="host2"><b>Molim da se <a href="index.php?action=register">registrujete</a> ili <a href="index.php?action=login">prijavite</a>da biste videli citav sadržaj foruma</b></div>
<div id="floatright">
         <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
            <table border="0" cellpadding="2" cellspacing="0" align="left"><tr>
               <td valign="middle" align="left">
                  <div id="usersbg"><label for="user"><input type="text" onfocus="if(this.value==\'', $txt[35], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[35], '\';" value="', $txt[35], '" name="user" class="usercss" id="user" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <div id="passwordsbg"><label for="passwrd"><input type="password" onfocus="if(this.value==\'', $txt[36], '\')value=\'\';" onblur="if(this.value==\'\')value=\'', $txt[36], '\';" value="', $txt[36], '" name="passwrd" class="passwrdcss" id="passwrd" size="15" /></label></div>
               </td>
               <td valign="middle" align="left">
                  <input type="image" src="http://img831.imageshack.us/img831/9112/loginbutton.png"border="0" />
               </td>
               <td valign="middle" align="left">
                  <a href="?action=register"><img src="http://img8.imageshack.us/img8/2318/registerbuttonk.png" border="0" /></a>
               </td>
            </tr></table>
         </form>
</div>';

         <div id="header">
            <div id="logo">
               <a href="'.$scripturl.'" title=""></a>
            </div>';
            if (!empty($settings['enable_news'])){
            echo '
            <div id="news">
               <p>', $context['random_news_line'], '</p>
            </div>';
            }
      echo '
         </div>
         <div id="toolbar">
            <div id="nav">
               ',template_menu(),'
            </div>
         </div>
        <div id="mainarea">';


         // Show the navigation tree.
         theme_linktree();
         
}

Lanmi

isto mi izbacuje , samo sada na liniji 229 kaze da fali negde <

rocknroller

Quote from: Lanmi on March 09, 2013, 04:20:02 PM
isto mi izbacuje , samo sada na liniji 229 kaze da fali negde <

Što je točno u toj liniji? kopiraj cijelu ovdje.

Advertisement: