Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes
Author Message
derek765
Regular
Regular



Joined: Sep 27, 2012
Posts: 99
Location: Okinawa, Japan

PostPosted: Fri Nov 30, 2012 12:39 am Reply with quote

Hello everyone,

I am having trouble trying to center the Menu Navigation links in the Altered Dark theme.

I have edited it to make it move to the right a little bit, but not centered how I would like it, seems like the admin links are interfering as well I would like to move the Welcome, USER to the far left, just how Raven has his Menu Nav setup with this theme.


Altered Dark - theme.php

Code:
<?php

if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
if (!defined('NUKE_FILE')) die ('You can\'t access this file directly...');
$bgcolor1 = '#1A1A1A';
$bgcolor2 = '#080808';
$bgcolor3 = '#1A1A1A';
$bgcolor4 = '#080808';
$textcolor1 = '#ffffff';
$textcolor2 = '#E00909';

/*
 * To hide left-hand blocks for a given module, add an element to
 * this array with the module name (directory name).  To show the
 * blocks, just remove the element from the array.
 */
$hide_blocks_left = array('Forums');
global $name;
if (!isset($name)) $name = '';

function themeheader() {
   global $db, $prefix, $banners, $sitename, $user, $admin, $admin_file, $nukeurl, $slogan, $name, $nukeNAV;
   echo '<body>' . PHP_EOL;
   if ($banners) {
      $adText = '';
      $adText = ads(0);
      if (!empty($adText)) {
         echo '<div id="banner_pagetop">' . $adText . '</div>' . PHP_EOL;
      }
   };
   echo '<div class="minmax">' . PHP_EOL
      . '   <div id="header_wrap">' . PHP_EOL
      . '      <div id="header">' . PHP_EOL
      . '         <div id="head_content">' . PHP_EOL
      . '            <a href="' . $nukeurl . '" title="' . $sitename . '"><img src="images/undergroundkinglogo.png" alt="' . $sitename . '" border="0" /></a>' . PHP_EOL
      . '         </div>' . PHP_EOL;
   if ($banners) {
      echo '      <div id="head_ad">' . PHP_EOL
         . '         '. ads(1)
         . '      </div>' . PHP_EOL;
   };
   echo'</div>';
   if (empty($nukeNAV)) {
      echo '<div id="menu">' . PHP_EOL
         . '   <div id="menu_links">' . PHP_EOL
         . '      <ul>' . PHP_EOL
         . '         <li><a href="index.php">' . _HOME . '</a></li>' . PHP_EOL
         . '         <li><a href="modules.php?name=Downloads">' . _UDOWNLOADS . '</a></li>' . PHP_EOL
         . '         <li><a href="modules.php?name=Your_Account">' . _FSIYOURACCOUNT . '</a></li>' . PHP_EOL
         . '         <li><a href="forums.html">' . _BBFORUMS . '</a></li>' . PHP_EOL
         . '         ' . (is_user($user) ? '<li><a href="modules.php?name=Your_Account&amp;op=logout">' . _LOGOUT . '</a></li>' : '') . PHP_EOL
         . '         ' . (is_admin($admin) ? '<li><a href="' . $admin_file . ' . php?op=adminMain">' . _FSIADMINMENU . '</a></li>' : '') . PHP_EOL
         . '      </ul>' . PHP_EOL
         . '   </div>' . PHP_EOL
         . '<div id="menu_welcome">' . PHP_EOL;
   } else {
      echo '<div id="menunav">' . PHP_EOL;
      echo $nukeNAV;
      echo '<div id="menu_welcomenav">' . PHP_EOL;
   }
   if (is_user($user)) {
      $uinfo = cookiedecode($user);
      echo _BWEL . ' ' . stripslashes($uinfo[1]);
   } else {
      echo '<ul>' . PHP_EOL
         . '   <li>&nbsp;&nbsp;<a href="modules.php?name=Your_Account">' . _LOGIN . '</a> ' . _OR . '</li>' . PHP_EOL
         . '   <li><a href="modules.php?name=Your_Account&amp;op=new_user">' . _BREG . '</a></li>' . PHP_EOL
         . '</ul>' . PHP_EOL;
   }
   echo '</div>' . PHP_EOL
      . '</div>' . PHP_EOL
      . '</div>' . PHP_EOL
      . '<div id="main_content">' . PHP_EOL;

   global $hide_blocks_left;
   if (in_array($name, $hide_blocks_left)) {
      echo '<div id="middle_full">' . PHP_EOL; //<!-- center column -->
   } else {
      if(defined('INDEX_FILE') && INDEX_FILE===true) {
         // right blocks are showing
         echo '<div id="middle">' . PHP_EOL; //<!-- center column -->
      } else {
         // right blocks are NOT showing
         echo '<div id="middle_alt">' . PHP_EOL; //<!-- center column -->';
      }
   }
}


function themefooter() {
   global $db, $prefix, $name;
   echo '   </div>' . PHP_EOL //<!-- end center column -->
      . '</div>' . PHP_EOL; //<!-- end content -->

   global $hide_blocks_left;
   if (!in_array($name, $hide_blocks_left))  {
      echo '<div id="left">' . PHP_EOL; //<!-- left column -->' . "\n";
      blocks('l');
      echo PHP_EOL . '</div>' . PHP_EOL; //<!-- end left column -->' . "\n";
   }
   if(defined('INDEX_FILE') && INDEX_FILE===true) { //display right blocks
      echo '<div id="right">' . PHP_EOL; //<!-- start right column with right blocks -->
      blocks('r');
      echo '</div>' . PHP_EOL;// <!-- end right column with right blocks -->
   } else { // don't display right blocks
      echo '<div id="right">' . PHP_EOL //<!-- start right column no right blocks -->
         . '</div>' . PHP_EOL; // <!-- end right column no right blocks -->
   }

   echo '<div style="clear: both"></div>' . PHP_EOL
      . '<div id="footer">' . PHP_EOL
      . LGL_MENU_HTML;
     footmsg();
     echo '</div>' . PHP_EOL
      . '</div>' . PHP_EOL;
}

$GLOBALS['nest_count'] = 0;
function OpenTable() {
  $GLOBALS['nest_count']++;
  if ($GLOBALS['nest_count'] % 2 == 0) {
   echo '<div class="block">' . PHP_EOL
      . '   <div class="block_gradient">' . PHP_EOL
      . '      <div>&nbsp;</div>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '   <div class="block_content">' . PHP_EOL;
  } else {
    echo '<div class="article">' . PHP_EOL
       . '   <div class="article_top"></div>' . PHP_EOL
       . '   <div class="article_content">' . PHP_EOL;
  }
}

function CloseTable() {
  echo '</div>' . PHP_EOL;
  echo ($GLOBALS['nest_count'] % 2 == 0) ? '<div class="inv_article_bot">' . PHP_EOL : '<div class="article_bot">' . PHP_EOL;
  echo '<div>&nbsp;</div></div>
    </div>
  ';
  $GLOBALS['nest_count']--;
}

function OpenTable2() {
  OpenTable();
}

function CloseTable2() {
  CloseTable();
}

function themesidebox($title, $content, $bid='') {
   static $nobid;
   if (empty($title)){
     $btitle = '&nbsp;';
   } else {
     $btitle = $title;
   }
   if (!empty($bid)){
     $BlockID = 'sideblock' . $bid;
   } else {
     if (isset($nobid)){
      $nobid++;
     } else {
      $nobid=1;
     }
     $BlockID = 'otherblock' . $nobid;
   }
   echo '<div class="block">' . PHP_EOL
      . '   <div class="block_top">' . PHP_EOL
      . '      <h3>' . $title . '</h3>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '   <div class="block_content">' . PHP_EOL
      . '      ' . $content . PHP_EOL
      . '   </div>' . PHP_EOL
      . '   <div class="article_bot"></div>' . PHP_EOL
      . '</div>' . PHP_EOL;
}

function themecenterbox($title, $content, $bid = '') {
   global $admin, $admin_file;
   echo '<div class="block_center">' . PHP_EOL
      . '   <div class="block_top">' . PHP_EOL
      . '      <h3>' . $title . '</h3>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '<div class="article_content">' . PHP_EOL
      . '   ' . $content . PHP_EOL;
   if (is_admin($admin) && !empty($bid)) {
      echo '   <br /><br />' . PHP_EOL
         . '   <div class="text-center">' . PHP_EOL
         . '      [ <a href="' . $admin_file . ' . php?op=BlocksEdit&amp;bid=' . $bid . '">' . _EDIT . '</a> ]' . PHP_EOL
         . '   </div>' . PHP_EOL;
   }
   echo '</div>' . PHP_EOL
      . '<div class="article_bot"></div>' . PHP_EOL
      . '</div>' . PHP_EOL;
}

function FormatStory($thetext, $notes, $aid, $informant) {
  global $anonymous;
  $content = '';
  $thetext = '<div>' . $thetext . '</div>' . PHP_EOL;
  if (!empty($notes)) {
    $notes = '<br /><strong>' . _NOTE . '</strong>&nbsp;<div>' . $notes . '</div>' . PHP_EOL;
  } else {
    $notes = '';
  }
  if ($aid == $informant) {
    $content = $thetext.$notes;
  } else {
    if(!empty($informant)) {
      global $admin, $user;
      if (is_user($user)|| is_admin($admin)) {
        $content = '<a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username=' . $informant . '"><span class="italic">' . $informant . '</span></a> ';
      } else {
        $content = $informant . ' ';
      }
    } else {
        $content = $anonymous . ' ';
    }
    $content .= '<span class="italic">' . _WRITES . ':</span>&nbsp;&nbsp;' . $thetext . $notes;
  }
  echo $content;
}

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
   global $anonymous, $tipath;
   echo '<div class="article">' . PHP_EOL
      . '   <div class="article_top"></div>' . PHP_EOL
      . '   <div class="article_content">' . PHP_EOL
      . '      <div class="atitle">' . PHP_EOL
      . '      <h2>' .  $title .'</h2>' . PHP_EOL
      . '      <p>' . PHP_EOL
      . '         ' . _POSTEDON . ' ' . $time . ' ' . _IN . ' <a href="modules.php?name=News&amp;new_topic=' . $topic . '">' . $topictext . '</a>' . PHP_EOL
      . '         <br />' . _BY . ' ' . PHP_EOL;
               formatAidHeader($aid);
   echo '      </p>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '<div class="entry">' . PHP_EOL
      . '   <blockquote>' . PHP_EOL
      . '      <a href="modules.php?name=News&amp;new_topic=' . $topic . '" title="' . $topictext . '"><img src="' . $tipath.$topicimage . '" border="0" alt="' . $topictext . '" title="' . $topictext . '" align="right" /></a>' . PHP_EOL;
            FormatStory($thetext, $notes, $aid, $informant);
   echo '   </blockquote>' . PHP_EOL
      . '</div>' . PHP_EOL
   //echo substr($morelink, 1, strlen($morelink) - 2); //get rid of the ( ) around the $morelink :)
   //echo ' | ' .  $counter  . ' ' .  _READS;
      . '</div>' . PHP_EOL
      . '<p class="links">' . $morelink . '</p> ' . PHP_EOL
      . '<div class="article_bot"></div>' . PHP_EOL
      . '</div>' . PHP_EOL
      . '<br />' . PHP_EOL;
}

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext, $notes) {
   global $admin, $sid, $tipath;
   echo '<div class="article">' . PHP_EOL
      . '   <div class="article_top"></div>' . PHP_EOL
      . '   <div class="article_content">' . PHP_EOL
      . '      <div class="atitle">' . PHP_EOL
      . '         <h2>' . $title . '</h2>' . PHP_EOL
      . '         <p>' . PHP_EOL
      . '            ' . _POSTEDON . ' ' . $datetime . ' ' . _IN . ' <a href="modules.php?name=News&amp;new_topic=' . $topic . '">' . $topictext . ' </a><br /> ' . _BY . ' ' . PHP_EOL;
                  formatAidHeader($aid);
   echo '         </p>' . PHP_EOL
      . '      </div>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '   <div class="entry">' . PHP_EOL
      . '      <blockquote>' . PHP_EOL;
               FormatStory($thetext, $notes, $aid, $informant);
   echo '      </blockquote>' . PHP_EOL
      . '   </div>' . PHP_EOL
      . '</div>' . PHP_EOL;
}
 
View user's profile Send private message Visit poster's website
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Fri Nov 30, 2012 2:47 am Reply with quote

check this:
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Tue Nov 25, 2014 6:07 am Reply with quote

hi neralex: This trick works properly. Thanks for sharing.

My #menuwelcomenav went out of the header line and I use this

Code:
#menu_welcomenav{width:auto;float:right;padding-right:24px;padding-top:6px;margin-top:-25px;}


with margin-top:-25px was the only way to center that. Do you have any other method?
 
View user's profile Send private message
neralex







PostPosted: Tue Nov 25, 2014 9:16 am Reply with quote

The container #menu_welcomenav isn't a part of the nukeNAV. These are two different containers and in your theme the both are floated. In this way you can't center it dynamically. So you have to rebuild the theme on this place with inline elements.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> 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 ©