2 sam2kb Nov 26, 2009 20:41

Posts.
I just tried what you recommended, and it only shows up in the single blog listing, not on the main blog page.
Any other suggestions?
Then you should add the code at the end of /skins/YOUR_SKIN/_item_content.inc.php
If the file is not in your current skin copy from global skins directory.
sam2kb wrote:
Then you should add the code at the end of /skins/YOUR_SKIN/_item_content.inc.php
If the file is not in your current skin copy from global skins directory.
Is item_block.inc.php the one you are referring to?
No, but you can add it to item_block.inc.php too, and it's probably a better way :)
I am totally new to this, so please forgive me. What do I add and where in that file do I add it?
What skin are you using?
A Semi custom version of pixel Green
Here is the code for the file:
<?php
/**
* This is the template that displays the item block
*
* This file is not meant to be called directly.
* It is meant to be called by an include in the main.page.php template (or other templates)
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $Item;
// Default params:
$params = array_merge( array(
'feature_block' => false,
'content_mode' => 'auto', // 'auto' will auto select depending on $disp-detail
'item_class' => 'post',
'item_status_class' => 'bPost',
'image_size' => 'fit-400x320',
), $params );
?>
<div id="<?php $Item->anchor_id() ?>" class="<?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>">
<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
?>
<h3 class="bTitle"><?php $Item->title(); ?></h3>
<p><?php
$Item->author( array(
'before' => T_('by').' <strong>',
'after' => '</strong>',
) );
$Item->msgform_link();
?></p>
<?php
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', $params );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
?>
<div class="post-footer">
<div class="sharethis">
<div class="bSmallHead">
<?php
$Item->categories( array(
'before' => T_('Categories').': ',
'after' => ' ',
'include_main' => true,
'include_other' => true,
'include_external'=> true,
'link_categories' => true,
) );
// List all tags attached to this post:
$Item->tags( array(
'before' => T_('Tags').': ',
'after' => '',
'separator' => ', ',
) );
?>
<br />
<?php
// Permalink:
$Item->permanent_link( array(
'class' => 'permalink_right',
'text' => '#icon#'
) );
// Permalink:
$Item->issue_date( array(
'before' => '<img src="img/clock.gif" alt="" class="middle" />',
'after' => ' ',
));
$Item->issue_time( array(
'before' => ' ',
'after' => '',
));
echo ', ';
/*$Item->wordcount();
echo ' '.T_('words');*/
// echo ', ';
// $Item->views();
/*$Item->locale_flag( array(
'before' => ' ',
'after' => '',
) );*/
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'comments',
'link_before' => '<img src="img/comment.gif" alt="" class="middle" />',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
'use_popup' => false,
'class' => 'comments'
) );
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'trackbacks',
'link_before' => ' • ',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
'use_popup' => false,
) );
$Item->edit_link( array( // Link to backoffice for editing
'before' => ' • ',
'after' => '',
) );
?>
</div>
</div>
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array(
'before_section_title' => '<h4>',
'after_section_title' => '</h4>',
) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------
?>
<?php
locale_restore_previous(); // Restore previous locale (Blog locale)
?>
</div>
<?php
// ------------------------- "Post Footer" CONTAINER EMBEDDED HERE --------------------------
// Display container and contents:
skin_container( NT_('Post Footer'), array(
// The following params will be used as defaults for widgets included in this container:
'block_start' => '',
'block_end' => '',
) );
// ----------------------------- END OF "Post Footer" CONTAINER -----------------------------
?>
Do you know of a way to set up images so they automatically print when clicked on? I know it uses Javascript, but I know nothing about programming.
Your skin has the "Post Footer" container so just add a Free HTML widget with your code in "Post Footer" container from Blog settings > Widgets
Do you know of a way to set up images so they automatically print when clicked on?
I don't know what you mean
Thanks for all of your help!
I was trying to use an onclick code so when someone clicked on a picture in my blog, that it would automatically print out the picture
<a href="javascript:self.print()"><img src="#" /></a> ;)
When I use that code, it prints the whole blog page, I just want to print the one image they click on.
(I assumed I replace # with my image location?)
See if this helps http://www.boutell.com/newfaq/creating/printpart.html
I tried that too and it doesn't work in the blog format.
Thanks for all of your help!
I try a lot of ways but still does not work.
If it's gonna be the same text for all posts, add the code to "Single post footer" in Blog settings > Advanced tab