Recent Topics

1 Jul 27, 2007 23:40    

Welcome

This plugin adds show and hide functionality to your posts content. You use it by inserting some code into your skin (3 sample codes are provided), and that's it. It will just magically work.

Moved / Preview / Download / More Information: [url=http://www.balupton.com/blogs/b2evo?title=show_hide_post_contents_plugin]here.[/url]

3 Aug 04, 2007 20:28

Just a heads up: when I validate the XHTML on comiclist.com, I get the following errors related to this plugin:

# Error Line 660, Column 39: "ShowHideThis" is not a member of a group specified for any attribute.

<div class="bSmallPrint" ShowHideThis ShowHideThis_visible ShowHideThis48 >


# Error Line 660, Column 60: "ShowHideThis_visible" is not a member of a group specified for any attribute.

<div class="bSmallPrint" ShowHideThis ShowHideThis_visible ShowHideThis48 >


# Error Line 660, Column 75: "ShowHideThis48" is not a member of a group specified for any attribute.

…eThis ShowHideThis_visible ShowHideThis48 >

Please note, this in no way means there's anything wrong with the plugin. It works great. I love it.

6 Aug 04, 2007 21:37

Yep, you need to place the

<?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?>

within the class attribute. So

<div class="bText <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?>">

where you have it as

<div class="bText" <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?> >

7 Aug 04, 2007 21:50

Thanks, that did it.

8 Aug 09, 2007 14:42

Hi
I'm very interested in this plugin. I was thinking of using it for a multilanguage blog (the content).
How would you suggest setting up the code so that in my text i could have both the uk and fr version, but then the user can make visible either version.
I was thinking of having some kind of code in the content such as [EN]...[/EN] and [FR]...[/FR] which would delimit the content

Let me know if you have any ideas
Cheers
James

9 Aug 09, 2007 15:49

Wow that is actually a great idea, I was thinking of a much more complicated solution to get that translation ability up.

It would be a fair bit of hacking to the plugin, so I will see what I can do for that, should have a plugin out for full translation stuff in up to 4 weeks.

11 Aug 09, 2007 16:15

global $current_User;
if ( is_logged_in() )
$locale = $current_User->locale;
else
$locale = locale_from_httpaccept(); // set default locale by autodetect

then use the locales instead of "french" "english" etc. And this should be a new topic instead of bloating my plugin's topic ;)

12 Aug 09, 2007 16:20

I was trying to keep your plugin slick & small :roll:

14 Aug 09, 2007 20:00

if you need someone to test just shout :)
although I'm still having touble getting the standard plugin to work, it would seem that my setup is not reading the plugin...

I'm on b2evo1.10.2

15 Aug 09, 2007 20:17

jkyndt, try specifically telling the plugin which blogs it should work for...

16 Aug 09, 2007 21:20

thanks for the pointer, unfortunately still does not work
Is there supposed to be code in the header to call the different plugins?

17 Aug 09, 2007 21:28

Can you make a post with the changes you made to your skin and the link to your blog which you are trying to use it for?

19 Aug 09, 2007 21:38

Hrmm yeah the plugin isn't loading at all, could you pm me your b2evo blog's admin details, so I can have a fiddle with the plugin's settings.

22 Aug 09, 2007 22:28

Brilliant, you're a star :)
Had to just change the url's of the images, but otherwise all is perfect
Thanks again for helping out

23 Aug 10, 2007 00:25

Could you elaborate on what you had to do to change the url of the images, because maybe I could make that easier?

Also any other suggestions, one thing I am keen on doing is making the installation experience for all my plugins extremely simple, 'usage.php' is a example of that, but I want it much more simple than that.

So any suggestions or ideas you have I will be really grateful for.

24 Aug 10, 2007 09:03

Certainly,

I probably did not save the pictos in the rightplace so the ".rsc_url" was not pointing to the correct folder.

Provided code:

echo '<img src="'.$rsc_url.'icons/reload.png" onclick="'.$show_hide_post_contents_Plugin->get_toggle_script($Item->ID).'" style="cursor:pointer" title="Show/Hide Post Contents" alt="Show/Hide Post Contents" />';
				echo ' or ';
				$hide_img_url = $rsc_url.'icons/collapse.gif';
				$show_img_url = $rsc_url.'icons/expand.gif';
				echo

New code:

				echo '<img src="http://www.cj-home.net/blog/skins/cj-home/img/reload.png" onclick="'.$show_hide_post_contents_Plugin->get_toggle_script($Item->ID).'" style="cursor:pointer" title="Show/Hide Post Contents" alt="Show/Hide Post Contents" />';
				echo ' ';
				$hide_img_url = 'http://www.cj-home.net/blog/skins/cj-home/img/minus.gif';
				$show_img_url = 'http://www.cj-home.net/blog/skins/cj-home/img/plus.gif';
				echo

Apart from that install vas very staight forward and the instructions clear :D

Cheers

25 Aug 10, 2007 17:07

I downloaded and installed the show/hide plugin yesterday, I followed the instructions, for some reason though, I can't seem to implement the code into my _main.php file so that it works. I keep on getting an error saying that an unexpected '.' was found, Its probably something dumb but any help would be appreciated. The place/line that this error is on is on the line right before the bsmalltext divider. right inside the begin posts section. Any help would greatly be appreciated, If for some reason I didnt explain myself well enough, please write back and I will send you the direct address. Thanks in advance, also I can provide the file if anyone can help by fixing it.

26 Aug 10, 2007 19:09

Code you attach the changes you made to the post, and I will look for that extra . :)

27 Aug 10, 2007 19:45

balupton wrote:

Code you attach the changes you made to the post, and I will look for that extra . :)

Hi balupton, I pm'ed you, with my _main.php script. Its weird though, I got past the errors that were coming up earlier, but now with the new coding I put in there, It just seems like it made absolutely no change, I am assuming that I have to fix my urls but since Im new to b2evo, Im not sure if I just have to point them to the rsc directory or if there is a whole new group of images and js that i have to point to within my customized skin directory. Thanks again, I look forward to hearing back from you.

28 Aug 10, 2007 20:14

here is the zip file

29 Aug 10, 2007 20:22

That is the most hacked up skin I have ever seen! ;)

30 Aug 10, 2007 20:35

balupton wrote:

That is the most hacked up skin I have ever seen! ;)

Should I take that as a compliment? :)

31 Aug 27, 2007 23:04

@balupton,

Can this plugin be set up to show/hide content within a post?
EG: If I have a YouTube video as part of the post content, would I be able to have visible content before and after the YouTube video but just have the show/hide effect the div that contains the video?

32 Aug 27, 2007 23:14

Yes. So say we have

echo $show_hide_post_contents_Plugin->get_toggle_link(/* the "id" of what to show/hide */ $Item->ID); // display text link to toggle display

now also

<div class="bText <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?>">

You can replace $Item->ID with whatever you want, so you could modify the youtube plugin to make the videos be wrapped in 'ShowHideThisYouTubeVideo_something_unique' but the link would need to be manually added to the skin...

I guess you could try that new AstonishMe plugin the Display Whatever Ermm or whatever silly name they ended up calling it, and try get that to work with this plugin.

34 Aug 31, 2007 22:36

I am lost. Will you put the code in this skin. At least I'll be able to see what you've done.

35 Sep 19, 2007 18:07

Weird... this plugin had already worked fine on my blog 3, but now it doesn´t function at all... I've upgraded the plugin to the latest and final version but it doesn't seems to work whether in FF nor in IE.

balupton or some other specialist, could you please have a short look at my page (http://www.chaoszone.de/blog/weblinks.php)... do you perhaps see the problem and know the solution to it? Or is the plugin on my page working correctly for you?

I desperately have tried now for several hours all what comes in my mind... but no solution on the horizon... :(

Thank you very much in advance for all your help...
Daniel

Btw, I'm still using b2evo v1.9.2

36 Sep 19, 2007 18:23

I gave up on it or any support. I tried for a few hours to get the page code correctly inseted into the _main.php, but couldn't get it to properly work. It would make two copies of a post with the contents on one grayed, etc etc..

I am using 1.93 b2evo.

37 Sep 19, 2007 18:36

Mine seems to be integrated correctly... but clicking on the <+> or <-> icons doesn't do anything... but it worked already... some time ago...

39 Sep 20, 2007 10:53

Yeah thanks cslepage, I know that this plugin is great and works in general... but how does this help me? Do you have done something different to the instructions? Do you want to share some code? How could you be helpful getting this plugin working on other blogs as well?

40 Sep 20, 2007 11:43

Here's my code:

<?php
    // ------------------------------------ START OF POSTS ----------------------------------------
    if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

    if( isset($MainList) ) while( $Item = $MainList->get_item() )
    {
        $MainList->date_if_changed();
    ?>



<div class="bPost<?php $Item->status( 'raw' ) ?>" lang="<?php $Item->lang() ?>">

<h3 class="bTitle"><a href="http://feeds.feedburner.com/comiclistcomplete" title="Subscribe to my feed, ComicList Complete" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="border:0"/></a>
<?php
if( $Item->get('url') ) {
   $Item->permanent_link( '#icon#' );
   $Item->title();
   } else { ?>
   <a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
   <?php }
   ?>
 </h3>

<p style="font-size: small; font-weight:bold;">
<?php
	// Show/Hide Post Contents Stuff
	if ( isset($show_hide_post_contents_Plugin) )
	{	// The Show / Hide Post Contents Plugin is installed and enabled!
		echo '';
		// The url of the image to display
		$img_src = $rsc_url.'icons/reload.png';
		// The show / hide text link
		echo $show_hide_post_contents_Plugin->get_toggle_link(/* the "id" of what to show/hide */ $Item->ID); // display text link to toggle display
		// The onclick script to use to show or hide the contents
		$img_onclick = $show_hide_post_contents_Plugin->get_toggle_script($Item->ID);
		// Put it together to output the image
		?><img src="<?php echo $img_src; ?>" onclick="<?php echo $img_onclick; ?>" style="cursor:pointer" title="Show/Hide Post Contents" alt="Show/Hide Post Contents" /><?php
	}

	?>
</p>

<p><?php next_post(); ?></p>
<p><?php previous_post(); ?></p>

<div class="bSmallHead">

<?php
    echo '  ';
    $Item->issue_time();
    echo ', by ';
    // Load Item's creator User:
    $Item->author();
    $Item->msgform_link( $Blog->get('msgformurl') );
    echo ', ';
    $Item->wordcount();
    echo ' ', T_('words');
    echo ', ';
    $Item->views();
    echo ' -- ';
    echo ' ', T_('Categories'), ': ';
    $Item->categories();

?>
</div>

 <div class="bItem_CS <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?>">
    <?php
    $Item->content();
    link_pages("<br />Pages: ","<br />","number");
    ?>
 </div>

<br />
<div class="bSmallPrint"><a href="http://www.thecomicforums.com/forum2//index.php?showforum=177">Discuss this in the ComicList Forum -- </a>
             <?php $Plugins->call_by_code( 'starrating', array('id' => $Item->ID ) ); ?>
             <?php $Item->feedback_link( 'trackbacks' ) // Link to trackbacks ?>
             <?php $Item->feedback_link( 'comments', "from your own site -- " ) // Link to comments ?>
             <?php $Item->feedback_link( 'pingbacks', ' &bull; ' ) // Link to trackbacks ?>
             <?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?>
             <?php $Item->trackback_rdf() // trackback autodiscovery information ?>
<script src="http://feeds.feedburner.com/~s/comiclistcomplete?i=<?php $Item->permanent_url() ?>" type="text/javascript"></script>
<script src="http://feeds.feedburner.com/~s/comiclistfeed?i=<?php $Item->permanent_url() ?>" type="text/javascript"></script>

</div>

<div class="bogus <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_visible ShowHideThis'.$Item->ID; ?>"></div>

        <?php
            // ------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. -------------
            $disp_comments = 1;                 // Display the comments if requested
            $disp_comment_form = 1;         // Display the comments form if comments requested
            $disp_trackbacks = 1;               // Display the trackbacks if requested

            $disp_trackback_url = 1;        // Display the trackbal URL if trackbacks requested
            $disp_pingbacks = 1;                // Display the pingbacks if requested
            require( dirname(__FILE__).'/_feedback.php' );


         // ---------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ----------------

         locale_restore_previous();   // Restore previous locale (Blog locale)
      ?>
   </div>


   <?php
   } // ---------------------------------- END OF POSTS ------------------------------------
   ?>

41 Sep 20, 2007 12:31

Hmm, thanks.. but still I can´t get it working...

42 Sep 20, 2007 14:50

Thanks, I was able to make that work, with a few modifications/deletions. ;)

43 Sep 20, 2007 15:06

Hey mrdav, can you please post your modifications?

44 Sep 20, 2007 15:11

Sure, it seems that the contents on cs's and mine both show rough-looking text, as if the font-smoothing were turned off. This is only the post contents, but if you view the post with comments, it renders fine.

balupton, I wonder if you could shed any light on why this is. I looked through the script and couldn't find naything.



<?php 
    // ------------------------------------ START OF POSTS ---------------------------------------- 
    if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post 

    if( isset($MainList) ) while( $Item = $MainList->get_item() ) 
    { 
        $MainList->date_if_changed(); 
    ?> 



<div class="bPost<?php $Item->status( 'raw' ) ?>" lang="<?php $Item->lang() ?>"> 

<h4 class="bTitle">
<?php 
if( $Item->get('url') ) { 
   $Item->permanent_link( '#icon#' ); 
   $Item->title(); 
   } else { ?> 
   <a href="<?php $Item->permanent_url() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a> 
   <?php } 
   ?> 
 </h4> 

<p style="font-size: small; font-weight:bold;"> 
<?php 
   // Show/Hide Post Contents Stuff 
   if ( isset($show_hide_post_contents_Plugin) ) 
   {   // The Show / Hide Post Contents Plugin is installed and enabled! 
      echo ''; 
      // The url of the image to display 
      $img_src = $rsc_url.'icons/reload.png'; 
      // The show / hide text link 
      echo $show_hide_post_contents_Plugin->get_toggle_link(/* the "id" of what to show/hide */ $Item->ID); // display text link to toggle display 
      // The onclick script to use to show or hide the contents 
      $img_onclick = $show_hide_post_contents_Plugin->get_toggle_script($Item->ID); 
      // Put it together to output the image 
      ?><img src="<?php echo $img_src; ?>" onclick="<?php echo $img_onclick; ?>" style="cursor:pointer" title="Show/Hide Post Contents" alt="Show/Hide Post Contents" /><?php 
   } 

   ?> 
</p> 

<p><?php next_post(); ?></p> 
<p><?php previous_post(); ?></p> 

<div class="bSmallHead"> 

<?php 
    echo '  '; 
    $Item->issue_time(); 
    echo ', by '; 
    // Load Item's creator User: 
    $Item->author(); 
    $Item->msgform_link( $Blog->get('msgformurl') ); 
    echo ', '; 
    $Item->wordcount(); 
    echo ' ', T_('words'); 
    echo ', '; 
    $Item->views(); 
    echo ' -- '; 
    echo ' ', T_('Categories'), ': '; 
    $Item->categories(); 

?> 
</div> 

 <div class="bItem_CS <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_invisible ShowHideThis'.$Item->ID; ?>"> 
    <?php 
    $Item->content(); 
    link_pages("<br />Pages: ","<br />","number"); 
    ?> 
 </div> 

<br /> 
<div class="bSmallPrint"> 
                
             <?php $Item->feedback_link( 'trackbacks' ) // Link to trackbacks ?> 
             <?php $Item->feedback_link( 'comments', "from your own site -- " ) // Link to comments ?> 
             <?php $Item->feedback_link( 'pingbacks', ' &bull; ' ) // Link to trackbacks ?> 
             <?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?> 
             <?php $Item->trackback_rdf() // trackback autodiscovery information ?> 
</div> 

<div class="bogus <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_visible ShowHideThis'.$Item->ID; ?>"></div> 

        <?php 
            // ------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ------------- 
            $disp_comments = 1;                 // Display the comments if requested 
            $disp_comment_form = 1;         // Display the comments form if comments requested 
            $disp_trackbacks = 1;               // Display the trackbacks if requested 

            $disp_trackback_url = 1;        // Display the trackbal URL if trackbacks requested 
            $disp_pingbacks = 1;                // Display the pingbacks if requested 
            require( dirname(__FILE__).'/_feedback.php' ); 


         // ---------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. ---------------- 

         locale_restore_previous();   // Restore previous locale (Blog locale) 
      ?> 
   </div> 


   <?php 
   } // ---------------------------------- END OF POSTS ------------------------------------ 
   ?>

45 Sep 20, 2007 15:39

Hmmm, thanks... but nevertheless... it doesn't helped either... I've tried your codes... but it wouldn't work... by the way, here is my code... perhaps someone can see, what's not working properly...

<?php
	// ------------------------------------ START OF POSTS ----------------------------------------
	$counter = -1;
	if( isset($MainList) ) $MainList->display_if_empty( '' ); // display message if no post
	if( isset($MainList) ) while( $Item = & $MainList->get_item() )
	{
	++$counter;
?>

	<div class="bPost bPost<?php $Item->status( 'raw' ) ?>" lang="<?php $Item->lang() ?>">

		<?php
			locale_temp_switch( $Item->locale );  // Temporarily switch to post locale
			$Item->anchor();                      // Anchor for permalinks to refer to
		?>

		 <h3 class="bTitle"><?php   
		     if (($blog == 1 or $blog == 3) and !empty($Item->url)) {           
		       echo $Item->url_link('', '', $Item->title, array('target' => '_blank'));  
		     } else {  
		       $Item->title();   
		     }  
		 ?></h3> 

		<div class="bSmallHead">
		<?php
			$Item->permanent_link( '#icon#' );
			echo ' <b>';
			$Item->issue_date();
			echo '</b> - ';
			$Item->issue_time();
			echo ', ', T_('Categories'), ': ';
			$Item->categories();
			echo ', Blog: ';
			echo '<span class="bSmallBlog"><a href="'.$Item->Blog->get( 'url', 'raw' ).'">'.$Item->Blog->shortname.'</a></span>';
			if ( isset($show_hide_post_contents_Plugin) )
			{
				echo ' ';
				$hide_img_url='http://www.chaoszone.de/blog/hacks/images/icon-post-collapse.gif';
				$show_img_url='http://www.chaoszone.de/blog/hacks/images/icon-post-expand.gif';
				echo
				'<img '.
					'id="ShowHideThis'.$Item->ID.'_ImgLink" '.
					'src="'.( $counter === 0 ? $hide_img_url : $show_img_url ).'" '.
					'onclick="'.
					   'if ( this.src == \''.$show_img_url.'\' ) '.
					   	'this.src = \''.$hide_img_url.'\'; '.
					   'else '.
					   	'this.src = \''.$show_img_url.'\'; '.
					   $show_hide_post_contents_Plugin->get_toggle_script($Item->ID).'" '.
					'style="cursor:pointer" '.
					'title="Show/Hide Post Contents" '.
					  'alt="Show/Hide Post Contents" '.
				'/>';
				echo '<br><br>';
			}
		?>
		</div>

        <div class="bText <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_'.($counter === 0 ? '' : 'in' ).'visible ShowHideThis'.$Item->ID; ?>">
			<?php $Item->content( '#', '#', '&lt;&lt; WEITER &gt;&gt;', '---' ); // for more information see http://doc.b2evolution.net/v-1-9/evocore/Item.html#methodcontent ?>
			<?php link_pages() ?>
		</div>

		<div class="bSmallPrint bSmallPrint_links <?php if ( isset($show_hide_post_contents_Plugin) ) echo 'ShowHideThis ShowHideThis_'.($counter === 0 ? '' : 'in' ).'visible ShowHideThis'.$Item->ID; ?>">
			<? include("_social-services.php"); ?>
			<?php $Item->permanent_link('<img src="'.$rsc_url.'icons/chain_link.gif" border="0" alt="" title="" />', '#', 'permalink_right'); ?>
			<?php $Item->feedback_link( 'comments', '' ) // Link to comments ?>
			<?php $Item->feedback_link( 'trackbacks', ' &bull; ', '', '0 Trackbacks', '1 Trackback', '%d Trackbacks' ) // Link to trackbacks ?>
			<?php $Item->views( '', ' &bull; eine Ansicht', ' &bull; %d Ansichten'); ?>
			<?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?>
			<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
		</div>

		<?php
			// ------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. -------------
			$disp_comments = 1;			// Display the comments if requested
			$disp_comment_form = 1;		// Display the comments form if comments requested
			$disp_trackbacks = 1;		// Display the trackbacks if requested
			$disp_trackback_url = 1;	// Display the trackbal URL if trackbacks requested
			$disp_pingbacks = 1;		// Display the pingbacks if requested
			require( dirname(__FILE__).'/_feedback.php' );
			// -------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. --------------

			locale_restore_previous();	        // Restore previous locale (Blog locale)
		?>
		<?php if ($blog == 3) { ?> <center><hr style="height:1px; width:100%;"></center>
		<?php } else { ?> <center><p><img src="http://www.chaoszone.de/blog/hacks/images/spacebar-M.gif" alt="" title="" /></p></center> <?php } ?>
	</div>
	<?php
	} // ---------------------------------- END OF POSTS ------------------------------------
?>

46 Oct 05, 2007 08:24

Hmm, weird, but now it´s working again, event when I´ve not changed anything...

Never mind!

[u]Question[/u]: is it possible - and how - to use this amazing plugin for the search function for all blogs as well? First search hit would be shown completely, the other ones only the headline...

Any ideas?

Thanks in advance...
Daniel

47 Jan 19, 2008 16:28

I have never altered my main.php before. I'm a little nervous. My question... I see the sample_skin_change. How do I implement it? Cut and paste into my main.php? Or are there specific codes within the sample that I use?

Thanks ...


Form is loading...