Recent Topics

[2.x] Plugin: 'Protect your blogs' questions

Started by on Jan 18, 2009 – Contents updated: Jan 18, 2009

Jan 18, 2009 02:04    

My b2evolution Version: 2.x

Hello.

I just installed the plugin, 'Protect your blogs' from http://waffleson.co.uk/2008/12/protect-your-blogs and in the process of testing it. I believe I followed all of the instructions including added the new table into the database. I then added 'am:protected' to the demo blog 'Blog B' in AdminUI => Blog Settings => Advanced => Notes field. Then I saved the data. I then went to load Blog B and found it is still accessible to the public. I cleared the browser's cache with no change. It seems like a neat plugin though.

Is there something else I need to do to configure the plugin? I haven't looked at the code to see what I can see.

Also, I see in Posts/Comments the button to add custom fields but I haven't tested it yet. At first glance, I'm not exactly sure how to interpret the note for the 'Default' field in the plugin setup that says 'list of default fields for posts, one per line.'

Can someone provide an example of its use and syntax - how to set a default value for the new field e.g. new_field_name = 'default value goes here'? Would it be without quotes or is it something else?

Thanks.

P.S. Hope it's okay to discuss here vs. the plugin's website. I'm just trying to keep feedback regarding my b2evo together in one place.

Jan 18, 2009 07:50

The plugin doesn't use a database table ? Are you confusing BOPIT ( plugin manager ) with AM Protected Blogs ( which is the plugin the post is about ) ?

Custom fields is an entirely different plugin and has it's own writeup ( [url=http://waffleson.co.uk/2009/01/add-fields-to-your-posts]Add fields to your posts[/url] )

¥

Jan 18, 2009 23:38

Thanks for your reply, ¥åßßå.

From the 'Protect your blogs' page:

How does it work?

It's dead simple really, first go grab the plugin from BOPIT, unzip it, upload it, meander into admin and install it .... that was the hard part. For any blog that you wish to protect just put am:protected in the blog notes field and press save ...... and that's it! Instant protected blog ;)

Maybe I need more sleep but I still can't find it. The web page said go to BOPIT. I didn't see 'Protect your blogs' explicitly and the browser 'Find' didn't either on BOPIT so I installed BOPIT to see if it was part of it. It wasn't, but BOPIT is quite cool. I'm glad I have it.

I went back and looked again and found that custom fields plugin that had 'am' in the screenshot. Not that either.

I went to the link on BOPIT and looked at the 'Plugins' and the 'Hacks' links and didn't find it there either.

So, if someone can point me in the right direction, please let me know. I'd still like to take a look at it.

Thanks.

Jan 19, 2009 09:02

BOPIT wrote:

BOPIT works silently in the background and is tightly integrated with your existing b2evolution back-office "Plugins" tab. There's no annoying pop-up messages, nagging you to upgrade. There's no unwanted, automatic downloading. You simply get a visual cue (shaded background), that tells you if your plug-in is current, or if an upgrade is available. If one is available, just click the link and download it. Simple. Easy. Sweet.

There's more. BOPIT adds an extra "Tool" tab (called, strangly enough - "BOPIT"), that provides you with a list of all known plug-ins and skins - and if any that you have are outdated! Each of the supported plug-ins and skins will have a download link, a home page link and link to a support page or forum thread. No wandering all over the Internet, hunting for files!

[url=http://b2evo.astonishme.co.uk/bopit]source[/url]

¥

Jan 20, 2009 01:39

WOW...Now I see it. I didn't realize that the instructions was pointing to the 'AdminUI => Tools' tab. This is the first plugin I've downloaded that had another part to it located somewhere else in this manner.

When I had installed BOPIT a day or so ago, once I saw the highlighting on the Global Settings => Plugins Install showing that some of the plugins is an earlier version, I thought that was cool stuff. What I'm seeing in the 'Tools' tab is even COOLER!

Overall, COOL BEANS!

Thanks as usual and keep the plugins coming. Over time, I hope to do more with b2evo as it seems to be endless in its add-on ability. Right now, I'm trying to get it where I want it so it can 'Go Live' soon. And soon, I will undo the core hacking one step at a time and dive into using plugins myself for this after going live.

Jan 20, 2009 01:44

blogmeister wrote:

WOW...Now I see it. I didn't realize that the instructions was pointing to the 'AdminUI => Tools' tab. This is the first plugin I've downloaded that had another part to it located somewhere else in this manner. ...

Yeah that's weird as hell until you know about it.

Perhaps there is something for the core here? Like, if a plugin uses the "MakeASubTabOnTheToolsTab" hook then it ought to say on the plugin's settings page "visit this link to see your new stuff ya silly noob" which of course links to (get ready...) [url=http://www.youtube.com/watch?v=oHg5SJYRHA0]the plugin's sub tab[/url].

Jan 20, 2009 15:37

Yeah uh huh, EdB. That might just do the trick.

On another note folks, I installed the 'Protect your blogs' plugin and I like it and decided to rollback my hack of the '_blog_main.inc.php' file to the original file, but I kept the hack of the login form that went with it because I want to use the 'Abort login' to send visitors back to the default blog otherwise it would be set to reload the login page since it is the 'redirect_to' page (essentially a loop).

To resolve that [looping] issue, I added a conditional statement that applies to 'links[] =' which is condtional based on the content of the login page's error message e.g. if ( $Message->messages['error'][0] == $error_msg ) whereby $error_msg is that message used by that plugin, then set that link to the default blog folder else that link would be the normal 'redirect_to' in the address bar's query string used elsewhere throughout b2evo.

It works great, but so I can resist the urge to hack this core file, do you see another way to do it without the hack? :?: I'm trying to be rehabilitated (a self-imposed hackers anonymous members local group of one).

Thanks.

Jan 20, 2009 17:07

blogmeister wrote:

decided to rollback my hack of the '_blog_main.inc.php' file to the original file

Bugger me, there really is a God 8|

:roll:

¥

Jan 26, 2009 01:44

Hey ¥åßßå.

I'm still laughing at your last reply...

Q: While using the 'am:protected' feature, what might it take to be able to revise a post whose blog is in protected status but still take advantage of the other statuses versus it automatically changing to 'protected' status upon saving regardless of the post status option selected? :?:

Reason: I have a blog that I only want to keep in protected status temporarily and am either adding or editing posts as they are being constructed before releasing to the public. Depending on each post's 'status' of development, I want to choose its b2evo status accordingly using the existing 'post statuses' available which would include 'Published' for when I remove the am:protected from 'Notes.' I'm trying to prevent having to go back and change all of the posts to 'published' or other status once removing 'am:protected' and/or having to keep e.g. a list on paper that says which posts are complete (and should have 'published' status'), etc.

Thanks.

Jan 26, 2009 09:51

;)

The plugin only changes published to protected, mainly so if you uninstall the plugin you don't suddenly find all your blog is readable by the world ;)

You can kill the behaviour by changing this :

  /**
   * Checks if this is a protected blog
   * If so changes any published posts to protected
   *
   * @param mixed array $params
   */
  function AdminBeforeItemEditCreate( $params = array() )
  {
  	if( preg_match( '~am:protect~i', $params['Item']->Blog->get( 'notes' ) ) && $params['Item']->get( 'status' ) == 'published' )
  	{ // this is a protected blog, public posts not allowed
  		$params['Item']->set( 'status', 'protected' );
  		global $Messages;
  		$Messages->add( $this->T_( 'Post status changed to protected' ), 'success' );
  	}
  }

To :

  /**
   * Checks if this is a protected blog
   * If so changes any published posts to protected
   *
   * @param mixed array $params
   */
  function AdminBeforeItemEditCreate( $params = array() )
  {
    return;
  }

Ideally you'd add it as a setting, but that's a future thing ;)

¥

Feb 12, 2009 07:09

Thanks for your reply, ¥åßßå.

I really like your plugin. I've incorporated it into my blog summary last night, too. I also appreciate you providing me with the solution in your last post and I'll be implementing it very soon.

I'd like to enhance am:protected's power at the 'core' level so that it affects all widgets, plugins and routines that respects the 'Include in public blog list' param; hide blog titles; hide menu buttons and other navigation links; hide 'Published' posts (titles, links, excerpts, etc.) in cross-posts; content searches, etc.

For example, in cross-posts where the post is short enough and 'Read more' is not applicable, the post can be read in its entirety inside of another blog. The 'am:protected' feature wouldn't kick-in until a link within the post is clicked (after the fact). I need to make ALL aspects of 'am:protected' blogs inaccessible unless a member is logged in.

Q: Where in the core (or a good hook' spot - then how? :?: ) can I add an 'am:protected' condition so that it allows the b2evo software to do what it currently does EXCEPT all of its information is completely hidden from view until that member is logged in? :?: Is a good place in '_blog.class.php', 'blogcache.class.php', both or other? :?:

Q: How to [prevent] search engines from indexing any 'am:protected-specified' blog titles and any of its 'Published' content? :?:

Thanks again.

Feb 18, 2009 19:42

Hello again.

Is there a way the 'am:protected' plugin can be revised to prevent displaying 'Published' posts that are cross-posted? The posts need to remain cross-posted but only seen once the member logs in. Currently, some of the shorter posts that are cross-posted are shown in their entirety.

I'm trying to prevent having to edit or to instruct others to edit all cross-posts in each blog the "am:protected" feature is added to whereby each post's status has to be changed to 'Protected' and then back again to 'Published' when the "am:protected" feature is removed.

Thanks.


Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.