Recent Topics

1 Jun 14, 2005 16:24    

Hi there

I could really do with some help. I desperately need to edit the _main.php file in the fplanque2002 skin in order to remove the Top Referers and Recent Referers section from the page. The referers panel is becoming inundated with extremely inappropriate links which I desperately need to remove from view, and they are hitting my page faster than I can block them in the spam list.

I have no PHP programming skills whatsoever, so I really need some help from you guys as to what edits I need to make in order to do this.

All help would be greatly appreciated.

Cheers
Chris

2 Jun 14, 2005 21:07

I'm not familiar with that skin, so I can't tell you exactly where to look. If you want to post a link to your website, I'll take a look and try to give you an idea of what you need to do. I've found that the _main.php file in most skins is pretty well commented. There's lines that display the stats are probably labeled, so you can find them and then add double slashes ( // ) in front of each line of code you want to get rid of. This is better than just deleting the code, because if you take too much, just uncomment it. Keep in mind that even after you remove the stats from the sidebar, people will still be able to view them by adding ?disp=stats onto the end of your url.

3 Jun 14, 2005 21:55

Hi

Have a look at www.chrisgreen.co.uk/blog.

I've tried deleting/labeling what I thought was the right bit of code, but every time I just end up breaking the entire page.

4 Jun 14, 2005 22:34

Ok, I looked in the _main.php file for the Custom skin and it may be the same in yours. There's too much code here to comment out, so just make an extra copy of _main.php for a backup because we're going to be deleting several lines. Find the block of code that begins with

<?php if ($disp !=stats)

Start deleting here and go until you hit the code for the linkblog. The last thing you delete will look something like this:

<?php } ?>

Give that a try, but back up the file first in case you screw up or I'm giving you terrible advice.

5 Jul 16, 2005 04:33

So what happened???

I want that out of mine, too!

Was the suggestion implemented?
Did it work?

Thanks,
=KT

6 Jul 16, 2005 13:03

Hi

The suggested fix did not work, as the code is completely different in the skin I am using (fplanque2002) - the suggestion was based on using the 'custom' skin.

Have reluctantly decided to ditch b2evolution and move my blog over to Wordpress, unless someone can help me out on this?

Many thanks
Chris

7 Jul 17, 2005 13:18

Just delete the following lines from your fplanque2002/_main.php

<?php if (! $stats) { ?>
<div class="bSideItem"> 
	<h3><?php echo T_('Top Referers') ?></h3>
	<?php refererList(5, 'global', 0, 0, 'no', 'baseDomain', ($blog > 1) ? $blog : ''); ?>
	<ul>
	<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
		<li><a href="<?php stats_referer() ?>" rel="nofollow"><?php stats_basedomain() ?></a></li>
		<?php } // End stat loop ?>
	<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>" title="See some viewing statistics"><?php echo T_('more...') ?></a></li>
	</ul>
	<br />
	<h3><?php echo T_('Recent Referers') ?></h3>
	<?php refererList(5, 'global', 0, 0, 'no', '', ($blog > 1) ? $blog : ''); ?>
	<ul>
	<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
		<li><a href="<?php stats_referer() ?>" rel="nofollow"><?php stats_basedomain() ?></a></li>
		<?php } // End stat loop ?>
	<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>" title="See some viewing statistics"><?php echo T_('more...') ?></a></li>
	</ul>
	</div>
<?php } ?>

8 Sep 16, 2005 01:19

What if I'm using the plan skin? What code would I need to remove? Sorry, I'm an newbie to this stuff.

9 Sep 18, 2005 19:58

In the _main.php file of the plain skin just go to the bit that says:


<?php //------------------------Start of Stats---------------------- ?>

Just below that you'll see this:

if ($disp != 'stats') 
	{ ?>
<?php
<div class="boxTop"><?php echo T_('Recent Referers') ?></div>
<div class="postBox">
			<?php refererList(5, 'global', 0, 0, 'no', '', ($blog > 1) ? $blog : ''); ?>
	<ul>
		<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
			<li><a href="<?php stats_referer() ?>"><?php stats_basedomain() ?></a></li>
				<?php } // End stat loop ?>
			<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>"><?php echo T_('more...') ?></a></li>
	</ul></div>
	<div class="boxTop"><?php echo T_('Top Referers') ?></div><div class="postBox">
			<?php refererList(5, 'global', 0, 0, 'no', 'baseDomain', ($blog > 1) ? $blog : ''); ?>
			<ul>
				<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
		<li><a href="<?php stats_referer() ?>"><?php stats_basedomain() ?></a></li>
				<?php } // End stat loop ?>
				<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>"><?php echo T_('more...') 
?></a></li>
			</ul>
	</div>

Change that section of code to this:

if ($disp != 'stats') 
	{ ?>
<?php
/**<div class="boxTop"><?php echo T_('Recent Referers') ?></div>
*
*<div class="postBox">
*			<?php refererList(5, 'global', 0, 0, 'no', '', ($blog > 1) ? $blog : ''); ?>
*	<ul>
*		<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
*			<li><a href="<?php stats_referer() ?>"><?php stats_basedomain() ?></a></li>
*				<?php } // End stat loop ?>
*			<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>"><?php echo T_('more...') ?></a></li>
*	</ul></div>
*
*
*	<div class="boxTop"><?php echo T_('Top Referers') ?></div><div class="postBox">
*			<?php refererList(5, 'global', 0, 0, 'no', 'baseDomain', ($blog > 1) ? $blog : ''); ?>
*			<ul>
*				<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
*		<li><a href="<?php stats_referer() ?>"><?php stats_basedomain() ?></a></li>
*				<?php } // End stat loop ?>
*				<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>"><?php echo T_('more...') 
*?></a></li>
*			</ul>
*	</div>
*/
?>

10 Sep 18, 2005 20:03

Another easy way to "remove" sidebar content without actually deleting, just in case you want it back later on is to cheat.

if( false ) { // cheap trick to 'remove' stuff ?>
...
the thing you want gone
...
<?php } // end cheap trick ?>

11 Sep 20, 2005 21:09

Graham wrote:

Just delete the following lines from your fplanque2002/_main.php

<?php if (! $stats) { ?>
<div class="bSideItem"> 
	<h3><?php echo T_('Top Referers') ?></h3>
	<?php refererList(5, 'global', 0, 0, 'no', 'baseDomain', ($blog > 1) ? $blog : ''); ?>
	<ul>
	<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
		<li><a href="<?php stats_referer() ?>" rel="nofollow"><?php stats_basedomain() ?></a></li>
		<?php } // End stat loop ?>
	<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>" title="See some viewing statistics"><?php echo T_('more...') ?></a></li>
	</ul>
	<br />
	<h3><?php echo T_('Recent Referers') ?></h3>
	<?php refererList(5, 'global', 0, 0, 'no', '', ($blog > 1) ? $blog : ''); ?>
	<ul>
	<?php if( count( $res_stats ) ) foreach( $res_stats as $row_stats ) { ?>
		<li><a href="<?php stats_referer() ?>" rel="nofollow"><?php stats_basedomain() ?></a></li>
		<?php } // End stat loop ?>
	<li><a href="<?php $Blog->disp( 'blogstatsurl', 'raw' ) ?>" title="See some viewing statistics"><?php echo T_('more...') ?></a></li>
	</ul>
	</div>
<?php } ?>

Reversing that can I add this to my skin to HAVE my top and referrers?

12 Sep 20, 2005 21:42

Basically, yes. The only thing that might drag it down is if your skin's css doesn't have a "bSideItem" in it. You'll see in your _main what all the other sidebar bits use for the div class, so kinda use the existing stuff as a guide for adding this bit.


Form is loading...