Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/02/2010, 20:04
Solounaduda
 
Fecha de Ingreso: julio-2009
Mensajes: 15
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Insertar un Simple PHP Blog dentro de una web

themes.php (parte 2)
Código PHP:
  function theme_genericentry ( $entry_array, $style='normal' ) { // New 0.5.0
    global $user_colors, $blog_theme, $blog_config;

    // init vars
    $img_path = "themes/" . $blog_theme . "/images/";
    $blog_content = '';
    $blog_content = $blog_content . "\n<!-- STATIC NO HEADER ENTRY START -->\n";

    // Text of entry

    if ( $style == 'solid' ) {
      $blog_content = $blog_content . '<div class="blog_body_solid">' . "\n\t";
    } elseif ( $style == 'clear' ) {
      $blog_content = $blog_content . '<div class="blog_body_clear">' . "\n\t";
    } else {
      $blog_content = $blog_content . '<div class="blog_body_framed">' . "\n\t";
    }

    $blog_content = $blog_content . $entry_array[ 'entry' ];
    $blog_content = $blog_content . "\n\t</div>";

    $blog_content = $blog_content . "<br />";

    $blog_content = $blog_content . "\n<!-- STATIC NO HEADER ENTRY END -->\n";

    return $blog_content;
  }

  function theme_staticentry ( $entry_array ) {
    $blog_content = theme_blogentry( $entry_array, 'static' ); // New 0.4.8
    return $blog_content;
  }

  function theme_commententry ( $entry_array ) {
    $blog_content = theme_blogentry( $entry_array, 'comment' ); // New 0.4.8
    return $blog_content;
  }

  function theme_trackbackentry ( $entry_array ) {
    global $blog_config, $user_colors;

     $blog_content = "\n";

    $blog_content  .= '<div class="blog_subject">' . $entry_array[ 'title' ] . '</div>' . "\n";
    $blog_content  .= '<div class="blog_date">' . $entry_array[ 'date' ] . '</div>' . "\n";

    if ( isset( $entry_array[ 'logged_in' ] ) && $entry_array[ 'logged_in' ] == true ) {
      // Show 'delete' button if the user is logged-in...
      if ( isset( $entry_array[ 'delete' ][ 'url' ] ) ) {
        $blog_content  .= '<a href="' . $entry_array[ 'delete' ][ 'url' ] . '">[ ' . $entry_array[ 'delete' ][ 'name' ] . ' ]</a><br /><br />' . "\n";
      }
    }

    $blog_content  .= $entry_array[ 'excerpt' ] . "<p>\n";

    if ( (isset( $entry_array[ 'blog_name' ] ) ) && ($entry_array[ 'blog_name' ] != "") ) {
       $blog_content = $blog_content . '<a href="'.$entry_array[ 'url' ].'">[ ' . $entry_array[ 'blog_name' ] . " ]</a><p>\n";
    } else {
       $blog_content = $blog_content . '<a href="'.$entry_array[ 'url' ].'">[ ' . $entry_array[ 'url' ] . " ]</a><p>\n";
    }

    $blog_content  .= '<hr />' . "\n";

    return $blog_content;
  }

  // Function:
  // theme_default_colors( )
  //
  // Default Base Colors
  // -------------------
  // $user_colors is an associative array that stores
  // all color information. These are the default colors
  // for the theme. These values are read in, and then
  // get overwritten when the user saved colors are
  // read from file.
  //
  // Note
  // ----
  // You can create your own "keys" but they will not
  // show up in the "colors.php" document yet...
  //
  // Also, only these default keys have translations for
  // different languages. If something is missing, email
  // me and I'll add it for future releases.
  //
  // Eventually you'll have the option of disabling keys
  // and added keys will appear on the "color.php" page.
  function theme_default_colors () {
    global $lang_string;

    $color_def = array();

    array_push( $color_def, array( 'id' => 'bg_color',
                'string' => $lang_string[ 'bg_color' ],
                'default' => 'CCCC99' ) );
    array_push( $color_def, array( 'id' => 'border_color',
                'string' => $lang_string[ 'border_color' ],
                'default' => '4D4D45' ) );
    array_push( $color_def, array( 'id' => 'main_bg_color',
                'string' => $lang_string[ 'main_bg_color' ],
                'default' => 'FFFFFF' ) );
    array_push( $color_def, array( 'id' => 'menu_bg_color',
                'string' => $lang_string[ 'menu_bg_color' ],
                'default' => 'F2F2F2' ) );
    array_push( $color_def, array( 'id' => 'inner_border_color',
                'string' => $lang_string[ 'inner_border_color' ],
                'default' => 'D9D9D9' ) );
    array_push( $color_def, array( 'id' => 'link_reg_color',
                'string' => $lang_string[ 'link_reg_color' ],
                'default' => '993333' ) );
    array_push( $color_def, array( 'id' => 'link_hi_color',
                'string' => $lang_string[ 'link_hi_color' ],
                'default' => 'FF3333' ) );
    array_push( $color_def, array( 'id' => 'link_down_color',
                'string' => $lang_string[ 'link_down_color' ],
                'default' => '3333FF' ) );
    array_push( $color_def, array( 'id' => 'header_bg_color',
                'string' => $lang_string[ 'header_bg_color' ],
                'default' => '999966' ) );
    array_push( $color_def, array( 'id' => 'header_txt_color',
                'string' => $lang_string[ 'header_txt_color' ],
                'default' => 'FFFFFF' ) );
    array_push( $color_def, array( 'id' => 'footer_bg_color',
                'string' => $lang_string[ 'footer_bg_color' ],
                'default' => 'EEEEEE' ) );
    array_push( $color_def, array( 'id' => 'footer_txt_color',
                'string' => $lang_string[ 'footer_txt_color' ],
                'default' => '666666' ) );
    array_push( $color_def, array( 'id' => 'txt_color',
                'string' => $lang_string[ 'txt_color' ],
                'default' => '666633' ) );
    array_push( $color_def, array( 'id' => 'headline_txt_color',
                'string' => $lang_string[ 'headline_txt_color' ],
                'default' => '666633' ) );
    array_push( $color_def, array( 'id' => 'date_txt_color',
                'string' => $lang_string[ 'date_txt_color' ],
                'default' => '999999' ) );

    return ( $color_def );
  }

  // Function:
  // theme_pagelayout( )
  //
  // Page Layout Container/Wrapper
  // -----------------------------
  // This function controls all HTML output to the browser.
  //
  // Invoking the page_content() fuction inserts the actual
  // contents of the page.
  //
  function theme_pagelayout () {
    global $user_colors, $blog_config, $blog_theme, $theme_vars;

    $content_width = $theme_vars[ 'content_width' ];
    $menu_width = $theme_vars[ 'menu_width' ];
    $page_width = $content_width + $menu_width;

    // Default image path.
    $img_path = "themes/" . $blog_theme . "/images/";

    // Begin Page Layout HTML
    ?>
    <body>
      <br />
      <table border="0" width="<?php echo( $page_width ); ?>" cellspacing="0" cellpadding="0" align="center" style="border: 1px solid #<?php echo(get_user_color('border_color')); ?>;">
        <tr align="left" valign="top">
          <td width="<?php echo( $page_width ); ?>" colspan="2" bgcolor="#<?php echo(get_user_color('header_bg_color')); ?>">
            <div id="header_image"><img src="<?php echo( $img_path ); ?>header750x100.jpg" alt="" border="0" /></div>

            <?php
            
if ( $blog_config['blog_enable_title']) { // New for 0.4.6
            
echo('<div id="header">' $blog_config'blog_title' ] . '</div>');
            }
?>

            <div id="pagebody">
              <table border="0" width="<?php echo( $page_width ); ?>" cellspacing="0" cellpadding="0" align="left">
                <tr valign="top">
                  <?php if ( $theme_vars'menu_align' ] == 'left' ) { // New 0.3.8 - Left Menu ?>
                  <td width="<?php echo( $menu_width ); ?>" bgcolor="#<?php echo(get_user_color('menu_bg_color')); ?>" style="border-right: 1px solid #<?php echo(get_user_color('inner_border_color')); ?>;">
                    <div id="sidebar">
                      <?php theme_menu(); ?>
                    </div>
                  </td>
                  <?php ?>
                  <td width="<?php echo( $content_width ); ?>" bgcolor="#<?php echo(get_user_color('main_bg_color')); ?>">
                    <div id="maincontent">
                      <?php page_content(); ?>
                    </div>
                  </td>
                  <?php if ( $theme_vars'menu_align' ] == 'right' ) { // New 0.3.8 - Right Menu ?>
                  <td width="<?php echo( $menu_width ); ?>" bgcolor="#<?php echo(get_user_color('menu_bg_color')); ?>" style="border-left: 1px solid #<?php echo(get_user_color('inner_border_color')); ?>;">
                    <div id="sidebar">
                      <?php theme_menu(); ?>
                    </div>
                  </td>
                  <?php ?>
                </tr>
                <tr align="left" valign="top">
                  <td width="<?php echo( $page_width ); ?>" bgcolor="#<?php echo(get_user_color('footer_bg_color')); ?>" colspan="2">
                    <div id="footer"><?php echo($blog_config'blog_footer' ]); ?> - <?php echo( page_generated_in() ); ?></div>
                  </td>
                </tr>
              </table>
            </div>
          </td>
        </tr>
      </table>
      <br />
    </body>
    <?php
    
// End Page Layout HTML
  
}