Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Themes
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Thu Jun 28, 2012 4:36 am Reply with quote

Hi Guys, I tried to convert this theme to make the drop menu. I think I did it but I need you to check it out. I would like to have my Login and Register back on the left too.

Original


Code:
<body bgcolor="#FFFFFF" text="#000000">

<center>$showbanners</center>
<table class="bodyline" width="100%" cellspacing="0" cellpadding="0" border="0">
   <tr>
   <td align="center" valign="top">
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="60%" background="themes/MacOS/images/headbkgn.gif" bgcolor="#ffffff"><a href="index.php"></td>
        <td width="40%" align="right" background="themes/MacOS/images/headbkgn.gif" bgcolor="#FFFFFF"><a href="index.php"></td>       
        </tr>
     </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td height="23" width="150" align="left" nowrap background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff"><img src="themes/MacOS/images/logo.png" border="0" alt="$sitename"></td>
              <td align="center" valign="middle" background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff"><div align="center"><a href="index.php" target="_self"><img src="themes/MacOS/images/home.gif" border="0" alt="Homepage"></a><a href="modules.php?name=Your_Account" target="_self"><img src="themes/MacOS/images/account.gif" border="0" alt="My Account"></a><a href="modules.php?name=Downloads" target="_self"><img src="themes/MacOS/images/down.gif" border="0" alt="Downloads"></a><a href="modules.php?name=Forums" target="_self"><img src="themes/MacOS/images/forum.gif" border="0" alt="Forums"></a></div></td>
              <td width="150" align="right" nowrap background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="12%" background="themes/MacOS/images/foot2.gif" bgcolor="#FFFFFF"><img src="themes/MacOS/images/foot1.gif" border="0" alt="$sitename"></td>
        <td width="75%" background="themes/MacOS/images/foot4.gif" bgcolor="#FFFFFF"><div align="right"><font class="topbar">$theuser</font></div></td>
        <td width="13%" valign="top" background="themes/MacOS/images/foot4.gif" bgcolor="#FFFFFF"><div align="right"><img src="themes/MacOS/images/foot3.gif" border="0" alt="$sitename"></div></td>
      </tr>
    </table>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
<td valign="top" width="1" >


Modified by me

Code:
<body bgcolor="#FFFFFF" text="#000000">

<center>$showbanners</center>
<table class="bodyline" width="100%" cellspacing="0" cellpadding="0" border="0">
   <tr>
   <td align="center" valign="top">
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="60%" background="themes/MacOS/images/headbkgn.gif" bgcolor="#ffffff"><a href="index.php"></td>
        <td width="40%" align="right" background="themes/MacOS/images/headbkgn.gif" bgcolor="#FFFFFF"><a href="index.php"></td>       
        </tr>
     </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td height="23" width="150" align="left" nowrap background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff"><img src="themes/MacOS/images/logo.png" border="0" alt="$sitename"></td>
              <td align="center" valign="middle" background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff"

              <td width="150" align="right" nowrap background="themes/MacOS/images/bkgn.gif" bgcolor="#ffffff">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="12%" background="themes/MacOS/images/foot2.gif" bgcolor="#FFFFFF"><img src="themes/MacOS/images/foot1.gif" border="0" alt="$sitename"></td>
        <td width="75%" background="themes/MacOS/images/foot4.gif" bgcolor="#FFFFFF"><div align="left"><font class="topbar">$navMenu</font></div></td>
        <td width="13%" valign="top" background="themes/MacOS/images/foot4.gif" bgcolor="#FFFFFF"><div align="right"><img src="themes/MacOS/images/foot3.gif" border="0" alt="$sitename"></div></td>
      </tr>
    </table>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
<td valign="top" width="1" >


I think it is not correct at all since I lost $theuser but with your help I think I will fix it. Give me examples if it is possible. Thanks
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Thu Jun 28, 2012 9:31 am Reply with quote

This theme is very old. I have it downloaded from clanthemes and tried a run with RN25. This theme comes with no forum template and the bugs in the markup are to crazy. It haves many errors in theme.php, too. Some functions are not more present in RN or would rewritten. I think the best one is, you take a theme from RN package an rebuild this MacOS theme on the base of a newer one. So you have an forum template an cleaner markup without so much errors.

I have tried to clean the function themeheader and i have needed to much time. This theme have to many bugs an its to old.

open: theme.php and replace the function themeheader:

Code:
function themeheader() {

    global  $admin, $user, $banners, $sitename, $slogan, $prefix, $db, $nukeurl, $anonymous, $nukeNAV;
   if ($banners) {
      $adText = '';
      $adText = ads(0);
      if (!empty($adText)) {
         $showbanners = $adText;
      } else {
         $showbanners = '';
      }
   };   
   if ($showbanners != '') {
   echo '<div class="headerbanner">' . $showbanners . '</div>' . PHP_EOL;
    }
   $userinfo = array();
   $username = '';
   if (is_user($user)) {
      $userinfo = getusrinfo($user);
      $username = htmlspecialchars(check_html($userinfo['username'], 'nothtml'), ENT_QUOTES, _CHARSET);
    }   
    if ($username == '') {
        $username = 'Anonymous';
    }

   $datetime = "<script type=\"text/javascript\">\n\n"
   ."<!--   // Array ofmonth Names\n"
   ."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
   ."var now = new Date();\n"
   ."thisYear = now.getYear();\n"
   ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
   ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
   ."// -->\n\n"
   ."</script>";


    echo '<body bgcolor="#ffffff" text="#000000" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">' . PHP_EOL;
   if ($username == 'Anonymous') {
      $theuser = '<a href="modules.php?name=Your_Account">' . _LOGIN . '</a> or <a href="account-new_user.html">' . _BREG . '</a>';
    } else {
      $theuser = '&nbsp;&nbsp;' . _BWEL . ' ' . $username . '!';
    }   

   echo '<div class="headerwrap">' . PHP_EOL
      . '   <div class="header">' . PHP_EOL
      . '      <div class="headermid">' . PHP_EOL
      . '         <a href="./"><img src="themes/MacOS/images/home.gif" border="0" alt="Homepage"></a>' . PHP_EOL
      . '         <a href="modules.php?name=Your_Account"><img src="themes/MacOS/images/account.gif" border="0" alt="My Account"></a>' . PHP_EOL
      . '         <a href="modules.php?name=Downloads"><img src="themes/MacOS/images/down.gif" border="0" alt="Downloads"></a>' . PHP_EOL
      . '         <a href="forums.html"><img src="themes/MacOS/images/forum.gif" border="0" alt="Forums"></a></div>' . PHP_EOL
      . '      <div class="headerleft"></div>' . PHP_EOL
      . '      <div class="headerright"></div>' . PHP_EOL
      . '      <div class="menuebar">' . PHP_EOL
      . '         <div class="menueleft"><span>' . $sitename . '</span></div>' . PHP_EOL
      . '         <div class="menuemid">' . $nukeNAV . '</div>' . PHP_EOL
      . '         <div class="menueright"><span>' . $theuser . '</span></div>' . PHP_EOL
      . '      </div>' . PHP_EOL      
      . '   </div>' . PHP_EOL
      . '</div>' . PHP_EOL
      . '<br class="clear-both" />' . PHP_EOL
      . '<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">' . PHP_EOL
      . '<tr valign="top">' . PHP_EOL
      . '   <td valign="top" width="1">' . PHP_EOL;
          
   $public_msg = public_message();
     blocks('l');
    $tmpl_file = "themes/MacOS/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}


open: styles/styles.css and add this at the end of file:

Code:
.headerbanner {width:100%; vertical-align:top; text-align:center;}

.headerwrap {width:100%; vertical-align:top;}
.header {background:url('themes/MacOS/images/headbkgn.gif'); position:relative}
.headerleft {width:150px; height:120px; vertical-align:top; background:url('../../../themes/MacOS/images/logo.gif') 0 -2px; float:left;}
.headerright {width:150px; height:120px; vertical-align:top; background:url('../../../themes/MacOS/images/logo.gif') 0 -2px; float:right;}
.headermid {text-align:center; vertical-align:top; position:absolute; width:100%; top:37px;}
.menuebar {clear:both; width:100%; height:24px; background:url('../../../themes/MacOS/images/foot4.gif') repeat-x;}
.menueleft {width:12%; height:24px; background:url('../../../themes/MacOS/images/foot1.gif') left no-repeat; float:left;}
.menueright {width:13%; height:24px; background:url('../../../themes/MacOS/images/foot3.gif') right no-repeat; float:right; text-align:right;}
.menueleft span, .menueright span {display:block; margin-top:4px;}
.menueleft span {margin-left:10px;}
.menueright span {margin-right:10px;}


After this copy the NukeNav.css from theme RavenIce theme into the styles folder of your theme. Now you have an new header. Its not perfect, but its a beginning and it shows you the way, what you can do it to replace the tables. You can see the massive work on this old theme and i hope you can see it now, why is it better to use a newer theme to rebuild. The rest of this theme lie in your hands... Smile

Wink


Last edited by neralex on Fri Jun 29, 2012 4:35 am; edited 1 time in total 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Thu Jun 28, 2012 5:09 pm Reply with quote

You are totally right and I've been modifying the whole theme. I do want to fix this theme. I did all the modification u told me but I guess you repeat 2 lines I guess.

Code:
.headerleft {width:150px; height:120px; vertical-align:top; background:url('../../../themes/MacOS/images/logo.gif') 0 -2px; float:left;}

.headerright {width:150px; height:120px; vertical-align:top; background:url('../../../themes/MacOS/images/logo.gif') 0 -2px; float:right;}


Let me know what I need to do in header.html
 
neralex







PostPosted: Fri Jun 29, 2012 4:07 am Reply with quote

Repeat? They are the left and right boxes in the header. the first called headerleft and the second headerright, headerleft is floated left and headerright ist floated right. Both have the same background image. You can modify the box styles. Its was set for better understanding.

You don't need the header.html with this replaced function. I have deleted the implode lines to the header.html.

You have many errors in the original code and more errors in your version. This is it, why i must rebuild in the original header code. How can I detect a incorrect part where the error is, if I do not know the whole theme?
 
hicuxunicorniobestbuildpc







PostPosted: Fri Jun 29, 2012 4:41 am Reply with quote

Ok. Now I understand the purpose. I already did all and it is working properly but I would like to see Login & Register on the left.
 
neralex







PostPosted: Fri Jun 29, 2012 4:55 am Reply with quote

You must only set the variable $theuser on the left side.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Themes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©